public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug rtl-optimization/53180] New: Revision 186378 generates incorrect code for cpu2006 416.gamess
@ 2012-05-01 20:22 pthaugen at gcc dot gnu.org
  2012-05-02 11:55 ` [Bug rtl-optimization/53180] [4.8 Regression] " rguenth at gcc dot gnu.org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: pthaugen at gcc dot gnu.org @ 2012-05-01 20:22 UTC (permalink / raw)
  To: gcc-bugs

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

             Bug #: 53180
           Summary: Revision 186378 generates incorrect code for cpu2006
                    416.gamess
    Classification: Unclassified
           Product: gcc
           Version: 4.8.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: rtl-optimization
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: pthaugen@gcc.gnu.org
                CC: bergner@gcc.gnu.org, bernds@gcc.gnu.org
              Host: powerpc64-linux
            Target: powerpc64-linux
             Build: powerpc64-linux


Created attachment 27276
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=27276
testcase

416.gamess benchmark started failing with r186378 due to segfault when running
the benchmark. I've tracked down to what appears to be bad code for register
spilling. Subroutine with bad code is attatched, compile with "gfortran -O3
-m64 -mcpu=power7 -funroll-loops -ffast-math".

Snippets from the dump files for the insns of interest:

193r.ira

r186377:

(insn 6636 6631 6639 43 (set (reg:SI 2943 [ D.2378 ])
        (plus:SI (reg:SI 2944 [ MEM[base: D.4806_3018, index: ivtmp.1254_3009,
offset: 0B] ])
            (subreg/s:SI (reg/v:DI 454 [ nx+-4 ]) 4))) hsandt.f:200 78
{*addsi3_internal1}
     (expr_list:REG_DEAD (reg:SI 2944 [ MEM[base: D.4806_3018, index:
ivtmp.1254_3009, offset: 0B] ])
        (expr_list:REG_EQUIV (mem:SI (plus:DI (reg/f:DI 4113)
                    (reg:DI 2445 [ D.4808 ])) [3 MEM[base: D.4809_3021, index:
ivtmp.1232_213, offset: 0B]+0 S4 A32])
            (nil))))
...
(insn 6637 6632 6640 43 (set (mem:SI (plus:DI (reg/f:DI 4113)
                (reg:DI 2445 [ D.4808 ])) [3 MEM[base: D.4809_3021, index:
ivtmp.1232_213, offset: 0B]+0 S4 A32])
        (reg:SI 2943 [ D.2378 ])) hsandt.f:200 377 {*movsi_internal1}
     (expr_list:REG_DEAD (reg/f:DI 4113)
        (expr_list:REG_DEAD (reg:SI 2943 [ D.2378 ])
            (nil))))


r186378:

(insn 6636 6631 6639 43 (set (reg:SI 2943 [ D.2378 ])
        (plus:SI (reg:SI 2944 [ MEM[base: D.4806_3018, index: ivtmp.1254_3009,
offset: 0B] ])
            (subreg/s:SI (reg/v:DI 454 [ nx+-4 ]) 4))) hsandt.f:200 78
{*addsi3_internal1}
     (expr_list:REG_DEAD (reg:SI 2944 [ MEM[base: D.4806_3018, index:
ivtmp.1254_3009, offset: 0B] ])
        (nil)))
...
(insn 6637 6632 6640 43 (set (mem:SI (plus:DI (reg/f:DI 4113)
                (reg:DI 2445 [ D.4808 ])) [3 MEM[base: D.4809_3021, index:
ivtmp.1232_213, offset: 0B]+0 S4 A32])
        (reg:SI 2943 [ D.2378 ])) hsandt.f:200 377 {*movsi_internal1}
     (expr_list:REG_DEAD (reg/f:DI 4113)
        (expr_list:REG_DEAD (reg:SI 2943 [ D.2378 ])
            (nil))))

Note that insn 6636 no longer contains the REG_EQUIV note in r186378. Not sure
of the significance yet, but something I noticed.



194r.reload

r186377:

changing reg in insn 6636
changing reg in insn 6637
 Register 2943 now on stack.
...
(insn 6636 6631 8007 43 (set (reg:SI 18 18)
        (plus:SI (reg:SI 18 18 [orig:2944 MEM[base: D.4806_3018, index:
ivtmp.1254_3009, offset: 0B] ] [2944])
            (reg:SI 11 11 [orig:454 nx ] [454]))) hsandt.f:200 78
{*addsi3_internal1}
     (expr_list:REG_EQUIV (mem:SI (plus:DI (reg/f:DI 19 19 [4113])
                (reg:DI 6 6 [orig:2445 D.4808 ] [2445])) [3 MEM[base:
D.4809_3021, index: ivtmp.1232_213, offset: 0B]+0 S4 A32])
        (nil)))

(insn 8007 6636 6639 43 (set (mem/c:SI (plus:DI (reg/f:DI 19 19 [4113])
                (reg:DI 6 6 [orig:2445 D.4808 ] [2445])) [3 MEM[base:
D.4809_3021, index: ivtmp.1232_213, offset: 0B]+0 S4 A32])
        (reg:SI 18 18)) hsandt.f:200 377 {*movsi_internal1}
     (nil))


r186378:

changing reg in insn 6636
changing reg in insn 6637
      Assigning 2943(freq=2) slot 13 of 524 2290
 Register 2943 now on stack.
...
(insn 6636 6631 8052 43 (set (reg:SI 18 18)
        (plus:SI (reg:SI 18 18 [orig:2944 MEM[base: D.4806_3018, index:
ivtmp.1254_3009, offset: 0B] ] [2944])
            (reg:SI 11 11 [orig:454 nx ] [454]))) hsandt.f:200 78
{*addsi3_internal1}
     (nil))

(insn 8052 6636 6639 43 (set (mem/c:SI (plus:DI (reg/f:DI 1 1)
                (const_int 17664 [0x4500])) [32 %sfp+17664 S4 A64])
        (reg:SI 18 18)) hsandt.f:200 377 {*movsi_internal1}
     (nil))

In both cases insn 6637 is deleted, but as you can see above r186378 stores to
the stack, and that value is not subsequently copied into the original target
location of insn 6637.

I can provide more information/details if needed, just don't know what to throw
in that will be useful at the moment.

Configured with: /home/pthaugen/src/gcc/temp/gcc/configure
--prefix=/home/pthaugen/install/gcc/temp --target=powerpc64-linux
--host=powerpc64-linux --build=powerpc64-linux --enable-secureplt
--enable-threads=posix --enable-shared --enable-__cxa_atexit
--with-long-double-128 --enable-decimal-float --disable-alsa --enable-checking
--with-lto --with-as=/home/pthaugen/install/binutils/binutils-2.21.1/bin/as
--with-ld=/home/pthaugen/install/binutils/binutils-2.21.1/bin/ld
--with-gmp=/home/pthaugen/install/gcc-host-libs
--with-mpfr=/home/pthaugen/install/gcc-host-libs
--with-mpc=/home/pthaugen/install/gcc-host-libs
--with-ppl=/home/pthaugen/install/gcc-host-libs
--with-cloog=/home/pthaugen/install/gcc-host-libs
--with-host-libstdcxx=-Wl,-Bstatic,-L/home/pthaugen/install/gcc-host-libs/lib,-lstdc++,-Bdynamic,-lm
--enable-languages=c,fortran,c++ --disable-bootstrap


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug rtl-optimization/53180] [4.8 Regression] Revision 186378 generates incorrect code for cpu2006 416.gamess
  2012-05-01 20:22 [Bug rtl-optimization/53180] New: Revision 186378 generates incorrect code for cpu2006 416.gamess pthaugen at gcc dot gnu.org
@ 2012-05-02 11:55 ` rguenth at gcc dot gnu.org
  2012-05-08 10:46 ` bernds at gcc dot gnu.org
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: rguenth at gcc dot gnu.org @ 2012-05-02 11:55 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Guenther <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |4.8.0
            Summary|Revision 186378 generates   |[4.8 Regression] Revision
                   |incorrect code for cpu2006  |186378 generates incorrect
                   |416.gamess                  |code for cpu2006 416.gamess


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug rtl-optimization/53180] [4.8 Regression] Revision 186378 generates incorrect code for cpu2006 416.gamess
  2012-05-01 20:22 [Bug rtl-optimization/53180] New: Revision 186378 generates incorrect code for cpu2006 416.gamess pthaugen at gcc dot gnu.org
  2012-05-02 11:55 ` [Bug rtl-optimization/53180] [4.8 Regression] " rguenth at gcc dot gnu.org
