public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/60740] New: ICE in extract_affine w/ -O2 -ftree-loop-linear
@ 2014-04-02 11:22 asolokha at gmx dot com
  2014-04-02 11:27 ` [Bug tree-optimization/60740] [4.8/4.9 Regression] " mpolacek at gcc dot gnu.org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: asolokha at gmx dot com @ 2014-04-02 11:22 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 60740
           Summary: ICE in extract_affine w/ -O2 -ftree-loop-linear
           Product: gcc
           Version: 4.8.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: asolokha at gmx dot com

At least gcc 4.8.2 and and 4.9.0-alpha20140330 fail to compile the following
code snippet w/ -O2 -ftree-loop-linear on x86_64-pc-linux-gnu:

int **db6 = 0;

void
k26(void)
{
  static int geb = 0;
  int *a22 = &geb;
  int **l30 = &a22;
  int *c4b;
  int ndf;
  for (ndf = 0; ndf <= 1; ++ndf)
    *c4b = (db6 == l30) && (*a22)--;
}

% gcc-4.9.0-alpha20140330 -c -O2 -ftree-loop-linear testcase.c
crash1.c: In function 'k26':
crash1.c:4:1: internal compiler error: in extract_affine, at
graphite-sese-to-poly.c:846
 k26(void)
 ^

% gcc-4.8.2 -c -O2 -ftree-loop-linear testcase.c
crash1.c: In function 'k26':
crash1.c:4:1: internal compiler error: in extract_affine, at
graphite-sese-to-poly.c:827
 k26(void)
 ^

% gcc-4.7.3 -c -O2 -ftree-loop-linear testcase.c
% echo $?

I failed to reduce the testcase any further.


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

* [Bug tree-optimization/60740] [4.8/4.9 Regression] ICE in extract_affine w/ -O2 -ftree-loop-linear
  2014-04-02 11:22 [Bug tree-optimization/60740] New: ICE in extract_affine w/ -O2 -ftree-loop-linear asolokha at gmx dot com
@ 2014-04-02 11:27 ` mpolacek at gcc dot gnu.org
  2014-04-03 11:49 ` rguenth at gcc dot gnu.org
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2014-04-02 11:27 UTC (permalink / raw)
  To: gcc-bugs

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

Marek Polacek <mpolacek at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2014-04-02
                 CC|                            |mpolacek at gcc dot gnu.org
   Target Milestone|---                         |4.9.0
            Summary|ICE in extract_affine w/    |[4.8/4.9 Regression] ICE in
                   |-O2 -ftree-loop-linear      |extract_affine w/ -O2
                   |                            |-ftree-loop-linear
     Ever confirmed|0                           |1

--- Comment #1 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
Confirmed (-ftree-loop-linear is a graphite stuff).


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

* [Bug tree-optimization/60740] [4.8/4.9 Regression] ICE in extract_affine w/ -O2 -ftree-loop-linear
  2014-04-02 11:22 [Bug tree-optimization/60740] New: ICE in extract_affine w/ -O2 -ftree-loop-linear asolokha at gmx dot com
  2014-04-02 11:27 ` [Bug tree-optimization/60740] [4.8/4.9 Regression] " mpolacek at gcc dot gnu.org
