Summary: | improper load from volatile | ||
---|---|---|---|
Product: | gcc | Reporter: | John Regehr <regehr> |
Component: | target | Assignee: | Not yet assigned to anyone <unassigned> |
Status: | RESOLVED DUPLICATE | ||
Severity: | normal | CC: | gcc-bugs, rguenth |
Priority: | P3 | Keywords: | wrong-code |
Version: | 4.3.0 | ||
Target Milestone: | 4.7.0 | ||
Host: | i686-pc-linux-gnu | Target: | i686-pc-linux-gnu |
Build: | i686-pc-linux-gnu | Known to work: | 4.1.2, 4.7.0 |
Known to fail: | 4.0.1, 4.3.0, 4.4.0, 4.6.4 | Last reconfirmed: | 2008-12-29 03:54:58 |
Description
John Regehr
2008-03-30 04:18:26 UTC
This works for me on the trunk. I either get a cmove or a branch. I'm not sure what is going on, I get the same code as before using r141907 on Ubuntu Hardy on x86. What compiler options are you using and what platform? regehr@john-home:~$ current-gcc -O -S vol.c -o - .file "vol.c" .text .globl foo .type foo, @function foo: pushl %ebp movl %esp, %ebp subl $8, %esp call bar cmpl $1, %eax sbbl %eax, %eax andl g_156, %eax leave ret .size foo, .-foo .comm g_156,4,4 .ident "GCC: (GNU) 4.4.0 20081116 (experimental)" .section .note.GNU-stack,"",@progbits regehr@john-home:~$ regehr@john-home:~$ current-gcc -v Using built-in specs. Target: i686-pc-linux-gnu Configured with: ../configure --program-prefix=current- --enable-languages=c,c++ --prefix=/home/regehr Thread model: posix gcc version 4.4.0 20081116 (experimental) (GCC) regehr@john-home:~$ *** Bug 35762 has been marked as a duplicate of this bug. *** Confirmed, -march=i386 -mtune=i686 is needed to confirm the bug in general. GCC is producing a "conditional move" for the code even though it is invalid to produce such a thing. |