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



             Bug #: 55477

           Summary: [devirt] trunk fails inline-devirt tests #2 and and #3

                    whereas they pass in google/4_7

    Classification: Unclassified

           Product: gcc

           Version: 4.8.0

            Status: UNCONFIRMED

          Severity: normal

          Priority: P3

         Component: middle-end

        AssignedTo: unassig...@gcc.gnu.org

        ReportedBy: m...@use.net





Created attachment 28782

  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=28782

test case that fails in trunk but passes with google/gcc-4_7



When compiling Maxim's inline-devirt-2.C and inline-devirt-3.C test cases with

both current trunk (r193828) and google/gcc-4_7, the Google branch correctly

optimizes and trunk does not. Test cases are here:

http://gcc.gnu.org/ml/gcc-patches/2011-10/msg02589.html



My trunk configure line:

$ ../gcc-trunk/configure --program-suffix=-4.8 --prefix=/u/mhargett

--disable-bootstrap --enable-lto --with-fpmath=sse --disable-libmudflap

--disable-libssp --enable-gold=yes --with-mpc=/u/mhargett

--with-cloog=/u/mhargett/ --with-ppl=/u/mhargett/ --with-gmp=/u/mhargett/

--with-isl=/u/mhargett --with-mpfr=/u/mhargett/ --enable-cloog-backend=isl

--enable-languages=c,c++,lto



$ g++-4.8 -O2 inline-devirt-2.C



trunk objdump for the second testcase:

000000000400630 <main>:

  400630:       48 83 ec 28             sub    rsp,0x28

  400634:       48 89 e7                mov    rdi,rsp

  400637:       48 c7 04 24 b0 09 40    mov    QWORD PTR [rsp],0x4009b0

  40063e:       00 

  40063f:       48 c7 44 24 10 f0 09    mov    QWORD PTR [rsp+0x10],0x4009f0

  400646:       40 00 

  400648:       e8 23 01 00 00          call   400770 <_ZL5printR10Calculable>

  40064d:       48 8d 7c 24 10          lea    rdi,[rsp+0x10]

  400652:       e8 19 01 00 00          call   400770 <_ZL5printR10Calculable>

  400657:       31 c0                   xor    eax,eax

  400659:       48 83 c4 28             add    rsp,0x28

  40065d:       c3                      ret    

  40065e:       66 90                   xchg   ax,ax



and for google/gcc-4_7:

0000000000400630 <main>:

  400630:       48 83 ec 08             sub    rsp,0x8

  400634:       be 01 00 00 00          mov    esi,0x1

  400639:       bf c8 08 40 00          mov    edi,0x4008c8

  40063e:       31 c0                   xor    eax,eax

  400640:       e8 ab ff ff ff          call   4005f0 <printf@plt>

  400645:       be 02 00 00 00          mov    esi,0x2

  40064a:       bf c4 08 40 00          mov    edi,0x4008c4

  40064f:       31 c0                   xor    eax,eax

  400651:       e8 9a ff ff ff          call   4005f0 <printf@plt>

  400656:       be 02 00 00 00          mov    esi,0x2

  40065b:       bf c8 08 40 00          mov    edi,0x4008c8

  400660:       31 c0                   xor    eax,eax

  400662:       e8 89 ff ff ff          call   4005f0 <printf@plt>

  400667:       be 03 00 00 00          mov    esi,0x3

  40066c:       bf c4 08 40 00          mov    edi,0x4008c4

  400671:       31 c0                   xor    eax,eax

  400673:       e8 78 ff ff ff          call   4005f0 <printf@plt>

  400678:       31 c0                   xor    eax,eax

  40067a:       48 83 c4 08             add    rsp,0x8

  40067e:       c3                      ret    

  40067f:       90                      nop

Reply via email to