public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/42508]  New: wrong code with "-O1 -fipa-sra"
@ 2009-12-26 11:18 zsojka at seznam dot cz
  2009-12-26 11:20 ` [Bug tree-optimization/42508] " zsojka at seznam dot cz
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: zsojka at seznam dot cz @ 2009-12-26 11:18 UTC (permalink / raw)
  To: gcc-bugs

+++ This bug was initially created as a clone of Bug #42290 +++

Command line:
g++ -O1 -fipa-sra testcase.cpp && ./a.out
(-Wall shows valid (but misleading?) warnings as described in bug 42290)

Tested versions:
r155434 - broken
r154886 - broken
r154830 - OK
r153685 - OK

Output:
g++ -O1 -fipa-sra testcase.cpp && ./a.out
2
-1419800576

Expected output:
g++ -O1 -fipa-sra testcase.cpp && ./a.out
2
1


-- 
           Summary: wrong code with "-O1 -fipa-sra"
           Product: gcc
           Version: 4.5.0
            Status: UNCONFIRMED
          Severity: major
          Priority: P3
         Component: tree-optimization
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: zsojka at seznam dot cz
  GCC host triplet: x86_64-pc-linux-gnu


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


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

* [Bug tree-optimization/42508] wrong code with "-O1 -fipa-sra"
  2009-12-26 11:18 [Bug tree-optimization/42508] New: wrong code with "-O1 -fipa-sra" zsojka at seznam dot cz
@ 2009-12-26 11:20 ` zsojka at seznam dot cz
  2009-12-26 21:04 ` hjl dot tools at gmail dot com
                   ` (8 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: zsojka at seznam dot cz @ 2009-12-26 11:20 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from zsojka at seznam dot cz  2009-12-26 11:20 -------
Created an attachment (id=19394)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=19394&action=view)
testcase

Command line:
g++ -O1 -fipa-sra pr42508.cpp && ./a.out


-- 


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


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

