This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug target/32450] -pg seemingly causes miscompilation
- From: "ubizjak at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 4 Jul 2007 14:26:44 -0000
- Subject: [Bug target/32450] -pg seemingly causes miscompilation
- References: <bug-32450-6642@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #11 from ubizjak at gmail dot com 2007-07-04 14:26 -------
Hm...
--cut here--
// just a stupid testcase, don't bother with source
long long test(long long a, long long b)
{
return a / b;
}
--cut here--
cc1 -O2:
test:
.LFB2:
movq %rdi, %rdx
movq %rdi, %rax
sarq $63, %rdx
idivq %rsi
ret
cc1 -O1 -p:
test:
.LFB2:
pushq %rbp
.LCFI0:
movq %rsp, %rbp
.LCFI1:
call mcount
movq %rdi, %rdx
movq %rdi, %rax
sarq $63, %rdx
idivq %rsi
leave
ret
cc1 -O2 -p
test:
.LFB2:
pushq %rbp
.LCFI0:
movq %rsp, %rbp
.LCFI1:
call mcount
leave <<<<
movq %rdi, %rdx
movq %rdi, %rax
sarq $63, %rdx
idivq %rsi
ret
Just a wild guess, could this depend on PR32450? Could you check if there is an
access to stack after leave insn?
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32450