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

* [Bug rtl-optimization/57921] Alias change causes perl from SPEC 2006 to abort on MIPS
  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 ` sje at gcc dot gnu.org
  2013-07-17 22:17 ` sje at gcc dot gnu.org
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: sje at gcc dot gnu.org @ 2013-07-17 22:16 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from Steve Ellcey <sje at gcc dot gnu.org> ---
Created attachment 30518
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=30518&action=edit
What the CSE phase generated after checkin r200133


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

* [Bug rtl-optimization/57921] Alias change causes perl from SPEC 2006 to abort on MIPS
  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
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: sje at gcc dot gnu.org @ 2013-07-17 22:17 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Steve Ellcey <sje at gcc dot gnu.org> ---
Created attachment 30519
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=30519&action=edit
Test case cut down from perl benchmark in SPEC 2006


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

* [Bug rtl-optimization/57921] Alias change causes perl from SPEC 2006 to abort on MIPS
  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
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu.org @ 2013-07-17 22:24 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |alias

--- Comment #3 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
This does look like an alias bug in the source code of perl?


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

* [Bug rtl-optimization/57921] Alias change causes perl from SPEC 2006 to abort on MIPS
  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
                   ` (2 preceding siblings ...)
  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
  5 siblings, 0 replies; 7+ messages in thread
From: sje at gcc dot gnu.org @ 2013-07-17 22:50 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from Steve Ellcey <sje at gcc dot gnu.org> ---
Digging around on the SPEC web page led me to this:

http://www.spec.org/cpu2006/Docs/400.perlbench.html

Known portability issues

There are some known aliasing issues. The internal data structures that
represent Perl's variables are accessed in such as a way as to violate ANSI
aliasing rules. Compilation with optimizations that rely on strict compliance
to ANSI C aliasing rules will most likely produce binaries that will not
validate.


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

* [Bug rtl-optimization/57921] Alias change causes perl from SPEC 2006 to abort on MIPS
  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
                   ` (3 preceding siblings ...)
  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
  5 siblings, 0 replies; 7+ messages in thread
From: sje at gcc dot gnu.org @ 2013-07-23 22:25 UTC (permalink / raw)
  To: gcc-bugs

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

Steve Ellcey <sje at gcc dot gnu.org> changed:

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

--- Comment #5 from Steve Ellcey <sje at gcc dot gnu.org> ---
Given the SPEC comments about perl not obeying aliasing rules and the fact that
I can compile this correctly with -fno-strict-aliasing I am going to close this
out as 'invalid'  I.e. it is not a GCC bug.


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

* [Bug rtl-optimization/57921] Alias change causes perl from SPEC 2006 to abort on MIPS
  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
                   ` (4 preceding siblings ...)
  2013-07-23 22:25 ` sje at gcc dot gnu.org
@ 2013-07-27 20:56 ` dgilmore at mips dot com
  5 siblings, 0 replies; 7+ messages in thread
From: dgilmore at mips dot com @ 2013-07-27 20:56 UTC (permalink / raw)
  To: gcc-bugs

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

Doug Gilmore <dgilmore at mips dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |dgilmore at mips dot com

--- Comment #6 from Doug Gilmore <dgilmore at mips dot com> ---
I wonder if this should be marked as a duplicate of bug 33383?


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