@ 2012-05-08 10:46 ` bernds at gcc dot gnu.org
  2012-05-08 19:03 ` pthaugen at gcc dot gnu.org
  2012-05-16  1:44 ` bernds at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: bernds at gcc dot gnu.org @ 2012-05-08 10:46 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from Bernd Schmidt <bernds at gcc dot gnu.org> 2012-05-08 10:35:21 UTC ---
Created attachment 27344
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=27344
Candidate patch

I think I have a theory of what's going wrong. Can you test this patch?


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug rtl-optimization/53180] [4.8 Regression] Revision 186378 generates incorrect code for cpu2006 416.gamess
  2012-05-01 20:22 [Bug rtl-optimization/53180] New: Revision 186378 generates incorrect code for cpu2006 416.gamess pthaugen at gcc dot gnu.org
  2012-05-02 11:55 ` [Bug rtl-optimization/53180] [4.8 Regression] " rguenth at gcc dot gnu.org
  2012-05-08 10:46 ` bernds at gcc dot gnu.org
@ 2012-05-08 19:03 ` pthaugen at gcc dot gnu.org
  2012-05-16  1:44 ` bernds at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: pthaugen at gcc dot gnu.org @ 2012-05-08 19:03 UTC (permalink / raw)
  To: gcc-bugs

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

Pat Haugen <pthaugen at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|4.8.0                       |---

--- Comment #2 from Pat Haugen <pthaugen at gcc dot gnu.org> 2012-05-08 19:01:02 UTC ---
(In reply to comment #1)
> Created attachment 27344 [details]
> Candidate patch
> 
> I think I have a theory of what's going wrong. Can you test this patch?

Yes, that patch fixes the problem. It also fixes benchmark h264ref which also
started failing on the same revision.


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug rtl-optimization/53180] [4.8 Regression] Revision 186378 generates incorrect code for cpu2006 416.gamess
  2012-05-01 20:22 [Bug rtl-optimization/53180] New: Revision 186378 generates incorrect code for cpu2006 416.gamess pthaugen at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2012-05-08 19:03 ` pthaugen at gcc dot gnu.org
@ 2012-05-16  1:44 ` bernds at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: bernds at gcc dot gnu.org @ 2012-05-16  1:44 UTC (permalink / raw)
  To: gcc-bugs

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

Bernd Schmidt <bernds at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |FIXED

--- Comment #3 from Bernd Schmidt <bernds at gcc dot gnu.org> 2012-05-16 01:38:55 UTC ---
Fixed (r187495)


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2012-05-16  1:39 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-05-01 20:22 [Bug rtl-optimization/53180] New: Revision 186378 generates incorrect code for cpu2006 416.gamess pthaugen at gcc dot gnu.org
2012-05-02 11:55 ` [Bug rtl-optimization/53180] [4.8 Regression] " rguenth at gcc dot gnu.org
2012-05-08 10:46 ` bernds at gcc dot gnu.org
2012-05-08 19:03 ` pthaugen at gcc dot gnu.org
2012-05-16  1:44 ` bernds at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).