public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug rtl-optimization/57921] New: Alias change causes perl from SPEC 2006 to abort on MIPS
@ 2013-07-17 22:15 sje at gcc dot gnu.org
  2013-07-17 22:16 ` [Bug rtl-optimization/57921] " sje at gcc dot gnu.org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: sje at gcc dot gnu.org @ 2013-07-17 22:15 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 57921
           Summary: Alias change causes perl from SPEC 2006 to abort on
                    MIPS
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: rtl-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: sje at gcc dot gnu.org

Created attachment 30517
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=30517&action=edit
What the CSE phase generated prior to checkin r200133

With the latest GCC (as of version r200133) the perl benchmark in SPEC 2006 is
failing for me on the mips-linux-gnu target.  The patch that caused it to start
failing is to the alias analysis phase of GCC and it affects the rtl CSE phase
of GCC.  Before this change CSE was generating this RTL:

r234 = address of PL_curpad
r211 = mem[r234]
.
.
r215 = $2 (return pointer from a function)
r237 = mem[r211]
mem[r237+4] = r215
r220 = mem[r237]

The important bit is the last statement where r220 is loaded using the
address in r237.

After the change we have:

r234 = address of PL_curpad
r211 = mem[r234]
.
.
r215 = $2 (return pointer from a function)
r237 = mem[r211]
mem[r237+4] = r215
r238 = mem[r211]
r220 = mem[238]

Instead of reusing r237, we load r238 and use that to load r220.  I believe
that PL_curpad (address in r234) is set up to have the value of its own
address minus 4.  That would mean that when we store to 'mem[r237+4]' we
changed what r238 has vs. what r237 has.  Now this actually seems like it
is more correct then the first version, but the first version worked (I could
compile and run perl) and the second version does not (perl allocate aborts
and goes into an infinite loop).

I can see this change in x86 RTL but the change in code on x86 does not seem
to cause an outward change in the behaviour of perl.  I don't know if GCC
is doing something wrong or if the code in perl is wrong.  I have attached
a cutdown test case from Perl_pp_entersub (pp_hot.c) with this bug report.
The code cannot be run but if compiled it shows the RTL differences I describe
above.


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

end of thread, other threads:[~2013-07-27 20:56 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-07-17 22:15 [Bug rtl-optimization/57921] New: Alias change causes perl from SPEC 2006 to abort on MIPS sje at gcc dot gnu.org
2013-07-17 22:16 ` [Bug rtl-optimization/57921] " sje at gcc dot gnu.org
2013-07-17 22:17 ` sje at gcc dot gnu.org
2013-07-17 22:24 ` pinskia at gcc dot gnu.org
2013-07-17 22:50 ` sje at gcc dot gnu.org
2013-07-23 22:25 ` sje at gcc dot gnu.org
2013-07-27 20:56 ` dgilmore at mips dot com

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