public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/47835] New: FAIL: gcc.dg/pr46909.c scan-tree-dump ifcombine "optimizing two comparisons to x_[0-9]+\(D\) != 4"
@ 2011-02-21 14:33 danglin at gcc dot gnu.org
  2011-02-21 14:51 ` [Bug tree-optimization/47835] " danglin at gcc dot gnu.org
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: danglin at gcc dot gnu.org @ 2011-02-21 14:33 UTC (permalink / raw)
  To: gcc-bugs

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

           Summary: FAIL: gcc.dg/pr46909.c scan-tree-dump ifcombine
                    "optimizing two comparisons to x_[0-9]+\(D\) != 4"
           Product: gcc
           Version: 4.6.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: danglin@gcc.gnu.org
              Host: hppa1.1-hp-hpux10.20
            Target: hppa1.1-hp-hpux10.20
             Build: hppa1.1-hp-hpux10.20


Executing on host: /xxx/gnu/gcc/objdir/gcc/xgcc -B/xxx/gnu/gcc/objdir/gcc/
/xxx/gnu/gcc/gcc/gcc/testsuite/gcc.dg/pr46909.c   -O2 -fdump-tree-ifcombine -S 
-o pr46909.s    (timeout = 300)
PASS: gcc.dg/pr46909.c (test for excess errors)
FAIL: gcc.dg/pr46909.c scan-tree-dump ifcombine "optimizing two comparisons to
x_[0-9]+\(D\) != 4"

See `!= 6' in tree dump.


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

* [Bug tree-optimization/47835] FAIL: gcc.dg/pr46909.c scan-tree-dump ifcombine "optimizing two comparisons to x_[0-9]+\(D\) != 4"
  2011-02-21 14:33 [Bug tree-optimization/47835] New: FAIL: gcc.dg/pr46909.c scan-tree-dump ifcombine "optimizing two comparisons to x_[0-9]+\(D\) != 4" danglin at gcc dot gnu.org
@ 2011-02-21 14:51 ` danglin at gcc dot gnu.org
  2011-02-21 15:52 ` mikpe at it dot uu.se
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: danglin at gcc dot gnu.org @ 2011-02-21 14:51 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from John David Anglin <danglin at gcc dot gnu.org> 2011-02-21 14:37:14 UTC ---
Created attachment 23426
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=23426
Tree dump.


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

