[Bug inline-asm/37195] unrelated variables get the same memory address in inline assembly

2008-09-02 Thread jdemeyer at cage dot ugent dot be


--- Comment #3 from jdemeyer at cage dot ugent dot be  2008-09-02 08:52 
---
Created an attachment (id=16187)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=16187&action=view)
Further testcase simplification

The third testcase uses only "rm" and "=&rm" constraints, which means that it
might not be specific to i386 targets.  I still have to try other targets. 
Note that the bug only occurs if there are sufficiently many registers in the
clobber list (otherwise the compiler just uses registers for everything).


-- 

jdemeyer at cage dot ugent dot be changed:

   What|Removed |Added

  Attachment #16183|0   |1
is obsolete||


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37195



[Bug inline-asm/37195] unrelated variables get the same memory address in inline assembly

2008-09-01 Thread jdemeyer at cage dot ugent dot be


-- 

jdemeyer at cage dot ugent dot be changed:

   What|Removed |Added

 CC||jdemeyer at cage dot ugent
   ||dot be
   Severity|major   |normal
Version|4.3.2   |4.4.0


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37195



[Bug inline-asm/37195] unrelated variables get the same memory address in inline assembly

2008-09-01 Thread jdemeyer at cage dot ugent dot be


-- 

jdemeyer at cage dot ugent dot be changed:

   What|Removed |Added

   Severity|normal  |major


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37195



[Bug inline-asm/37195] unrelated variables get the same memory address in inline assembly

2008-09-01 Thread jdemeyer at cage dot ugent dot be


--- Comment #2 from jdemeyer at cage dot ugent dot be  2008-09-01 18:18 
---
Created an attachment (id=16183)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=16183&action=view)
Better and simpler test case

The second test case, asmtest2.i exhibits the bug on even more versions of gcc.
 To run the testcase, do
gcc -O1 -save-temps asmtest2.i -o asmtest2

Consider the following piece of inline assembly (the second one of asmtest2.i):
asm("# ASM 2\n"
"movl %5, %2\n"
"movl %4, %0\n"
"movl %0, %1\n"
"movl %3, %0\n"
: "=&a" (c0), "=&rm" (c1), "=&rm" (c2)
: "rm" (b0), "rm" (b1), "0" (b2)
: "cc", "%esi", "%edi", "%edx"
);

gcc 4.3.2 compiles this as
movl %eax, -40(%ebp)
movl -24(%ebp), %eax
movl %eax, -44(%ebp)
movl -40(%ebp), %eax

Note that %2 and %3 are both stored in -40(%ebp).  I think this is a bug.

I have tried this with the following versions of gcc, all of which have the
bug: 3.4.6, 4.0.3, 4.1.2, 4.2.4, 4.3.1, 4.3.2


-- 

jdemeyer at cage dot ugent dot be changed:

   What|Removed |Added

  Attachment #16123|0   |1
is obsolete||


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37195



[Bug inline-asm/37195] unrelated variables get the same memory address in inline assembly

2008-08-21 Thread jdemeyer at cage dot ugent dot be


--- Comment #1 from jdemeyer at cage dot ugent dot be  2008-08-21 21:16 
---
Created an attachment (id=16123)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=16123&action=view)
Source code which shows the problem


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37195