public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/61783] New: [4.10 regression] FAIL: gcc.dg/tree-ssa/20030922-2.c scan-tree-dump-times dom1 "if " 2
@ 2014-07-11 18:30 schwab@linux-m68k.org
  2014-07-14 10:38 ` [Bug tree-optimization/61783] " rguenth at gcc dot gnu.org
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: schwab@linux-m68k.org @ 2014-07-11 18:30 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61783

            Bug ID: 61783
           Summary: [4.10 regression] FAIL: gcc.dg/tree-ssa/20030922-2.c
                    scan-tree-dump-times dom1 "if " 2
           Product: gcc
           Version: 4.10.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: schwab@linux-m68k.org
                CC: rguenther at suse dot de
            Target: m68k-*-*

>From <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61757#17>:

--- Comment #17 from Michael Matz <matz at gcc dot gnu.org> ---
The testsuite failure on m68k is indeed caused by r212352.  In particular
this hunk:

@@ -1641,8 +1609,7 @@ record_equality (tree x, tree y)
      long as we canonicalize on one value.  */
   if (is_gimple_min_invariant (y))
     ;
-  else if (is_gimple_min_invariant (x)
-          || (loop_depth_of_name (x) <= loop_depth_of_name (y)))
+  else if (is_gimple_min_invariant (x))
     prev_x = x, x = y, y = prev_x, prev_x = prev_y;
   else if (prev_x && is_gimple_min_invariant (prev_x))
     x = y, y = prev_x, prev_x = prev_y;

The test is <=, so without loops (both SSA names being at 'depth' 0) the check
succeeds always and hence will canonicalize on x (i.e. record x as value of y).
The testcase is written so that this is the expected order for the third
if to be found trivial.

The problem doesn't happen on x86-64 because with -O1 the && condition is
rewritten into arithmetic on '&', so even though the wanted transformation
doesn't happen there are only two 'if ' statements, which is what is searched
for.

Unfortunately this is all harmless and not causing the miscompilations, it's
only a missed optimization.

FWIW, I think the canonicalization that DOM wants here should be retained
in some form (canonicalize to the value that covers a larger area).  Possibly
by checking if one definition dominates the other


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

* [Bug tree-optimization/61783] [4.10 regression] FAIL: gcc.dg/tree-ssa/20030922-2.c scan-tree-dump-times dom1 "if " 2
  2014-07-11 18:30 [Bug tree-optimization/61783] New: [4.10 regression] FAIL: gcc.dg/tree-ssa/20030922-2.c scan-tree-dump-times dom1 "if " 2 schwab@linux-m68k.org
@ 2014-07-14 10:38 ` rguenth at gcc dot gnu.org
  2014-07-14 10:51 ` rguenth at gcc dot gnu.org
  2014-07-14 10:52 ` rguenth at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: rguenth at gcc dot gnu.org @ 2014-07-14 10:38 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61783

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |ASSIGNED
   Last reconfirmed|                            |2014-07-14
           Assignee|unassigned at gcc dot gnu.org      |rguenth at gcc dot gnu.org
   Target Milestone|---                         |4.10.0
     Ever confirmed|0                           |1

--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> ---
Mine.


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

* [Bug tree-optimization/61783] [4.10 regression] FAIL: gcc.dg/tree-ssa/20030922-2.c scan-tree-dump-times dom1 "if " 2
  2014-07-11 18:30 [Bug tree-optimization/61783] New: [4.10 regression] FAIL: gcc.dg/tree-ssa/20030922-2.c scan-tree-dump-times dom1 "if " 2 schwab@linux-m68k.org
  2014-07-14 10:38 ` [Bug tree-optimization/61783] " rguenth at gcc dot gnu.org
@ 2014-07-14 10:51 ` rguenth at gcc dot gnu.org
  2014-07-14 10:52 ` rguenth at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: rguenth at gcc dot gnu.org @ 2014-07-14 10:51 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61783

--- Comment #2 from Richard Biener <rguenth at gcc dot gnu.org> ---
Author: rguenth
Date: Mon Jul 14 10:50:46 2014
New Revision: 212513

URL: https://gcc.gnu.org/viewcvs?rev=212513&root=gcc&view=rev
Log:
2014-07-14  Richard Biener  <rguenther@suse.de>

    PR tree-optimization/61757
    PR tree-optimization/61783
    PR tree-optimization/61787
    * tree-ssa-dom.c (record_equality): Revert canonicalization
    change and add comment.
    (propagate_rhs_into_lhs): Revert previous fix, removing
    loop depth restriction again.

    * gcc.dg/torture/pr61757.c: New testcase.
    * gcc.dg/torture/pr61787.c: Likewise.

Added:
    trunk/gcc/testsuite/gcc.dg/torture/pr61757.c
    trunk/gcc/testsuite/gcc.dg/torture/pr61787.c
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/tree-ssa-dom.c


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

* [Bug tree-optimization/61783] [4.10 regression] FAIL: gcc.dg/tree-ssa/20030922-2.c scan-tree-dump-times dom1 "if " 2
  2014-07-11 18:30 [Bug tree-optimization/61783] New: [4.10 regression] FAIL: gcc.dg/tree-ssa/20030922-2.c scan-tree-dump-times dom1 "if " 2 schwab@linux-m68k.org
  2014-07-14 10:38 ` [Bug tree-optimization/61783] " rguenth at gcc dot gnu.org
  2014-07-14 10:51 ` rguenth at gcc dot gnu.org
@ 2014-07-14 10:52 ` rguenth at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: rguenth at gcc dot gnu.org @ 2014-07-14 10:52 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61783

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

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

--- Comment #3 from Richard Biener <rguenth at gcc dot gnu.org> ---
Should be fixed now.


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

end of thread, other threads:[~2014-07-14 10:52 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-07-11 18:30 [Bug tree-optimization/61783] New: [4.10 regression] FAIL: gcc.dg/tree-ssa/20030922-2.c scan-tree-dump-times dom1 "if " 2 schwab@linux-m68k.org
2014-07-14 10:38 ` [Bug tree-optimization/61783] " rguenth at gcc dot gnu.org
2014-07-14 10:51 ` rguenth at gcc dot gnu.org
2014-07-14 10:52 ` rguenth 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).