public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/32694]  New: [4.1/4.2 Regression] ICE in chain_of_csts_start
@ 2007-07-09 12:36 jakub at gcc dot gnu dot org
  2007-07-09 12:42 ` [Bug tree-optimization/32694] " pinskia at gcc dot gnu dot org
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: jakub at gcc dot gnu dot org @ 2007-07-09 12:36 UTC (permalink / raw)
  To: gcc-bugs

typedef signed long long int WordS64;
typedef unsigned long long int Word64;

int
foo (Word64 *p)
{
  while (1)
    {
      WordS64 c = 0x1llu;
      WordS64 x = *p;
      if (c >= 0)
        {
          if (x > (WordS64) 0x7FFFFFFFFFFFFFFFll - c)
            return 6;
        }
      else if (x < (WordS64) 0x8000000000000000ll - c)
        return 7;
      p++;
    }
}

ICEs at -O1 or -O2 in chain_of_csts_start, which is called on
 <nop_expr 0x2aaaae936d40
    type <integer_type 0x2aaaae93b790 long long int sizes-gimplified DI
        size <integer_cst 0x2aaaae92bdb0 constant invariant 64>
        unit size <integer_cst 0x2aaaae92bde0 constant invariant 8>
        align 64 symtab 0 alias set 3 precision 64 min <integer_cst
0x2aaaae92bf00 -9223372036854775808> max <integer_cst 0x2aaaae92bf30
9223372036854775807>
        pointer_to_this <pointer_type 0x2aaaae9e1840>>

    arg 0 <ssa_name 0x2aaaaeafb780
        type <integer_type 0x2aaaaeaf69a0 WordS64 sizes-gimplified public DI
size <integer_cst 0x2aaaae92bdb0 64> unit size <integer_cst 0x2aaaae92bde0 8>
            align 64 symtab 0 alias set -1 precision 64 min <integer_cst
0x2aaaae92bf00 -9223372036854775808> max <integer_cst 0x2aaaae92bf30
9223372036854775807>>
        var <var_decl 0x2aaaaeaf6d10 x> def_stmt <modify_expr 0x2aaaae931960>
        version 6>>
but assumes the argument is SSA_NAME.


-- 
           Summary: [4.1/4.2 Regression] ICE in chain_of_csts_start
           Product: gcc
           Version: 4.1.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: jakub at gcc dot gnu dot org


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


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

* [Bug tree-optimization/32694] [4.1/4.2 Regression] ICE in chain_of_csts_start
  2007-07-09 12:36 [Bug tree-optimization/32694] New: [4.1/4.2 Regression] ICE in chain_of_csts_start jakub at gcc dot gnu dot org
@ 2007-07-09 12:42 ` pinskia at gcc dot gnu dot org
  2007-07-09 12:46 ` rguenth at gcc dot gnu dot org
                   ` (8 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2007-07-09 12:42 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
           Keywords|                            |ice-on-valid-code
   Target Milestone|---                         |4.1.3


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


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

* [Bug tree-optimization/32694] [4.1/4.2 Regression] ICE in chain_of_csts_start
  2007-07-09 12:36 [Bug tree-optimization/32694] New: [4.1/4.2 Regression] ICE in chain_of_csts_start jakub at gcc dot gnu dot org
  2007-07-09 12:42 ` [Bug tree-optimization/32694] " pinskia at gcc dot gnu dot org
@ 2007-07-09 12:46 ` rguenth at gcc dot gnu dot org
  2007-07-09 12:52 ` jakub at gcc dot gnu dot org
                   ` (7 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2007-07-09 12:46 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from rguenth at gcc dot gnu dot org  2007-07-09 12:46 -------
which target?  I cannot reproduce this.


-- 

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |rguenth at gcc dot gnu dot
                   |                            |org


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


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

* [Bug tree-optimization/32694] [4.1/4.2 Regression] ICE in chain_of_csts_start
  2007-07-09 12:36 [Bug tree-optimization/32694] New: [4.1/4.2 Regression] ICE in chain_of_csts_start jakub at gcc dot gnu dot org
  2007-07-09 12:42 ` [Bug tree-optimization/32694] " pinskia at gcc dot gnu dot org
  2007-07-09 12:46 ` rguenth at gcc dot gnu dot org
@ 2007-07-09 12:52 ` jakub at gcc dot gnu dot org
  2007-07-09 12:54 ` jakub at gcc dot gnu dot org
                   ` (6 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: jakub at gcc dot gnu dot org @ 2007-07-09 12:52 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from jakub at gcc dot gnu dot org  2007-07-09 12:52 -------
x86_64-linux.
Rebuilding gcc 4.2 with --enable-checking yields a verify_stmt failure already  
after ccp, which changes
  WordS64D.1870 xD.1876;
  long long intD.5 D.1879;
...
  D.1879_7 = 9223372036854775807 - cD.1875_4;
  if (D.1879_7 < xD.1876_6) goto <L2>; else goto <L6>;
into:
  WordS64D.1870 xD.1876;
  if ((long long intD.5) xD.1876_6 == 9223372036854775807) goto <L2>; else goto 
<L6>;
which is invalid gimple.  But the operands of the comparison had different
types
of arguments already before.  Guess the gimple type system patches cured this
on the trunk.


-- 


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


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

* [Bug tree-optimization/32694] [4.1/4.2 Regression] ICE in chain_of_csts_start
  2007-07-09 12:36 [Bug tree-optimization/32694] New: [4.1/4.2 Regression] ICE in chain_of_csts_start jakub at gcc dot gnu dot org
                   ` (2 preceding siblings ...)
  2007-07-09 12:52 ` jakub at gcc dot gnu dot org
@ 2007-07-09 12:54 ` jakub at gcc dot gnu dot org
  2007-07-09 12:54 ` jakub at gcc dot gnu dot org
                   ` (5 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: jakub at gcc dot gnu dot org @ 2007-07-09 12:54 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from jakub at gcc dot gnu dot org  2007-07-09 12:53 -------
*** Bug 32695 has been marked as a duplicate of this bug. ***


-- 


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


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

* [Bug tree-optimization/32694] [4.1/4.2 Regression] ICE in chain_of_csts_start
  2007-07-09 12:36 [Bug tree-optimization/32694] New: [4.1/4.2 Regression] ICE in chain_of_csts_start jakub at gcc dot gnu dot org
                   ` (3 preceding siblings ...)
  2007-07-09 12:54 ` jakub at gcc dot gnu dot org
@ 2007-07-09 12:54 ` jakub at gcc dot gnu dot org
  2007-07-10 13:10 ` jakub at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: jakub at gcc dot gnu dot org @ 2007-07-09 12:54 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from jakub at gcc dot gnu dot org  2007-07-09 12:54 -------
*** Bug 32696 has been marked as a duplicate of this bug. ***


-- 


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


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

* [Bug tree-optimization/32694] [4.1/4.2 Regression] ICE in chain_of_csts_start
  2007-07-09 12:36 [Bug tree-optimization/32694] New: [4.1/4.2 Regression] ICE in chain_of_csts_start jakub at gcc dot gnu dot org
                   ` (4 preceding siblings ...)
  2007-07-09 12:54 ` jakub at gcc dot gnu dot org
@ 2007-07-10 13:10 ` jakub at gcc dot gnu dot org
  2007-09-05  0:56 ` mmitchel at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: jakub at gcc dot gnu dot org @ 2007-07-10 13:10 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from jakub at gcc dot gnu dot org  2007-07-10 13:10 -------
This got fixed by
http://gcc.gnu.org/ml/gcc-patches/2006-11/msg00206.html
on the trunk.
Even is subset of those changes fixes this on 4.2 branch:
--- gcc/tree-ssa-ccp.c.jj       2007-03-20 00:22:09.000000000 +0100
+++ gcc/tree-ssa-ccp.c  2007-07-10 14:49:15.000000000 +0200
@@ -2063,12 +2063,13 @@ fold_stmt_r (tree *expr_p, int *walk_sub
          tem = fold_binary (TREE_CODE (op0), TREE_TYPE (op0),
                             TREE_OPERAND (op0, 0),
                             TREE_OPERAND (op0, 1));
-         set = tem && is_gimple_condexpr (tem);
+         set = tem && set_rhs (expr_p, tem);
          fold_undefer_overflow_warnings (set, fold_stmt_r_data->stmt, 0);
          if (set)
-           TREE_OPERAND (expr, 0) = tem;
-         t = expr;
-          break;
+           {
+             t = *expr_p;
+             break;
+           }
         }

     default:
--- gcc/tree-ssa-propagate.c.jj 2007-03-20 00:22:09.000000000 +0100
+++ gcc/tree-ssa-propagate.c    2007-07-10 14:55:18.000000000 +0200
@@ -571,7 +571,8 @@ set_rhs (tree *stmt_p, tree expr)
   ssa_op_iter iter;

   /* Verify the constant folded result is valid gimple.  */
-  if (TREE_CODE_CLASS (code) == tcc_binary)
+  if (TREE_CODE_CLASS (code) == tcc_binary
+      || TREE_CODE_CLASS (code) == tcc_comparison)
     {
       if (!is_gimple_val (TREE_OPERAND (expr, 0))
          || !is_gimple_val (TREE_OPERAND (expr, 1)))

which prevents in this case generating invalid gimple.
On gcc-4_1-branch, even just the tree-ssa-propagate.c chunk cures this.
Is this something which can safely be changed on the release branches?


-- 

jakub at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |dnovillo at gcc dot gnu dot
                   |                            |org


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


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

* [Bug tree-optimization/32694] [4.1/4.2 Regression] ICE in chain_of_csts_start
  2007-07-09 12:36 [Bug tree-optimization/32694] New: [4.1/4.2 Regression] ICE in chain_of_csts_start jakub at gcc dot gnu dot org
                   ` (5 preceding siblings ...)
  2007-07-10 13:10 ` jakub at gcc dot gnu dot org
@ 2007-09-05  0:56 ` mmitchel at gcc dot gnu dot org
  2007-09-25 15:15 ` jakub at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2007-09-05  0:56 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=32694


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

* [Bug tree-optimization/32694] [4.1/4.2 Regression] ICE in chain_of_csts_start
  2007-07-09 12:36 [Bug tree-optimization/32694] New: [4.1/4.2 Regression] ICE in chain_of_csts_start jakub at gcc dot gnu dot org
                   ` (6 preceding siblings ...)
  2007-09-05  0:56 ` mmitchel at gcc dot gnu dot org
@ 2007-09-25 15:15 ` jakub at gcc dot gnu dot org
  2007-12-27 17:34 ` [Bug tree-optimization/32694] [4.1 Regression] ICE with long long arithmetic reichelt at gcc dot gnu dot org
  2008-07-04 16:12 ` jsm28 at gcc dot gnu dot org
  9 siblings, 0 replies; 11+ messages in thread
From: jakub at gcc dot gnu dot org @ 2007-09-25 15:15 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from jakub at gcc dot gnu dot org  2007-09-25 15:14 -------
Subject: Bug 32694

Author: jakub
Date: Tue Sep 25 15:14:42 2007
New Revision: 128766

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=128766
Log:
        PR tree-optimization/32694
        2006-11-08  Roger Sayle  <roger@eyesopen.com>
        * tree-ssa-propagate.c (set_rhs): Verify tcc_comparison the same way
        as tcc_binary.
        * tree-ssa-ccp.c (fold_stmt_r) <COND_EXPR>: Use set_rhs to modify
        the condition after calling fold_binary.

        * gcc.c-torture/compile/20070925-1.c: New test.

Added:
    branches/gcc-4_2-branch/gcc/testsuite/gcc.c-torture/compile/20070925-1.c
Modified:
    branches/gcc-4_2-branch/gcc/ChangeLog
    branches/gcc-4_2-branch/gcc/testsuite/ChangeLog
    branches/gcc-4_2-branch/gcc/tree-ssa-ccp.c
    branches/gcc-4_2-branch/gcc/tree-ssa-propagate.c


-- 


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


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

* [Bug tree-optimization/32694] [4.1 Regression] ICE with long long arithmetic
  2007-07-09 12:36 [Bug tree-optimization/32694] New: [4.1/4.2 Regression] ICE in chain_of_csts_start jakub at gcc dot gnu dot org
                   ` (7 preceding siblings ...)
  2007-09-25 15:15 ` jakub at gcc dot gnu dot org
@ 2007-12-27 17:34 ` reichelt at gcc dot gnu dot org
  2008-07-04 16:12 ` jsm28 at gcc dot gnu dot org
  9 siblings, 0 replies; 11+ messages in thread
From: reichelt at gcc dot gnu dot org @ 2007-12-27 17:34 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #7 from reichelt at gcc dot gnu dot org  2007-12-27 17:34 -------
Confirmed.


-- 

reichelt at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |reichelt at gcc dot gnu dot
                   |                            |org
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
           Keywords|                            |monitored
      Known to fail|                            |4.1.3 4.2.0 4.2.1
      Known to work|                            |4.1.0 4.1.1 4.1.2 4.2.2
   Last reconfirmed|0000-00-00 00:00:00         |2007-12-27 17:34:18
               date|                            |
            Summary|[4.1/4.2 Regression] ICE in |[4.1 Regression] ICE with
                   |chain_of_csts_start         |long long arithmetic


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


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

* [Bug tree-optimization/32694] [4.1 Regression] ICE with long long arithmetic
  2007-07-09 12:36 [Bug tree-optimization/32694] New: [4.1/4.2 Regression] ICE in chain_of_csts_start jakub at gcc dot gnu dot org
                   ` (8 preceding siblings ...)
  2007-12-27 17:34 ` [Bug tree-optimization/32694] [4.1 Regression] ICE with long long arithmetic reichelt at gcc dot gnu dot org
@ 2008-07-04 16:12 ` jsm28 at gcc dot gnu dot org
  9 siblings, 0 replies; 11+ messages in thread
From: jsm28 at gcc dot gnu dot org @ 2008-07-04 16:12 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #8 from jsm28 at gcc dot gnu dot org  2008-07-04 16:11 -------
Closing 4.1 branch.


-- 

jsm28 at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED
   Target Milestone|4.1.3                       |4.2.2


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


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

end of thread, other threads:[~2008-07-04 16:12 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-07-09 12:36 [Bug tree-optimization/32694] New: [4.1/4.2 Regression] ICE in chain_of_csts_start jakub at gcc dot gnu dot org
2007-07-09 12:42 ` [Bug tree-optimization/32694] " pinskia at gcc dot gnu dot org
2007-07-09 12:46 ` rguenth at gcc dot gnu dot org
2007-07-09 12:52 ` jakub at gcc dot gnu dot org
2007-07-09 12:54 ` jakub at gcc dot gnu dot org
2007-07-09 12:54 ` jakub at gcc dot gnu dot org
2007-07-10 13:10 ` jakub at gcc dot gnu dot org
2007-09-05  0:56 ` mmitchel at gcc dot gnu dot org
2007-09-25 15:15 ` jakub at gcc dot gnu dot org
2007-12-27 17:34 ` [Bug tree-optimization/32694] [4.1 Regression] ICE with long long arithmetic reichelt at gcc dot gnu dot org
2008-07-04 16:12 ` jsm28 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).