public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/34017]  New: ICE in lambda_loopnest_to_gcc_loopnest with -O2 -ftree-loop-linear
@ 2007-11-07 17:54 janis at gcc dot gnu dot org
  2007-11-08  1:57 ` [Bug tree-optimization/34017] " spop at gcc dot gnu dot org
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: janis at gcc dot gnu dot org @ 2007-11-07 17:54 UTC (permalink / raw)
  To: gcc-bugs

Test 445.gobmk in SPEC CPU2006 fails to build on powerpc64-linux with "-m64 -O2
-ftree-loop-linear" due to an ICE in lambda_loopnest_to_gcc_loopnest, at
lambda-code.c:1840.  This test case demonstrates the problem:

extern int size;
struct data2 { };
struct data1 { int origin; };
static void
print (struct data1 *d1, struct data2 *d2)
{
  int m, n;
  int mini, maxi;
  int minj, maxj;
  int origin = d1[0].origin;
  minj = size;
  for (m = 0; m < size; m++)
    for (n = 0; n < size; n++)
      {
        if (d1[21 + m * 20 + n].origin != origin)
          continue;
        if (m > maxi)
          maxi = m;
        if (n < minj)
          minj = n;
      }
  for (m = mini; m <= maxi; m++)
    {
      for (n = minj; n <= maxj; n++)
        {
        }
    }
}
void
compute (struct data1 *d1, struct data2 d2[400])
{
  print (d1, d2);
}

The failure begins with:

    http://gcc.gnu.org/viewcvs?view=rev&rev=114205
    r114205 | spop | 2006-05-29 16:01:16 +0000 (Mon, 29 May 2006)


-- 
           Summary: ICE in lambda_loopnest_to_gcc_loopnest with -O2 -ftree-
                    loop-linear
           Product: gcc
           Version: 4.3.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: janis at gcc dot gnu dot org
GCC target triplet: powerpc64-unknown-linux-gnu


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


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

* [Bug tree-optimization/34017] ICE in lambda_loopnest_to_gcc_loopnest with -O2 -ftree-loop-linear
  2007-11-07 17:54 [Bug tree-optimization/34017] New: ICE in lambda_loopnest_to_gcc_loopnest with -O2 -ftree-loop-linear janis at gcc dot gnu dot org
@ 2007-11-08  1:57 ` spop at gcc dot gnu dot org
  2007-11-19  4:28 ` [Bug tree-optimization/34017] [4.2/4.3 Regression] " pinskia at gcc dot gnu dot org
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: spop at gcc dot gnu dot org @ 2007-11-08  1:57 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from spop at gcc dot gnu dot org  2007-11-08 01:56 -------
Occurs only on 64bit machines: I cannot reproduce it on i686-linux.
I'll give a look at this bug on amd64 later on.

Sebastian


-- 

spop 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         |2007-11-08 01:56:56
               date|                            |


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


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

* [Bug tree-optimization/34017] [4.2/4.3 Regression] ICE in lambda_loopnest_to_gcc_loopnest with -O2 -ftree-loop-linear
  2007-11-07 17:54 [Bug tree-optimization/34017] New: ICE in lambda_loopnest_to_gcc_loopnest with -O2 -ftree-loop-linear janis at gcc dot gnu dot org
  2007-11-08  1:57 ` [Bug tree-optimization/34017] " spop at gcc dot gnu dot org
@ 2007-11-19  4:28 ` pinskia at gcc dot gnu dot org
  2007-11-22 15:19 ` jakub at gcc dot gnu dot org
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2007-11-19  4:28 UTC (permalink / raw)
  To: gcc-bugs



-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |pinskia at gcc dot gnu dot
                   |                            |org
 GCC target triplet|powerpc64-unknown-linux-gnu |LP64
           Keywords|                            |ice-on-valid-code
            Summary|ICE in                      |[4.2/4.3 Regression] ICE in
                   |lambda_loopnest_to_gcc_loopn|lambda_loopnest_to_gcc_loopn
                   |est with -O2 -ftree-loop-   |est with -O2 -ftree-loop-
                   |linear                      |linear
   Target Milestone|---                         |4.2.3


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


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

* [Bug tree-optimization/34017] [4.2/4.3 Regression] ICE in lambda_loopnest_to_gcc_loopnest with -O2 -ftree-loop-linear
  2007-11-07 17:54 [Bug tree-optimization/34017] New: ICE in lambda_loopnest_to_gcc_loopnest with -O2 -ftree-loop-linear janis at gcc dot gnu dot org
  2007-11-08  1:57 ` [Bug tree-optimization/34017] " spop at gcc dot gnu dot org
  2007-11-19  4:28 ` [Bug tree-optimization/34017] [4.2/4.3 Regression] " pinskia at gcc dot gnu dot org