* [Bug tree-optimization/47835] FAIL: gcc.dg/pr46909.c scan-tree-dump ifcombine "optimizing two comparisons to x_[0-9]+\(D\) != 4"
  2011-02-21 14:33 [Bug tree-optimization/47835] New: FAIL: gcc.dg/pr46909.c scan-tree-dump ifcombine "optimizing two comparisons to x_[0-9]+\(D\) != 4" danglin at gcc dot gnu.org
  2011-02-21 14:51 ` [Bug tree-optimization/47835] " danglin at gcc dot gnu.org
@ 2011-02-21 15:52 ` mikpe at it dot uu.se
  2011-02-22 10:56 ` rguenth at gcc dot gnu.org
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: mikpe at it dot uu.se @ 2011-02-21 15:52 UTC (permalink / raw)
  To: gcc-bugs

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

Mikael Pettersson <mikpe at it dot uu.se> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |mikpe at it dot uu.se

--- Comment #2 from Mikael Pettersson <mikpe at it dot uu.se> 2011-02-21 15:14:06 UTC ---
I see the same pr46909 failure on powerpc64-linux too, with every weekly trunk
snapshot since 2010-12-18.


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

* [Bug tree-optimization/47835] FAIL: gcc.dg/pr46909.c scan-tree-dump ifcombine "optimizing two comparisons to x_[0-9]+\(D\) != 4"
  2011-02-21 14:33 [Bug tree-optimization/47835] New: FAIL: gcc.dg/pr46909.c scan-tree-dump ifcombine "optimizing two comparisons to x_[0-9]+\(D\) != 4" danglin at gcc dot gnu.org
  2011-02-21 14:51 ` [Bug tree-optimization/47835] " danglin at gcc dot gnu.org
  2011-02-21 15:52 ` mikpe at it dot uu.se
@ 2011-02-22 10:56 ` rguenth at gcc dot gnu.org
  2011-02-22 13:04 ` jakub at gcc dot gnu.org
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: rguenth at gcc dot gnu.org @ 2011-02-22 10:56 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |missed-optimization
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2011.02.22 10:47:01
                 CC|                            |jakub at gcc dot gnu.org
     Ever Confirmed|0                           |1

--- Comment #3 from Richard Guenther <rguenth at gcc dot gnu.org> 2011-02-22 10:47:01 UTC ---
I think the difference is because of different initial IL from gimplification
(BRANCH_COST).  On x86 we have

  D.2701 = x != 4;
  D.2702 = x != 6;
  D.2703 = D.2701 && D.2702;
  if (D.2703 != 0) goto <D.2699>; else goto <D.2704>;
  <D.2704>:
  D.2705 = x == 2;
  D.2706 = x == 6;
  D.2707 = D.2705 || D.2706;
  if (D.2707 != 0) goto <D.2699>; else goto <D.2700>;

this is really a missed optimization in ifcombine, possibly fixed by
later jump-threading for your target.  The result on x86 is

<bb 2>:
  D.2701_3 = x_2(D) != 4;
  D.2702_4 = x_2(D) != 6;
  D.2703_5 = D.2701_3 & D.2702_4;
  D.2705_6 = x_2(D) == 2;
  D.2706_7 = x_2(D) == 6;
  D.2707_8 = D.2705_6 | D.2706_7;
  if (x_2(D) != 4)
    goto <bb 4>;
  else
    goto <bb 3>;

<bb 3>:
Invalid sum of incoming frequencies 400, should be 244

<bb 4>:
Invalid sum of incoming frequencies 9844, should be 10000
  # D.2708_1 = PHI <1(2), -1(3)>
  return D.2708_1;


Consider XFAILing the test for your target(s).


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

* [Bug tree-optimization/47835] FAIL: gcc.dg/pr46909.c scan-tree-dump ifcombine "optimizing two comparisons to x_[0-9]+\(D\) != 4"
  2011-02-21 14:33 [Bug tree-optimization/47835] New: FAIL: gcc.dg/pr46909.c scan-tree-dump ifcombine "optimizing two comparisons to x_[0-9]+\(D\) != 4" danglin at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2011-02-22 10:56 ` rguenth at gcc dot gnu.org
@ 2011-02-22 13:04 ` jakub at gcc dot gnu.org
  2011-02-22 13:26 ` jakub at gcc dot gnu.org
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: jakub at gcc dot gnu.org @ 2011-02-22 13:04 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from Jakub Jelinek <jakub at gcc dot gnu.org> 2011-02-22 12:55:45 UTC ---
Created attachment 23434
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=23434
gcc46-pr47835.patch

I guess instead of XFAILing it is better just to check the end result, whether
tree passes optimized this into x != 4 test in the end or not.  And they
actually do (with the exception of x86_64/i686 and maybe other targets before
PR46909 fix).  For ppc ifcombine only optimizes x != 6 || x == 2 into
x != 6 (that's why it reports that it optimized two comparisons into x != 6),
the reason why it doesn't optimize further is that x == 6 check has two preds,
one is x != 4 && x != 6 and the other one is !(x != 4) (one edge has moved from
x == 2 check to x == 6 during vrp1).  dom manages to optimize it though.


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

* [Bug tree-optimization/47835] FAIL: gcc.dg/pr46909.c scan-tree-dump ifcombine "optimizing two comparisons to x_[0-9]+\(D\) != 4"
  2011-02-21 14:33 [Bug tree-optimization/47835] New: FAIL: gcc.dg/pr46909.c scan-tree-dump ifcombine "optimizing two comparisons to x_[0-9]+\(D\) != 4" danglin at gcc dot gnu.org
                   ` (3 preceding siblings ...)
  2011-02-22 13:04 ` jakub at gcc dot gnu.org
@ 2011-02-22 13:26 ` jakub at gcc dot gnu.org
  2011-02-22 13:47 ` jakub at gcc dot gnu.org
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: jakub at gcc dot gnu.org @ 2011-02-22 13:26 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from Jakub Jelinek <jakub at gcc dot gnu.org> 2011-02-22 12:56:54 UTC ---
I've tested this patch on x86_64, i686, ppc and ppc64 linux with PR46909
gimple-fold.c change reverted and with vanilla gimple-fold, with the fix
reverted expectedly x86_64 and i686 gcc.dg/pr46909.c test failed.


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

* [Bug tree-optimization/47835] FAIL: gcc.dg/pr46909.c scan-tree-dump ifcombine "optimizing two comparisons to x_[0-9]+\(D\) != 4"
  2011-02-21 14:33 [Bug tree-optimization/47835] New: FAIL: gcc.dg/pr46909.c scan-tree-dump ifcombine "optimizing two comparisons to x_[0-9]+\(D\) != 4" danglin at gcc dot gnu.org
                   ` (4 preceding siblings ...)
  2011-02-22 13:26 ` jakub at gcc dot gnu.org
@ 2011-02-22 13:47 ` jakub at gcc dot gnu.org
  2011-02-22 13:50 ` jakub at gcc dot gnu.org
  2011-03-01 11:49 ` ro at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: jakub at gcc dot gnu.org @ 2011-02-22 13:47 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #6 from Jakub Jelinek <jakub at gcc dot gnu.org> 2011-02-22 13:40:27 UTC ---
Author: jakub
Date: Tue Feb 22 13:40:24 2011
New Revision: 170399

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=170399
Log:
    PR tree-optimization/47835
    * gcc.dg/pr46909.c: Check optimized dump instead of ifcombine.

Modified:
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/testsuite/gcc.dg/pr46909.c


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

* [Bug tree-optimization/47835] FAIL: gcc.dg/pr46909.c scan-tree-dump ifcombine "optimizing two comparisons to x_[0-9]+\(D\) != 4"
  2011-02-21 14:33 [Bug tree-optimization/47835] New: FAIL: gcc.dg/pr46909.c scan-tree-dump ifcombine "optimizing two comparisons to x_[0-9]+\(D\) != 4" danglin at gcc dot gnu.org
                   ` (5 preceding siblings ...)
  2011-02-22 13:47 ` jakub at gcc dot gnu.org
@ 2011-02-22 13:50 ` jakub at gcc dot gnu.org
  2011-03-01 11:49 ` ro at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: jakub at gcc dot gnu.org @ 2011-02-22 13:50 UTC (permalink / raw)
  To: gcc-bugs

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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

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

--- Comment #7 from Jakub Jelinek <jakub at gcc dot gnu.org> 2011-02-22 13:41:53 UTC ---
Should be fixed now.


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

* [Bug tree-optimization/47835] FAIL: gcc.dg/pr46909.c scan-tree-dump ifcombine "optimizing two comparisons to x_[0-9]+\(D\) != 4"
  2011-02-21 14:33 [Bug tree-optimization/47835] New: FAIL: gcc.dg/pr46909.c scan-tree-dump ifcombine "optimizing two comparisons to x_[0-9]+\(D\) != 4" danglin at gcc dot gnu.org
                   ` (6 preceding siblings ...)
  2011-02-22 13:50 ` jakub at gcc dot gnu.org
@ 2011-03-01 11:49 ` ro at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: ro at gcc dot gnu.org @ 2011-03-01 11:49 UTC (permalink / raw)
  To: gcc-bugs

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

Rainer Orth <ro at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |ro at gcc dot gnu.org

--- Comment #8 from Rainer Orth <ro at gcc dot gnu.org> 2011-03-01 11:48:34 UTC ---
*** Bug 47404 has been marked as a duplicate of this bug. ***


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

end of thread, other threads:[~2011-03-01 11:49 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-02-21 14:33 [Bug tree-optimization/47835] New: FAIL: gcc.dg/pr46909.c scan-tree-dump ifcombine "optimizing two comparisons to x_[0-9]+\(D\) != 4" danglin at gcc dot gnu.org
2011-02-21 14:51 ` [Bug tree-optimization/47835] " danglin at gcc dot gnu.org
2011-02-21 15:52 ` mikpe at it dot uu.se
2011-02-22 10:56 ` rguenth at gcc dot gnu.org
2011-02-22 13:04 ` jakub at gcc dot gnu.org
2011-02-22 13:26 ` jakub at gcc dot gnu.org
2011-02-22 13:47 ` jakub at gcc dot gnu.org
2011-02-22 13:50 ` jakub at gcc dot gnu.org
2011-03-01 11:49 ` ro 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).