This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

i386: asm("%z0" :: "g" ((char)0)) aborts...


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]