Bug 26795 - [4.2 Regression] ACATS ICE c37213d on x86 in valid_in_set, at tree-ssa-pre.c:1579
Summary: [4.2 Regression] ACATS ICE c37213d on x86 in valid_in_set, at tree-ssa-pre.c:...
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: tree-optimization (show other bugs)
Version: 4.2.0
: P3 normal
Target Milestone: 4.2.0
Assignee: Andrew Pinski
URL:
Keywords: ice-on-valid-code
Depends on:
Blocks:
 
Reported: 2006-03-22 07:20 UTC by Laurent GUERBY
Modified: 2006-03-23 15:10 UTC (History)
3 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2006-03-22 19:26:41


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Laurent GUERBY 2006-03-22 07:20:09 UTC
ICE on x86-linux but pass on x86_64-linux. 20060314 was PASS.

+===========================GNAT BUG DETECTED==============================+
| 4.2.0 20060321 (experimental) (i686-pc-linux-gnu) GCC error:             |
| in valid_in_set, at tree-ssa-pre.c:1579                                  |
| Error detected at c37213d.adb:240:5                                      |
Comment 1 Andrew Pinski 2006-03-22 07:22:11 UTC
This is definitely mine.
Comment 2 Andrew Pinski 2006-03-22 18:16:30 UTC
VIEW_CONVERT_EXPR<struct c37213d__E90b__S95b___C_PAD[D.2494:D.2496]>(*B$P_ARRAYD.2768_872)[B92b.67D.2585_1027]{lb: 1 sz: 000000004}


We have a VIEW_CONVERT_EXPR here is ok, the assert is broken.
Comment 3 Andrew Pinski 2006-03-22 18:54:51 UTC
The problem is that is the following:
Created value VH.637 for VIEW_CONVERT_EXPR<struct c37213d__E27b__S31b___C_PAD[D.1589:D.1591]>(*_init$P_ARRAY_101)[A28b.23_725]{lb: 1 sz: 000000004} vuses: (HEAP.76_1012)


That should have been two split up into two VH's.
Comment 4 Andrew Pinski 2006-03-22 18:56:10 UTC
(In reply to comment #3)
> The problem is that is the following:
> Created value VH.637 for VIEW_CONVERT_EXPR<struct
> c37213d__E27b__S31b___C_PAD[D.1589:D.1591]>(*_init$P_ARRAY_101)[A28b.23_725]{lb:
> 1 sz: 000000004} vuses: (HEAP.76_1012)

Actually 3, and it creates the VH's:
Created value VH.635 for *VH.570 vuses: (HEAP.76_1012)
Created value VH.636 for VIEW_CONVERT_EXPR<struct c37213d__E27b__S31b___C_PAD[D.1589:D.1591]>(VH.635) vuses: (HEAP.76_1012)
Created value VH.637 for VIEW_CONVERT_EXPR<struct c37213d__E27b__S31b___C_PAD[D.1589:D.1591]>(*_init$P_ARRAY_101)[A28b.23_725]{lb: 1 sz: 000000004} vuses: (HEAP.76_1012)

But does not replace it.
Comment 5 Andrew Pinski 2006-03-22 19:19:46 UTC
The problem is the follow if is being hit:
2941          /* If OP is a constant that has overflowed, do not value number
2942             this expression.  */
2943          if (CONSTANT_CLASS_P (op)
2944              && TREE_OVERFLOW (op))

Which means we don't get a VH correctly for this statement.
Comment 6 Andrew Pinski 2006-03-22 19:26:41 UTC
I think I have a fix, removing this condition as this condition predates the change for overflow constants being gimple invariant.
Comment 7 Andrew Pinski 2006-03-22 21:39:35 UTC
Full testing of my patch is happening right now.  It worked for this testcase just fine.
Comment 8 patchapp@dberlin.org 2006-03-23 05:05:36 UTC
Subject: Bug number PR tree-opt/26795

A patch for this bug has been added to the patch tracker.
The mailing list url for the patch is http://gcc.gnu.org/ml/gcc-patches/2006-03/msg01422.html
Comment 9 Andrew Pinski 2006-03-23 15:09:55 UTC
Subject: Bug 26795

Author: pinskia
Date: Thu Mar 23 15:09:51 2006
New Revision: 112319

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=112319
Log:
2006-03-23  Andrew Pinski  <pinskia@physics.uc.edu>

        PR tree-opt/26795
        * tree-ssa-pre.c (create_value_expr_from): Don't reject
        expressions which have overflowed constants.

Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/tree-ssa-pre.c

Comment 10 Andrew Pinski 2006-03-23 15:10:42 UTC
Fixed.