[Bug target/29122] ICE with -ipa-cp and -m64 (tail calls)

pinskia at gcc dot gnu dot org gcc-bugzilla@gcc.gnu.org
Tue Sep 19 03:12:00 GMT 2006



------- Comment #2 from pinskia at gcc dot gnu dot org  2006-09-19 03:12 -------
Here is a reduced testcase:
int
bar (int b, int c)
{
  return 0;
}
int
main ()
{
  bar (8, 4);
  return bar (7, 4);
}

-----
This is due to tail calls.
> The call instruction is corrupted.
No, it is not, it is correct.  Just the function looks like it is not set to be
right.  Anyways I think the Function decl is messed up to begin with.
With -O1, we get an indirect function call which is just wrong.
.main:
        mflr 0
        std 0,16(1)
        stdu 1,-112(1)
        li 3,7
        li 4,4
        ld 9,.LC0@toc(2)
        ld 0,0(9)
        mtctr 0
        std 2,40(1)
        ld 2,8(9)
        ld 11,16(9)
        bctrl
        ld 2,40(1)
        addi 1,1,112
        ld 0,16(1)
        mtlr 0
        blr
.LC0:
        .tc T.0[TC],T.0
        .section        ".text"


I might bet this might have an issue on ppc-aix also even not in 64bit mode
because that is a TOC based ABI also.


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |pinskia at gcc dot gnu dot
                   |                            |org
             Status|UNCONFIRMED                 |NEW
          Component|tree-optimization           |target
     Ever Confirmed|0                           |1
 GCC target triplet|                            |powerpc64-linux
   Last reconfirmed|0000-00-00 00:00:00         |2006-09-19 03:12:51
               date|                            |
            Summary|ICE with -ipa-cp and -m64   |ICE with -ipa-cp and -m64
                   |                            |(tail calls)


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29122



More information about the Gcc-bugs mailing list