This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug target/32450] -pg seemingly causes miscompilation



------- 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]