Re: inline asm clobbers

2015-03-12 Thread Paul_Koning
On Mar 11, 2015, at 8:53 PM, David Wohlferd d...@limegreensocks.com wrote: ... I would agree that one should avoid it. I'd be wary of removing it from GCC at this point since it might break working code. It certainly would. It’s not all that common, but I have seen this done in

Re: inline asm clobbers

2015-03-12 Thread David Wohlferd
Resending due to bounced email. On 3/11/2015 6:19 PM, Ian Lance Taylor wrote: On Wed, Mar 11, 2015 at 5:51 PM, David Wohlferd d...@limegreensocks.com wrote: The reason I believe the order can change is this comment from i386.h: /* Order in which to allocate registers. Each register must be

Re: inline asm clobbers

2015-03-12 Thread Jakub Jelinek
On Thu, Mar 12, 2015 at 02:02:37PM -0700, David Wohlferd wrote: To wrap this up: Like Ian said, the order of registers here apparently never changes. I read more into that comment than I should have. For good luck, I experimented with -fomit-frame-pointer, -ffixed-, etc, and nothing has

Re: inline asm clobbers

2015-03-12 Thread Jeff Law
On 03/12/15 15:26, Jakub Jelinek wrote: On Thu, Mar 12, 2015 at 02:02:37PM -0700, David Wohlferd wrote: To wrap this up: Like Ian said, the order of registers here apparently never changes. I read more into that comment than I should have. For good luck, I experimented with

Re: inline asm clobbers

2015-03-12 Thread David Wohlferd
On 3/12/2015 7:24 AM, paul_kon...@dell.com wrote: On Mar 11, 2015, at 8:53 PM, David Wohlferd d...@limegreensocks.com wrote: ... I would agree that one should avoid it. I'd be wary of removing it from GCC at this point since it might break working code. It certainly would. It’s not all

Re: inline asm clobbers

2015-03-12 Thread Segher Boessenkool
On Thu, Mar 12, 2015 at 03:09:52PM -0700, David Wohlferd wrote: Ahh. So perhaps as I suspected: this is more commonly used on non-i386 platforms. So clearly removing this is out of the question. glibc uses it for PowerPC and s390 at least (I only grepped for 3, quotes included -- there may

Re: inline asm clobbers

2015-03-11 Thread Ian Lance Taylor
On Wed, Mar 11, 2015 at 5:51 PM, David Wohlferd d...@limegreensocks.com wrote: The reason I believe the order can change is this comment from i386.h: /* Order in which to allocate registers. Each register must be listed once, even those in FIXED_REGISTERS. List frame pointer late and

inline asm clobbers

2015-03-11 Thread David Wohlferd
Why does gcc allow you to specify clobbers using numbers: asm ( : : r (var) : 0); // i386: clobbers eax How is this better than using register names? This makes even less sense when you realize that (apparently) the indices of registers aren't fixed. Which means there is no way to know

Re: inline asm clobbers

2015-03-11 Thread Ian Lance Taylor
On Wed, Mar 11, 2015 at 4:41 PM, paul_kon...@dell.com wrote: On Mar 11, 2015, at 7:19 PM, Ian Lance Taylor i...@google.com wrote: On Wed, Mar 11, 2015 at 3:58 PM, David Wohlferd d...@limegreensocks.com wrote: Why does gcc allow you to specify clobbers using numbers: asm ( : : r (var)

Re: inline asm clobbers

2015-03-11 Thread David Wohlferd
On 3/11/2015 4:19 PM, Ian Lance Taylor wrote: On Wed, Mar 11, 2015 at 3:58 PM, David Wohlferd d...@limegreensocks.com wrote: Why does gcc allow you to specify clobbers using numbers: asm ( : : r (var) : 0); // i386: clobbers eax How is this better than using register names? This makes

Re: inline asm clobbers

2015-03-11 Thread Paul_Koning
On Mar 11, 2015, at 7:19 PM, Ian Lance Taylor i...@google.com wrote: On Wed, Mar 11, 2015 at 3:58 PM, David Wohlferd d...@limegreensocks.com wrote: Why does gcc allow you to specify clobbers using numbers: asm ( : : r (var) : 0); // i386: clobbers eax How is this better than

Re: inline asm clobbers

2015-03-11 Thread Ian Lance Taylor
On Wed, Mar 11, 2015 at 3:58 PM, David Wohlferd d...@limegreensocks.com wrote: Why does gcc allow you to specify clobbers using numbers: asm ( : : r (var) : 0); // i386: clobbers eax How is this better than using register names? This makes even less sense when you realize that

Re: inline asm clobbers

2015-03-11 Thread David Wohlferd
On 3/11/2015 4:41 PM, paul_kon...@dell.com wrote: On Mar 11, 2015, at 7:19 PM, Ian Lance Taylor i...@google.com wrote: On Wed, Mar 11, 2015 at 3:58 PM, David Wohlferd d...@limegreensocks.com wrote: Why does gcc allow you to specify clobbers using numbers: asm ( : : r (var) : 0); // i386: