Launchpad has imported 3 comments from the remote bug at
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=44624.

If you reply to an imported comment from within Launchpad, your comment
will be sent to the remote bug automatically. Read more about
Launchpad's inter-bugtracker facilities at
https://help.launchpad.net/InterBugTracking.

------------------------------------------------------------------------
On 2010-06-22T08:06:28+00:00 Matthias Klose wrote:

[forwarded from https://launchpad.net/bugs/590859]

seen with 4.4 branch and -O2, not -O1, works with 4.3.

When compiling with :
gcc -O2 -c -o proc.o proc.c
The generated code is :
   0x000000af <+175>: movl $0x0,%gs:0x4
   0x000000ba <+186>: lgdtl (%edx)
   0x000000bd <+189>: mov $0x18,%edx
   0x000000c2 <+194>: mov %edx,%gs
   0x000000c4 <+196>: mov %eax,%gs:0x0

When compiling with :
gcc -O1 -c -o proc.o proc.c
   0x000000af <+175>: lgdtl (%edx)
   0x000000b2 <+178>: mov $0x18,%edx
   0x000000b7 <+183>: mov %edx,%gs
   0x000000b9 <+185>: mov %eax,%gs:0x0
   0x000000bf <+191>: movl $0x0,%gs:0x4

The first code is wrong : register GS is used (movl $0x0,%gs:0x4) before
loading the GDT (lgdtl (%edx))

Reply at:
https://bugs.launchpad.net/ubuntu/+source/gcc-4.4/+bug/590859/comments/4

------------------------------------------------------------------------
On 2010-06-22T08:07:00+00:00 Matthias Klose wrote:

Created attachment 20973
preprocessed source

Reply at:
https://bugs.launchpad.net/ubuntu/+source/gcc-4.4/+bug/590859/comments/5

------------------------------------------------------------------------
On 2010-06-22T09:33:29+00:00 Jakub-gcc wrote:

This is a bug in the testcase.
The asms don't have "memory" clobber, so memory stores can be scheduled across 
it.  If you add it, the testcase works fine.

Reply at:
https://bugs.launchpad.net/ubuntu/+source/gcc-4.4/+bug/590859/comments/6

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/590859

Title:
  wrong code (wrong order) generated with -O2

To manage notifications about this bug go to:
https://bugs.launchpad.net/gcc/+bug/590859/+subscriptions


-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to