CC register for x86-64 asm statements. Was: glibc: syscalls for x86-64

Andreas Jaeger aj@suse.de
Wed Nov 22 02:30:00 GMT 2000


>>>>> Jan Hubicka writes:

>> +    : "i" (__NR_##name) ASM_ARGS_##nr : "memory", "cc", "r11", "cx");         \
 > This is good point for the disucussion.  The i386 backend has been born
 > as cc0 target, that assumes every instruction to clobber flags, so in i386
 > code, the "cc" in clobber list has no effect.

 > The new i386 backend implementation has flags modelled as register and thus
 > does know about instructions not modifying flags and can use this information
 > for schedulilng (as well as some other optimizations).
 > To remain backward compatible with old i386 code, every asm statement implicitly
 > gets the "cc" clobber.

 > Now the question is, whether we want to stay at safe ground and inherit
 > this behaviour from i386 code, or want to require the proper "cc" mentioned
 > in the clobber list.
 > To my opinion, the second solution is cleaner, but most likely brings just
 > small improvements and most probably lots of problems for developers.
 > So I would preffer to stay with the current scheme.

 > Someone is against?
Not really, since most lazy programmers will either forgot the "cc"
clobber - or add it always to be on the safe side.

Where can it bring advantages?

Andreas
-- 
 Andreas Jaeger
  SuSE Labs aj@suse.de
   private aj@arthur.inka.de
    http://www.suse.de/~aj


More information about the Gcc mailing list