Internal compiler error in `reverse_condition', at jump.c:3260 , i80x86, using asm()
Etienne Lorrain
etienne_lorrain@yahoo.fr
Wed Jan 31 06:50:00 GMT 2001
Hello,
I am using GCC-2.95.3-pre2 but IHMO it does not matter.
I would like to write this:
extern inline void gpokeb (unsigned offset, unsigned char value)
{
asm volatile (" movb %c0,%%gs:(%1) "
: : "qi" (value), "g" (offset));
}
i.e. move a constant _or_ a register to a gs-relative address,
which can itself be constant or variable.
When I use with the "value" variable, I get:
user.c: In function `EGA_setpixel':
user.c:2119: Internal compiler error in `reverse_condition', at jump.c:3260
Please submit a full bug report.
See <URL: http://www.gnu.org/software/gcc/bugs.html > for instructions.
because probably the "%c0" is not valid - it is more waiting "%w0"
or "%b0" to match register "%al". But I need the "%c0" for constants
to add the "$"...
One solution could be:
extern inline void gpokeb (unsigned offset, unsigned char value)
{
if (__builtin_constant_p (offset)) {
if (__builtin_constant_p (value))
asm volatile (" movb %c0,%%gs:%a1 " : : "i" (value), "g" (offset));
else
asm volatile (" movb %0,%%gs:%a1 " : : "q" (value), "g" (offset));
}
else {
if (__builtin_constant_p (value))
asm volatile (" movb %c0,%%gs:(%1) " : : "i" (value), "g" (offset));
else
asm volatile (" movb %0,%%gs:(%1) " : : "q" (value), "g" (offset));
}
}
But then I have the warning:
gmem.h:271: warning: asm operand 0 probably doesn't match constraints
Also, some combination of "offset" need "%a1" and other needs "(%1)",
I did not investigate this totally.
IHMO "%c0" should be treated as "%0" when a register is used, like you
can write "%w1" and the "w" is ignored if that word is the content of
a memory location.
Am I doing something very wrong here?
Thanks,
Etienne.
___________________________________________________________
Do You Yahoo!? -- Pour dialoguer en direct avec vos amis,
Yahoo! Messenger : http://fr.messenger.yahoo.com
More information about the Gcc
mailing list