@ 2007-11-22 15:19 ` jakub at gcc dot gnu dot org
  2007-11-27  5:57 ` mmitchel at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: jakub at gcc dot gnu dot org @ 2007-11-22 15:19 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from jakub at gcc dot gnu dot org  2007-11-22 15:19 -------
On the simplified:
extern int s;

void
foo (int *x, int y, int z)
{
  int m, n;
  int o;
  int p = x[0];
  o = s;
  for (m = 0; m < s; m++)
    for (n = 0; n < s; n++)
      {
        if (x[n] != p)
          continue;
        if (m > z)
          z = m;
        if (n < o)
          o = n;
      }
  for (m = y; m <= z; m++)
    {
    }
}

at -O2 -ftree-loop-linear, it fails everywhere I tried, on x86_64-linux with
both -m{32,64}, on i686-linux, on sparc64-linux with -m{32,64} and on
ppc64-linux
with -m{32,64}.

<bb 5>:
  # o_42 = PHI <o_8(4), o_1(12)>
  # n_40 = PHI <n_25(4), 0(12)>
  # z_35 = PHI <z_2(4), z_34(12)>
  D.1559_19 = (long unsigned int) n_40;
  D.1560_20 = D.1559_19 * 4;
  D.1561_21 = x_11(D) + D.1560_20;
  D.1562_22 = *D.1561_21;
  if (D.1562_22 != p_12)
    goto <bb 8>;
  else
    goto <bb 6>;

<bb 6>:
  z_17 = MAX_EXPR <z_35, m_38>;
  if (n_40 < o_42)
    goto <bb 8>;
  else
    goto <bb 7>;

<bb 7>:

<bb 8>:
  # o_8 = PHI <o_42(5), o_42(7), n_40(6)>
  # z_2 = PHI <z_35(5), z_17(7), z_17(6)>
  n_25 = n_40 + 1;
  if (o_13 > n_25)
    goto <bb 4>;
  else
    goto <bb 9>;

This is with IV n_40, oldiv_stmt is # n_40 = PHI <n_25(4), 0(12)> and one
of the immediate uses is # o_8 = PHI <o_42(5), o_42(7), n_40(6)>
That could have been perhaps transformed into a MIN_EXPR, but unlike the
MAX_EXPR phiopt1 has not done that, because there weren't just 2 incoming
edges, but 3 (where two used one value and the third different one).
I don't see justification for the assert that none of the immediate uses of
the IV is a PHI_NODE - it can certainly happen and while it can be harder to
fix up, perhaps involving adding some statements on edges, it is nothing
that should prevent the transformations.


-- 


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


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

* [Bug tree-optimization/34017] [4.2/4.3 Regression] ICE in lambda_loopnest_to_gcc_loopnest with -O2 -ftree-loop-linear
  2007-11-07 17:54 [Bug tree-optimization/34017] New: ICE in lambda_loopnest_to_gcc_loopnest with -O2 -ftree-loop-linear janis at gcc dot gnu dot org
                   ` (2 preceding siblings ...)
  2007-11-22 15:19 ` jakub at gcc dot gnu dot org
@ 2007-11-27  5:57 ` mmitchel at gcc dot gnu dot org
  2008-01-09  5:55 ` spop at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2007-11-27  5:57 UTC (permalink / raw)
  To: gcc-bugs



-- 

mmitchel at gcc dot gnu dot org changed:

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


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


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

* [Bug tree-optimization/34017] [4.2/4.3 Regression] ICE in lambda_loopnest_to_gcc_loopnest with -O2 -ftree-loop-linear
  2007-11-07 17:54 [Bug tree-optimization/34017] New: ICE in lambda_loopnest_to_gcc_loopnest with -O2 -ftree-loop-linear janis at gcc dot gnu dot org
                   ` (3 preceding siblings ...)
  2007-11-27  5:57 ` mmitchel at gcc dot gnu dot org
@ 2008-01-09  5:55 ` spop at gcc dot gnu dot org
  2008-01-09  7:58 ` spop at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: spop at gcc dot gnu dot org @ 2008-01-09  5:55 UTC (permalink / raw)
  To: gcc-bugs



-- 

spop at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |spop at gcc dot gnu dot org
                   |dot org                     |
             Status|NEW                         |ASSIGNED
   Last reconfirmed|2007-11-08 01:56:56         |2008-01-09 05:27:20
               date|                            |


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


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