* [Bug tree-optimization/42508] wrong code with "-O1 -fipa-sra"
  2009-12-26 11:18 [Bug tree-optimization/42508] New: wrong code with "-O1 -fipa-sra" zsojka at seznam dot cz
  2009-12-26 11:20 ` [Bug tree-optimization/42508] " zsojka at seznam dot cz
@ 2009-12-26 21:04 ` hjl dot tools at gmail dot com
  2009-12-30 17:33 ` steven at gcc dot gnu dot org
                   ` (7 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: hjl dot tools at gmail dot com @ 2009-12-26 21:04 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from hjl dot tools at gmail dot com  2009-12-26 21:04 -------
It is caused by revision 154880:

http://gcc.gnu.org/ml/gcc-cvs/2009-12/msg00024.html


-- 

hjl dot tools at gmail dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jakub at redhat dot com


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


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

* [Bug tree-optimization/42508] wrong code with "-O1 -fipa-sra"
  2009-12-26 11:18 [Bug tree-optimization/42508] New: wrong code with "-O1 -fipa-sra" zsojka at seznam dot cz
  2009-12-26 11:20 ` [Bug tree-optimization/42508] " zsojka at seznam dot cz
  2009-12-26 21:04 ` hjl dot tools at gmail dot com
@ 2009-12-30 17:33 ` steven at gcc dot gnu dot org
  2009-12-30 22:59 ` [Bug tree-optimization/42508] [4.5 Regression] " rguenth at gcc dot gnu dot org
                   ` (6 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: steven at gcc dot gnu dot org @ 2009-12-30 17:33 UTC (permalink / raw)
  To: gcc-bugs



-- 

steven at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
   Last reconfirmed|0000-00-00 00:00:00         |2009-12-30 17:33:02
               date|                            |


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


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

* [Bug tree-optimization/42508] [4.5 Regression] wrong code with "-O1 -fipa-sra"
  2009-12-26 11:18 [Bug tree-optimization/42508] New: wrong code with "-O1 -fipa-sra" zsojka at seznam dot cz
                   ` (2 preceding siblings ...)
  2009-12-30 17:33 ` steven at gcc dot gnu dot org
@ 2009-12-30 22:59 ` rguenth at gcc dot gnu dot org
  2010-01-02 16:14 ` rguenth at gcc dot gnu dot org
                   ` (5 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2009-12-30 22:59 UTC (permalink / raw)
  To: gcc-bugs



-- 

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jamborm at gcc dot gnu dot
                   |                            |org
           Keywords|                            |wrong-code
            Summary|wrong code with "-O1 -fipa- |[4.5 Regression] wrong code
                   |sra"                        |with "-O1 -fipa-sra"
   Target Milestone|---                         |4.5.0


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


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

* [Bug tree-optimization/42508] [4.5 Regression] wrong code with "-O1 -fipa-sra"
  2009-12-26 11:18 [Bug tree-optimization/42508] New: wrong code with "-O1 -fipa-sra" zsojka at seznam dot cz
                   ` (3 preceding siblings ...)
  2009-12-30 22:59 ` [Bug tree-optimization/42508] [4.5 Regression] " rguenth at gcc dot gnu dot org
@ 2010-01-02 16:14 ` rguenth at gcc dot gnu dot org
  2010-01-04 14:13 ` jakub at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2010-01-02 16:14 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from rguenth at gcc dot gnu dot org  2010-01-02 16:13 -------
Confirmed.  Doesn't happen on i?86-linux or with -m32.


-- 

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P1


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


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

* [Bug tree-optimization/42508] [4.5 Regression] wrong code with "-O1 -fipa-sra"
  2009-12-26 11:18 [Bug tree-optimization/42508] New: wrong code with "-O1 -fipa-sra" zsojka at seznam dot cz
                   ` (4 preceding siblings ...)
  2010-01-02 16:14 ` rguenth at gcc dot gnu dot org
@ 2010-01-04 14:13 ` jakub at gcc dot gnu dot org
  2010-01-04 14:16 ` jakub at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: jakub at gcc dot gnu dot org @ 2010-01-04 14:13 UTC (permalink / raw)
  To: gcc-bugs



-- 

jakub at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |hubicka at gcc dot gnu dot
                   |                            |org
         AssignedTo|unassigned at gcc dot gnu   |jakub at gcc dot gnu dot org
                   |dot org                     |
             Status|NEW                         |ASSIGNED
   Last reconfirmed|2009-12-30 17:33:02         |2010-01-04 14:13:18
               date|                            |


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


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

* [Bug tree-optimization/42508] [4.5 Regression] wrong code with "-O1 -fipa-sra"
  2009-12-26 11:18 [Bug tree-optimization/42508] New: wrong code with "-O1 -fipa-sra" zsojka at seznam dot cz
                   ` (5 preceding siblings ...)
  2010-01-04 14:13 ` jakub at gcc dot gnu dot org
@ 2010-01-04 14:16 ` jakub at gcc dot gnu dot org
  2010-01-05  8:41 ` jakub at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: jakub at gcc dot gnu dot org @ 2010-01-04 14:16 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from jakub at gcc dot gnu dot org  2010-01-04 14:15 -------
Created an attachment (id=19460)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=19460&action=view)
gcc45-pr42508.patch

Fix, so far not bootstrapped/regtested.  The cgraphunit.c hunk is only somewhat
related, is not necessary to fix this, I've just noticed that the function was
still modifying GIMPLE_CALL decl unnecessarily (and confusingly), when
e->callee is an inline clone of some cgraph node with same_body aliases and
GIMPLE_CALL calls the same_body alias.


-- 


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


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

* [Bug tree-optimization/42508] [4.5 Regression] wrong code with "-O1 -fipa-sra"
  2009-12-26 11:18 [Bug tree-optimization/42508] New: wrong code with "-O1 -fipa-sra" zsojka at seznam dot cz
                   ` (6 preceding siblings ...)
  2010-01-04 14:16 ` jakub at gcc dot gnu dot org
@ 2010-01-05  8:41 ` jakub at gcc dot gnu dot org
  2010-01-05  8:58 ` jakub at gcc dot gnu dot org
  2010-01-07 22:24 ` hjl at gcc dot gnu dot org
  9 siblings, 0 replies; 11+ messages in thread
From: jakub at gcc dot gnu dot org @ 2010-01-05  8:41 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from jakub at gcc dot gnu dot org  2010-01-05 08:41 -------
Subject: Bug 42508

Author: jakub
Date: Tue Jan  5 08:40:50 2010
New Revision: 155640

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=155640
Log:
        PR tree-optimization/42508
        * tree-sra.c (convert_callers): Check for recursive call
        by comparing cgraph nodes instead of decls.
        (modify_function): Call ipa_modify_formal_parameters also
        on all same_body aliases.

        * g++.dg/opt/pr42508.C: New test.

        * cgraphunit.c (cgraph_materialize_all_clones): Compare
        cgraph nodes when checking for same_body aliases.

Added:
    trunk/gcc/testsuite/g++.dg/opt/pr42508.C
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/cgraphunit.c
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/tree-sra.c


-- 


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


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

* [Bug tree-optimization/42508] [4.5 Regression] wrong code with "-O1 -fipa-sra"
  2009-12-26 11:18 [Bug tree-optimization/42508] New: wrong code with "-O1 -fipa-sra" zsojka at seznam dot cz
                   ` (7 preceding siblings ...)
  2010-01-05  8:41 ` jakub at gcc dot gnu dot org
@ 2010-01-05  8:58 ` jakub at gcc dot gnu dot org
  2010-01-07 22:24 ` hjl at gcc dot gnu dot org
  9 siblings, 0 replies; 11+ messages in thread
From: jakub at gcc dot gnu dot org @ 2010-01-05  8:58 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from jakub at gcc dot gnu dot org  2010-01-05 08:58 -------
Fixed.


-- 

jakub at gcc dot gnu dot org changed:

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


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


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

* [Bug tree-optimization/42508] [4.5 Regression] wrong code with "-O1 -fipa-sra"
  2009-12-26 11:18 [Bug tree-optimization/42508] New: wrong code with "-O1 -fipa-sra" zsojka at seznam dot cz
                   ` (8 preceding siblings ...)
  2010-01-05  8:58 ` jakub at gcc dot gnu dot org
@ 2010-01-07 22:24 ` hjl at gcc dot gnu dot org
  9 siblings, 0 replies; 11+ messages in thread
From: hjl at gcc dot gnu dot org @ 2010-01-07 22:24 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #7 from hjl at gcc dot gnu dot org  2010-01-07 22:23 -------
Subject: Bug 42508

Author: hjl
Date: Thu Jan  7 22:22:32 2010
New Revision: 155713

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=155713
Log:
Backport tests from mainline

2010-01-07  H.J. Lu  <hongjiu.lu@intel.com>

        Backport from mainline:
        2010-01-06  Richard Guenther  <rguenther@suse.de>

        * gcc.c-torture/compile/pr42632.c: New testcase.

        2010-01-05  Martin Jambor  <mjambor@suse.cz>

        PR tree-optimization/42462
        * g++.dg/torture/pr42462.C: New test.

        2010-01-05  Jakub Jelinek  <jakub@redhat.com>

        PR tree-optimization/42508
        * g++.dg/opt/pr42508.C: New test.

        2010-01-04  Martin Jambor  <mjambor@suse.cz>

        PR tree-optimization/42398
        * gcc.c-torture/compile/pr42398.c: New test.

        2010-01-04  Jason Merrill  <jason@redhat.com>

        PR c++/42555
        * g++.dg/ext/attrib35.C: New.

        2010-01-01  Richard Guenther  <rguenther@suse.de>

        PR c/42570
        * gcc.c-torture/execute/pr42570.c: New testcase.

        2010-01-01  Richard Guenther  <rguenther@suse.de>

        PR middle-end/42559
        * gcc.c-torture/compile/pr42559.c: New testcase.

        2009-12-30  Joseph Myers  <joseph@codesourcery.com>

        PR c/42439
        * gcc.dg/bitfld-19.c: New test.

        2009-12-28  Jason Merrill  <jason@redhat.com>

        PR c++/42447
        * g++.dg/template/array21.C: New.

Added:
    branches/gcc-4_4-branch/gcc/testsuite/g++.dg/ext/attrib35.C
      - copied unchanged from r155711,
trunk/gcc/testsuite/g++.dg/ext/attrib35.C
    branches/gcc-4_4-branch/gcc/testsuite/g++.dg/opt/pr42508.C
      - copied unchanged from r155711, trunk/gcc/testsuite/g++.dg/opt/pr42508.C
    branches/gcc-4_4-branch/gcc/testsuite/g++.dg/template/array21.C
      - copied unchanged from r155710,
trunk/gcc/testsuite/g++.dg/template/array21.C
    branches/gcc-4_4-branch/gcc/testsuite/g++.dg/torture/pr42462.C
      - copied unchanged from r155711,
trunk/gcc/testsuite/g++.dg/torture/pr42462.C
    branches/gcc-4_4-branch/gcc/testsuite/gcc.c-torture/compile/pr42398.c
      - copied unchanged from r155711,
trunk/gcc/testsuite/gcc.c-torture/compile/pr42398.c
    branches/gcc-4_4-branch/gcc/testsuite/gcc.c-torture/compile/pr42559.c
      - copied unchanged from r155712,
trunk/gcc/testsuite/gcc.c-torture/compile/pr42559.c
    branches/gcc-4_4-branch/gcc/testsuite/gcc.c-torture/compile/pr42632.c
      - copied unchanged from r155710,
trunk/gcc/testsuite/gcc.c-torture/compile/pr42632.c
    branches/gcc-4_4-branch/gcc/testsuite/gcc.c-torture/execute/pr42570.c
      - copied unchanged from r155712,
trunk/gcc/testsuite/gcc.c-torture/execute/pr42570.c
    branches/gcc-4_4-branch/gcc/testsuite/gcc.dg/bitfld-19.c
      - copied unchanged from r155710, trunk/gcc/testsuite/gcc.dg/bitfld-19.c
Modified:
    branches/gcc-4_4-branch/gcc/testsuite/ChangeLog


-- 


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


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

end of thread, other threads:[~2010-01-07 22:24 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-12-26 11:18 [Bug tree-optimization/42508] New: wrong code with "-O1 -fipa-sra" zsojka at seznam dot cz
2009-12-26 11:20 ` [Bug tree-optimization/42508] " zsojka at seznam dot cz
2009-12-26 21:04 ` hjl dot tools at gmail dot com
2009-12-30 17:33 ` steven at gcc dot gnu dot org
2009-12-30 22:59 ` [Bug tree-optimization/42508] [4.5 Regression] " rguenth at gcc dot gnu dot org
2010-01-02 16:14 ` rguenth at gcc dot gnu dot org
2010-01-04 14:13 ` jakub at gcc dot gnu dot org
2010-01-04 14:16 ` jakub at gcc dot gnu dot org
2010-01-05  8:41 ` jakub at gcc dot gnu dot org
2010-01-05  8:58 ` jakub at gcc dot gnu dot org
2010-01-07 22:24 ` hjl at gcc dot gnu dot 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).