Bug 25612 - [4.2 Regression] Ada bootstrap failure on x86_64 find_or_generate_expression, at tree-ssa-pre.c:2028
Summary: [4.2 Regression] Ada bootstrap failure on x86_64 find_or_generate_expression,...
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: http://gcc.gnu.org/ml/gcc-patches/200...
Keywords: build, ice-on-valid-code, patch
Depends on:
Blocks:
 
Reported: 2005-12-31 12:50 UTC by Laurent GUERBY
Modified: 2005-12-31 19:38 UTC (History)
3 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2005-12-31 17:19:54


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Laurent GUERBY 2005-12-31 12:50:29 UTC
From Andreas Jaeger, confirmed by toon on IRC.

http://gcc.gnu.org/ml/gcc-patches/2005-12/msg01955.html

make[3]: Entering directory `/builds/gcc/misc/stage3-gcc/ada/tools'
../../gnatmake -c -I../rts -I. -I/cvs/gcc-svn/trunk/gcc/ada gnatchop --GCC="../../xgcc -B../../ -O2 -g -O2       -gnatpg -gnata"
../../xgcc -c -I./ -I../rts -I. -I/cvs/gcc-svn/trunk/gcc/ada -B../../ -O2 -g -O2 -gnatpg -gnata -I- /cvs/gcc-svn/trunk/gcc/ada/gnatchop.adb
+===========================GNAT BUG DETECTED==============================+
| 4.2.0 20051231 (experimental) (x86_64-suse-linux-gnu) GCC error:         |
| in find_or_generate_expression, at tree-ssa-pre.c:2028                   |
| Error detected at gnatchop.adb:1810:5                                    |
| Please submit a bug report; see http://gcc.gnu.org/bugs.html.            |
| Use a subject line meaningful to you and us to track the bug.            |
| Include the entire contents of this bug box in the report.               |
| Include the exact gcc or gnatmake command that you entered.              |
| Also include sources listed below in gnatchop format                     |
| (concatenated together with no headers between files).                   |
+==========================================================================+
Comment 1 Andrew Pinski 2005-12-31 17:19:54 UTC
the ICE is on the SSA_NAME for the PARM_DECL for the chain variable for nested function

I might have a fix, I think the normal issue as not treating this PARM_DECL live at the beginging of the first BB is the issue.

Here is the patch which I am testing right now:
Index: tree-ssa-pre.c
===================================================================
--- tree-ssa-pre.c      (revision 109198)
+++ tree-ssa-pre.c      (working copy)
@@ -3086,6 +3086,18 @@ compute_avail (void)
        }
     }
 
+  if (cfun->static_chain_decl)
+    {
+      param = cfun->static_chain_decl;
+      if (default_def (param) != NULL)
+        {
+          tree def = default_def (param);
+          vn_lookup_or_add (def, NULL);
+          bitmap_insert_into_set (TMP_GEN (ENTRY_BLOCK_PTR), def);
+          bitmap_value_insert_into_set (AVAIL_OUT (ENTRY_BLOCK_PTR), def);
+        }
+    }
+
   /* Allocate the worklist.  */
   worklist = XNEWVEC (basic_block, n_basic_blocks);
Comment 2 Andrew Pinski 2005-12-31 19:21:03 UTC
Patch posted: http://gcc.gnu.org/ml/gcc-patches/2005-12/msg01966.html
Comment 3 Andrew Pinski 2005-12-31 19:38:08 UTC
Subject: Bug 25612

Author: pinskia
Date: Sat Dec 31 19:38:05 2005
New Revision: 109200

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=109200
Log:
2005-12-31  Andrew Pinski  <pinskia@ohysics.uc.edu>

        PR tree-opt/25612
        * tree-ssa-pre.c (compute_avail): Treat the static chain decl as a
        parameter and pretend that it is defined in the entry basic block.


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

Comment 4 Andrew Pinski 2005-12-31 19:38:19 UTC
Fixed.