https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70427

--- Comment #1 from Andi Kleen <andi-gcc at firstfloor dot org> ---
Created attachment 38109
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=38109&action=edit
ipa-profile input

Here's the source of the miscompiled file from the compiler

cc1plus -O2 ipa-profile.i  -S

unfortunately have to inspect assembler to see the miscompilation:

look for ipa_generate_profile_summary

then look for get_edge

        call    _ZN11cgraph_node8get_edgeEP6gimple
        testq   %rax, %rax        
        movq    %rax, %r15             
        je      .L836                <-------- jump if rax/r15 is 0
        testb   $2, 96(%rax)
        je      .L837
.L836:                               <------- it can be here
        movq    16(%r12), %rax
        movq    64(%r15), %rsi         <---------- BAD

same miscompilation here (just with another register). r15 is referenced after
being tested for NULL.

Reply via email to