@ 2014-04-03 11:49 ` rguenth at gcc dot gnu.org
  2014-04-03 13:43 ` [Bug tree-optimization/60740] [4.8 " rguenth at gcc dot gnu.org
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: rguenth at gcc dot gnu.org @ 2014-04-03 11:49 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P2
             Status|NEW                         |ASSIGNED
           Assignee|unassigned at gcc dot gnu.org      |rguenth at gcc dot gnu.org
   Target Milestone|4.9.0                       |4.8.3

--- Comment #2 from Richard Biener <rguenth at gcc dot gnu.org> ---
It seems we can't encode &a22 (an address of a decl) for ISL.  Which means
the loop should have been rejected earlier?  Or the

 if (&a22 == pretmp_1)
    _10 = geb_lsm.6_11 - 1;

should have been in a "black-box"?  We're coming from add_condition_to_pbb
but it seems "stmts" do not cover control flow.  Looks like
stmt_simple_for_scop_p
simply implements checks for GIMPLE_CONDs wrong.  Testing the following:

Index: gcc/graphite-scop-detection.c
===================================================================
--- gcc/graphite-scop-detection.c       (revision 209018)
+++ gcc/graphite-scop-detection.c       (working copy)
@@ -346,13 +346,10 @@ stmt_simple_for_scop_p (basic_block scop

     case GIMPLE_COND:
       {
-       tree op;
-       ssa_op_iter op_iter;
-        enum tree_code code = gimple_cond_code (stmt);
-
        /* We can handle all binary comparisons.  Inequalities are
           also supported as they can be represented with union of
           polyhedra.  */
+        enum tree_code code = gimple_cond_code (stmt);
         if (!(code == LT_EXPR
              || code == GT_EXPR
              || code == LE_EXPR
@@ -361,11 +358,14 @@ stmt_simple_for_scop_p (basic_block scop
              || code == NE_EXPR))
           return false;

-       FOR_EACH_SSA_TREE_OPERAND (op, stmt, op_iter, SSA_OP_ALL_USES)
-         if (!graphite_can_represent_expr (scop_entry, loop, op)
-             /* We can not handle REAL_TYPE. Failed for pr39260.  */
-             || TREE_CODE (TREE_TYPE (op)) == REAL_TYPE)
-           return false;
+       for (unsigned i = 0; i < 2; ++i)
+         {
+           tree op = gimple_op (stmt, i);
+           if (!graphite_can_represent_expr (scop_entry, loop, op)
+               /* We can not handle REAL_TYPE. Failed for pr39260.  */
+               || TREE_CODE (TREE_TYPE (op)) == REAL_TYPE)
+             return false;
+         }

        return true;
       }


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

* [Bug tree-optimization/60740] [4.8 Regression] ICE in extract_affine w/ -O2 -ftree-loop-linear
  2014-04-02 11:22 [Bug tree-optimization/60740] New: ICE in extract_affine w/ -O2 -ftree-loop-linear asolokha at gmx dot com
  2014-04-02 11:27 ` [Bug tree-optimization/60740] [4.8/4.9 Regression] " mpolacek at gcc dot gnu.org
  2014-04-03 11:49 ` rguenth at gcc dot gnu.org
@ 2014-04-03 13:43 ` rguenth at gcc dot gnu.org
  2014-04-03 13:44 ` rguenth at gcc dot gnu.org
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: rguenth at gcc dot gnu.org @ 2014-04-03 13:43 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
      Known to work|                            |4.9.0
            Summary|[4.8/4.9 Regression] ICE in |[4.8 Regression] ICE in
                   |extract_affine w/ -O2       |extract_affine w/ -O2
                   |-ftree-loop-linear          |-ftree-loop-linear
      Known to fail|4.9.0                       |

--- Comment #3 from Richard Biener <rguenth at gcc dot gnu.org> ---
Fixed on trunk sofar.


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

* [Bug tree-optimization/60740] [4.8 Regression] ICE in extract_affine w/ -O2 -ftree-loop-linear
  2014-04-02 11:22 [Bug tree-optimization/60740] New: ICE in extract_affine w/ -O2 -ftree-loop-linear asolokha at gmx dot com
                   ` (2 preceding siblings ...)
  2014-04-03 13:43 ` [Bug tree-optimization/60740] [4.8 " rguenth at gcc dot gnu.org
@ 2014-04-03 13:44 ` rguenth at gcc dot gnu.org
  2014-04-23 12:49 ` rguenth at gcc dot gnu.org
  2014-04-23 12:52 ` rguenth at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: rguenth at gcc dot gnu.org @ 2014-04-03 13:44 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from Richard Biener <rguenth at gcc dot gnu.org> ---
Author: rguenth
Date: Thu Apr  3 13:43:23 2014
New Revision: 209057

URL: http://gcc.gnu.org/viewcvs?rev=209057&root=gcc&view=rev
Log:
2014-04-03  Richard Biener  <rguenther@suse.de>

    PR tree-optimization/60740
    * graphite-scop-detection.c (stmt_simple_for_scop_p): Iterate
    over all GIMPLE_COND operands.

    * gcc.dg/graphite/pr60740.c: New testcase.

Added:
    trunk/gcc/testsuite/gcc.dg/graphite/pr60740.c
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/graphite-scop-detection.c
    trunk/gcc/testsuite/ChangeLog


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

* [Bug tree-optimization/60740] [4.8 Regression] ICE in extract_affine w/ -O2 -ftree-loop-linear
  2014-04-02 11:22 [Bug tree-optimization/60740] New: ICE in extract_affine w/ -O2 -ftree-loop-linear asolokha at gmx dot com
                   ` (3 preceding siblings ...)
  2014-04-03 13:44 ` rguenth at gcc dot gnu.org
@ 2014-04-23 12:49 ` rguenth at gcc dot gnu.org
  2014-04-23 12:52 ` rguenth at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: rguenth at gcc dot gnu.org @ 2014-04-23 12:49 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from Richard Biener <rguenth at gcc dot gnu.org> ---
Author: rguenth
Date: Wed Apr 23 12:49:04 2014
New Revision: 209697

URL: http://gcc.gnu.org/viewcvs?rev=209697&root=gcc&view=rev
Log:
2014-04-23  Richard Biener  <rguenther@suse.de>

    Backport from mainline
    2014-04-02  Richard Biener  <rguenther@suse.de>

    PR middle-end/60729
    * optabs.c (expand_abs_nojump): Honor flag_trapv only for
    MODE_INTs.  Properly use negv_optab.
    (expand_abs): Likewise.

    * g++.dg/vect/pr60729.cc: New testcase.

    2014-04-03  Richard Biener  <rguenther@suse.de>

    PR tree-optimization/60740
    * graphite-scop-detection.c (stmt_simple_for_scop_p): Iterate
    over all GIMPLE_COND operands.

    * gcc.dg/graphite/pr60740.c: New testcase.

Added:
    branches/gcc-4_8-branch/gcc/testsuite/g++.dg/vect/pr60729.cc
    branches/gcc-4_8-branch/gcc/testsuite/gcc.dg/graphite/pr60740.c
Modified:
    branches/gcc-4_8-branch/gcc/ChangeLog
    branches/gcc-4_8-branch/gcc/graphite-scop-detection.c
    branches/gcc-4_8-branch/gcc/optabs.c
    branches/gcc-4_8-branch/gcc/testsuite/ChangeLog


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

* [Bug tree-optimization/60740] [4.8 Regression] ICE in extract_affine w/ -O2 -ftree-loop-linear
  2014-04-02 11:22 [Bug tree-optimization/60740] New: ICE in extract_affine w/ -O2 -ftree-loop-linear asolokha at gmx dot com
                   ` (4 preceding siblings ...)
  2014-04-23 12:49 ` rguenth at gcc dot gnu.org
@ 2014-04-23 12:52 ` rguenth at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: rguenth at gcc dot gnu.org @ 2014-04-23 12:52 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

--- Comment #6 from Richard Biener <rguenth at gcc dot gnu.org> ---
Fixed.


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

end of thread, other threads:[~2014-04-23 12:52 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-04-02 11:22 [Bug tree-optimization/60740] New: ICE in extract_affine w/ -O2 -ftree-loop-linear asolokha at gmx dot com
2014-04-02 11:27 ` [Bug tree-optimization/60740] [4.8/4.9 Regression] " mpolacek at gcc dot gnu.org
2014-04-03 11:49 ` rguenth at gcc dot gnu.org
2014-04-03 13:43 ` [Bug tree-optimization/60740] [4.8 " rguenth at gcc dot gnu.org
2014-04-03 13:44 ` rguenth at gcc dot gnu.org
2014-04-23 12:49 ` rguenth at gcc dot gnu.org
2014-04-23 12: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).