* [Bug tree-optimization/34017] [4.2/4.3 Regression] ICE in lambda_loopnest_to_gcc_loopnest with -O2 -ftree-loop-linear
  2007-11-07 17:54 [Bug tree-optimization/34017] New: ICE in lambda_loopnest_to_gcc_loopnest with -O2 -ftree-loop-linear janis at gcc dot gnu dot org
                   ` (4 preceding siblings ...)
  2008-01-09  5:55 ` spop at gcc dot gnu dot org
@ 2008-01-09  7:58 ` spop at gcc dot gnu dot org
  2008-01-09 22:14 ` spop at gcc dot gnu dot org
  2008-01-09 22:18 ` spop at gcc dot gnu dot org
  7 siblings, 0 replies; 9+ messages in thread
From: spop at gcc dot gnu dot org @ 2008-01-09  7:58 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from spop at gcc dot gnu dot org  2008-01-09 06:22 -------
Subject: Re:  [4.2/4.3 Regression] ICE in lambda_loopnest_to_gcc_loopnest with
-O2 -ftree-loop-linear

Patch http://gcc.gnu.org/ml/gcc-patches/2008-01/msg00342.html


-- 


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


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

* [Bug tree-optimization/34017] [4.2/4.3 Regression] ICE in lambda_loopnest_to_gcc_loopnest with -O2 -ftree-loop-linear
  2007-11-07 17:54 [Bug tree-optimization/34017] New: ICE in lambda_loopnest_to_gcc_loopnest with -O2 -ftree-loop-linear janis at gcc dot gnu dot org
                   ` (5 preceding siblings ...)
  2008-01-09  7:58 ` spop at gcc dot gnu dot org
@ 2008-01-09 22:14 ` spop at gcc dot gnu dot org
  2008-01-09 22:18 ` spop at gcc dot gnu dot org
  7 siblings, 0 replies; 9+ messages in thread
From: spop at gcc dot gnu dot org @ 2008-01-09 22:14 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from spop at gcc dot gnu dot org  2008-01-09 21:23 -------
Subject: Bug 34017

Author: spop
Date: Wed Jan  9 21:22:19 2008
New Revision: 131435

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=131435
Log:
2008-01-09  Sebastian Pop  <sebastian.pop@amd.com>

        PR tree-optimization/34017
        * lambda-code.c (lambda_loopnest_to_gcc_loopnest): Generate code
        also for PHI_NODE expressions.

        * gcc.dg/tree-ssa/pr34017.c: New.


Added:
    trunk/gcc/testsuite/gcc.dg/tree-ssa/pr34017.c
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/lambda-code.c
    trunk/gcc/testsuite/ChangeLog


-- 


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


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

* [Bug tree-optimization/34017] [4.2/4.3 Regression] ICE in lambda_loopnest_to_gcc_loopnest with -O2 -ftree-loop-linear
  2007-11-07 17:54 [Bug tree-optimization/34017] New: ICE in lambda_loopnest_to_gcc_loopnest with -O2 -ftree-loop-linear janis at gcc dot gnu dot org
                   ` (6 preceding siblings ...)
  2008-01-09 22:14 ` spop at gcc dot gnu dot org
@ 2008-01-09 22:18 ` spop at gcc dot gnu dot org
  7 siblings, 0 replies; 9+ messages in thread
From: spop at gcc dot gnu dot org @ 2008-01-09 22:18 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from spop at gcc dot gnu dot org  2008-01-09 21:23 -------
Fixed.


-- 

spop at gcc dot gnu dot org changed:

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


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


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

end of thread, other threads:[~2008-01-09 21:23 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-11-07 17:54 [Bug tree-optimization/34017] New: ICE in lambda_loopnest_to_gcc_loopnest with -O2 -ftree-loop-linear janis at gcc dot gnu dot org
2007-11-08  1:57 ` [Bug tree-optimization/34017] " spop at gcc dot gnu dot org
2007-11-19  4:28 ` [Bug tree-optimization/34017] [4.2/4.3 Regression] " pinskia at gcc dot gnu dot org
2007-11-22 15:19 ` jakub at gcc dot gnu dot org
2007-11-27  5:57 ` mmitchel at gcc dot gnu dot org
2008-01-09  5:55 ` spop at gcc dot gnu dot org
2008-01-09  7:58 ` spop at gcc dot gnu dot org
2008-01-09 22:14 ` spop at gcc dot gnu dot org
2008-01-09 22:18 ` spop 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).