This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[tree-ssa] handle CONST_DECL in the gimplifier
- From: Pop Sébastian <pop at gauvain dot u-strasbg dot fr>
- To: dnovillo at redhat dot com, gcc-patches at gcc dot gnu dot org
- Date: Sun, 11 May 2003 17:36:06 +0200
- Subject: [tree-ssa] handle CONST_DECL in the gimplifier
Hi,
This patch avoids gimplification of CONST_DECL nodes. The gimplifier
aborted when compiling a file from the mozilla project. I will report
build time for this project once tree-ssa will build it :-)
I tried to reduce the testcase but it was simpler to fix the problem than
reducing it. The .ii file on which the error showed up is available at:
http://icps.u-strasbg.fr/~pop/nsFontMetricsXlib.ii.gz
This patch bootstrapped with --enable-languages=c,c++,f77,java
OK for tree-ssa?
Sebastian
* tree-simple.c (is_simple_const): CONST_DECL is a constant.
* gimplify.c (simplify_expr): Don't simplify CONST_DECL.
Index: tree-simple.c
===================================================================
RCS file: /cvsroot/gcc/gcc/gcc/Attic/tree-simple.c,v
retrieving revision 1.1.4.33
diff -d -u -p -r1.1.4.33 tree-simple.c
--- tree-simple.c 1 May 2003 16:50:21 -0000 1.1.4.33
+++ tree-simple.c 11 May 2003 14:27:30 -0000
@@ -609,6 +609,7 @@ is_simple_const (t)
|| TREE_CODE (t) == STRING_CST
|| TREE_CODE (t) == LABEL_DECL
|| TREE_CODE (t) == RESULT_DECL
+ || TREE_CODE (t) == CONST_DECL
|| TREE_CODE (t) == COMPLEX_CST
|| TREE_CODE (t) == VECTOR_CST);
}
Index: gimplify.c
===================================================================
RCS file: /cvsroot/gcc/gcc/gcc/Attic/gimplify.c,v
retrieving revision 1.1.2.38
diff -d -u -p -r1.1.2.38 gimplify.c
--- gimplify.c 7 May 2003 13:28:06 -0000 1.1.2.38
+++ gimplify.c 11 May 2003 14:27:38 -0000
@@ -466,6 +466,7 @@ simplify_expr (expr_p, pre_p, post_p, si
case STRING_CST:
case COMPLEX_CST:
case VECTOR_CST:
+ case CONST_DECL:
break;
/* FIXME make this a decl. */