This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
i386: asm("%z0" :: "g" ((char)0)) aborts...
- To: gcc-bugs at gcc dot gnu dot org
- Subject: i386: asm("%z0" :: "g" ((char)0)) aborts...
- From: gcc at horizon dot com
- Date: 11 Sep 2001 12:21:44 -0000
It seems that someone forgot the "case 1:" in the relevant switch() in
print_operand (i386.c:3458 on my snapshot)
To quote the codesourcery snapshot compiler,
void foo() { asm("%z0" :: "g" ((char)0)); }
produced:
/usr/tmp/@10639.7.c: In function `foo':
/usr/tmp/@10639.7.c:1: Internal compiler error in print_operand, at config/i386/i386.c:3495
Please submit a full bug report,
with preprocessed source if appropriate.
See for instructions.
To give a more useful version, try the ones-complement checksum routine
asm("add%z0 %2,%0; adc%z0 %3,%0" : "=r" (sum) :
"r" (sum), "g" (c), "g" ((typeof sum)0));
Isn't this the correct way to put an operand-size suffix on an asm
instruction?
Also exists in 2.95.