🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: gmane.comp.gcc.bugs
12 messages
12 total messages Started by "zsojka at sezna Wed, 15 Dec 2010 20:11
[Bug tree-optimization/46970] New: [4.3/4.4/4.5/4.6 Regression] wrong code with -Os -ftree-loop-linear
#303926
Author: "zsojka at sezna
Date: Wed, 15 Dec 2010 20:11
35 lines
793 bytes
http://gcc.gnu.org/bugzilla/show_bug.cgi?idF970

           Summary: [4.3/4.4/4.5/4.6 Regression] wrong code with -Os
                    -ftree-loop-linear
           Product: gcc
           Version: 4.6.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: zsojka@seznam.cz


Created attachment 22774
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id"774
reduced testcase (from gcc.dg/pr29581-3.c)

Output:
$ gcc -Os -ftree-loop-linear pr46970.c
or
$ gcc -O -fno-tree-ch -ftree-loop-linear pr46970.c
(-Os implies -fno-tree-ch)

$ ./a.out
Aborted

Tested versions:
r167809 - fail
4.5.1 - fail
4.4.5 - fail
4.3.5 - fail
4.2.4 - ICE
4.1.2 - ICE
4.0.4 - OK
[Bug tree-optimization/46970] [4.3/4.4/4.5/4.6 Regression] wrong code with -Os -ftree-loop-linear
#303962
Author: "hjl.tools at gm
Date: Thu, 16 Dec 2010 00:45
17 lines
669 bytes
http://gcc.gnu.org/bugzilla/show_bug.cgi?idF970

H.J. Lu <hjl.tools at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2010.12.16 00:45:57
                 CC|                            |spop at gcc dot gnu.org
     Ever Confirmed|0                           |1

--- Comment #1 from H.J. Lu <hjl.tools at gmail dot com> 2010-12-16 00:45:57 UTC ---
Revision 131435:

http://gcc.gnu.org/ml/gcc-cvs/2008-01/msg00195.html

fixed ICE and generated wrong code.
[Bug tree-optimization/46970] [4.3/4.4/4.5/4.6 Regression] wrong code with -Os -ftree-loop-linear
#303963
Author: "hjl.tools at gm
Date: Thu, 16 Dec 2010 00:49
4 lines
163 bytes
http://gcc.gnu.org/bugzilla/show_bug.cgi?idF970

--- Comment #2 from H.J. Lu <hjl.tools at gmail dot com> 2010-12-16 00:49:40 UTC ---
It is related to PR 34017.
[Bug tree-optimization/46970] [4.3/4.4/4.5/4.6 Regression] wrong code with -Os -ftree-loop-linear
#303964
Author: "hjl.tools at gm
Date: Thu, 16 Dec 2010 00:51
12 lines
466 bytes
http://gcc.gnu.org/bugzilla/show_bug.cgi?idF970

H.J. Lu <hjl.tools at gmail dot com> changed:

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

--- Comment #3 from H.J. Lu <hjl.tools at gmail dot com> 2010-12-16 00:51:24 UTC ---
Patch was posted at

http://gcc.gnu.org/ml/gcc-patches/2008-01/msg00371.html
[Bug tree-optimization/46970] [4.3/4.4/4.5/4.6 Regression] wrong code with -Os -ftree-loop-linear
#304093
Author: "rguenth at gcc
Date: Thu, 16 Dec 2010 14:55
7 lines
294 bytes
http://gcc.gnu.org/bugzilla/show_bug.cgi?idF970

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |4.3.6
[Bug tree-optimization/46970] [4.3/4.4/4.5/4.6 Regression] wrong code with -Os -ftree-loop-linear
#304236
Author: "jakub at gcc do
Date: Fri, 17 Dec 2010 16:17
40 lines
1586 bytes
http://gcc.gnu.org/bugzilla/show_bug.cgi?idF970

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

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

--- Comment #4 from Jakub Jelinek <jakub at gcc dot gnu.org> 2010-12-17 16:17:39 UTC ---
I think the bug is in that gcc_loop_to_lambda_loop doesn't record whether the
SSA_NAME compared in the exit condition was the induction var or incremented
induction var.
E.g. on ltrans-3.c testcase we have
<bb 5>:
  # j_25 = PHI <j_15(4), 0(9)>
...
  j_15 = j_25 + 1;
  if (N.2_3 > j_15)
    goto <bb 4>;
  else
    goto <bb 6>;
and thus the exit condition tests the incremented iv (gcc_loop_to_lambda_loop
btw. doesn't bother to check whether the def stmt of the rhs of exit condition
here actually increments by step, and doesn't bother to check that step fits
into int (so I guess step like 0x100000001ULL would cause trouble).
It just records lower bound 0, upper bound N.2_3 - 1 here and step 1.
But with -Os -ftree-loop-linear on this testcase we have before ltrans:
  j_12 = j_2 + 1;

<bb 4>:
  # j_2 = PHI <0(7), j_12(3)>
  if (j_2 < n_5(D))
    goto <bb 3>;
  else
    goto <bb 5>;
Here similarly it records lower bound 0, upper bound n_5 - 1 and step 1.
But there is an important difference in between the two.
In the former case we correctly use
  gimple_cond_set_condition (exitcond, testtype, newupperbound, ivvarinced);
but we use it in the second case too, which is wrong.
[Bug tree-optimization/46970] [4.3/4.4/4.5/4.6 Regression] wrong code with -Os -ftree-loop-linear
#304244
Author: "jakub at gcc do
Date: Fri, 17 Dec 2010 17:14
13 lines
569 bytes
http://gcc.gnu.org/bugzilla/show_bug.cgi?idF970

--- Comment #5 from Jakub Jelinek <jakub at gcc dot gnu.org> 2010-12-17 17:14:01 UTC ---
Created attachment 22801
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id"801
gcc46-pr46970.patch

Untested patch that fixes this and keeps ltrans-3.c working.

I don't feel very good about the +-1 * stepint extra adjustments the code did
and still does though, I'm afraid there could be problems with that if there is
an overflow, but it would be much more work to adjust lambda-code.c so that it
deals with this properly.
[Bug tree-optimization/46970] [4.3/4.4/4.5/4.6 Regression] wrong code with -Os -ftree-loop-linear
#305355
Author: "rguenth at gcc
Date: Mon, 03 Jan 2011 21:01
7 lines
291 bytes
http://gcc.gnu.org/bugzilla/show_bug.cgi?idF970

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P2
[Bug tree-optimization/46970] [4.3/4.4/4.5/4.6 Regression] wrong code with -Os -ftree-loop-linear
#307001
Author: "spop at gcc dot
Date: Tue, 18 Jan 2011 20:56
20 lines
544 bytes
http://gcc.gnu.org/bugzilla/show_bug.cgi?idF970

--- Comment #6 from Sebastian Pop <spop at gcc dot gnu.org> 2011-01-18 20:54:55 UTC ---
Author: spop
Date: Tue Jan 18 20:54:52 2011
New Revision: 168967

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev8967
Log:
Add testcase for PR46970.

2011-01-18  Sebastian Pop  <sebastian.pop@amd.com>

    PR tree-optimization/46970
    * gcc.dg/graphite/pr46970.c: New.

Added:
    branches/graphite/gcc/testsuite/gcc.dg/graphite/pr46970.c
Modified:
    branches/graphite/gcc/ChangeLog.graphite
[Bug tree-optimization/46970] [4.3/4.4/4.5/4.6 Regression] wrong code with -Os -ftree-loop-linear
#307003
Author: "spop at gcc dot
Date: Tue, 18 Jan 2011 20:57
12 lines
533 bytes
http://gcc.gnu.org/bugzilla/show_bug.cgi?idF970

Sebastian Pop <spop at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
         AssignedTo|unassigned at gcc dot       |spop at gcc dot gnu.org
                   |gnu.org                     |

--- Comment #7 from Sebastian Pop <spop at gcc dot gnu.org> 2011-01-18 20:56:30 UTC ---
Fixed on the graphite branch.
[Bug tree-optimization/46970] [4.3/4.4/4.5/4.6 Regression] wrong code with -Os -ftree-loop-linear
#307884
Author: "spop at gcc dot
Date: Tue, 25 Jan 2011 21:26
20 lines
521 bytes
http://gcc.gnu.org/bugzilla/show_bug.cgi?idF970

--- Comment #8 from Sebastian Pop <spop at gcc dot gnu.org> 2011-01-25 21:25:35 UTC ---
Author: spop
Date: Tue Jan 25 21:25:24 2011
New Revision: 169257

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev9257
Log:
Add testcase for PR46970.

2011-01-18  Sebastian Pop  <sebastian.pop@amd.com>

    PR tree-optimization/46970
    * gcc.dg/graphite/pr46970.c: New.

Added:
    trunk/gcc/testsuite/gcc.dg/graphite/pr46970.c
Modified:
    trunk/gcc/testsuite/ChangeLog
[Bug tree-optimization/46970] [4.3/4.4/4.5/4.6 Regression] wrong code with -Os -ftree-loop-linear
#307895
Author: "spop at gcc dot
Date: Tue, 25 Jan 2011 21:30
11 lines
442 bytes
http://gcc.gnu.org/bugzilla/show_bug.cgi?idF970

Sebastian Pop <spop at gcc dot gnu.org> changed:

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

--- Comment #9 from Sebastian Pop <spop at gcc dot gnu.org> 2011-01-25 21:28:37 UTC ---
Fixed.
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads