tags:

views:

83

answers:

1

Hi, I'm using third party library which compiled one week ago.
Today I sat down at the desk again, i pushed build again, then my head blown out.
I've been shot with this error:

impossible constraint in 'asm'

The code is:

static inline unsigned ROLc(unsigned word, const int i)
{
   asm ("roll %2,%0"
      :"=r" (word)
      :"0" (word),"I" (i));
   return word;
}

Some mystery things happens...only thing which I'm thinking right now is 'WTF?'
Platform Intel CoreDuo with W32 XP on board.

Two additional questions:

  1. what could destroy my build?
  2. I suppose that asm syntax is incorrect, so how can i fix that?
  3. Where can I find 'cool' asm reference (I mean some cpp reference like over pure processor commands list datasheet/manual)

regards P.

UPDATE:
Haha I feel like dump-ass, last week i've installed strawberry perl...which installs and throws gcc on path and my build system takes 'default' compiler....:D
However i've fixed that using :

return (word << i) | (word >> (32 - i));
+3  A: 
  1. You might have auto-upgraded to a new compiler, that has changed the syntax
  2. This suggests using Ic rather than I; I didn't test this
  3. Not sure what you mean, a C++ reference for assembly doesn't make a lot of sense to me. This is an (old) HOWTO on gcc and inline assembly, it might be what you're after?
unwind
bua