This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [tree-ssa] handle CONST_DECL in the gimplifier


On Sun, May 11, 2003 at 12:03:15PM -0400, Jason Merrill wrote:
> A CONST_DECL should be replaced with its DECL_INITIAL.
> 
Do you mean that this transformation has to be performed by the gimplifier, 
or should it go before that?  

The following solves the bug, however it is not yet bootstrapped.


	* gimplify.c (simplify_expr): Replace CONST_DECL with its DECL_INITIAL.

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 19:31:52 -0000
@@ -468,6 +468,10 @@ simplify_expr (expr_p, pre_p, post_p, si
 	case VECTOR_CST:
 	  break;
 
+	case CONST_DECL:
+	  *expr_p = DECL_INITIAL (*expr_p);
+	  break;
+
 	  /* FIXME make this a decl.  */
 	case EXC_PTR_EXPR:
 	  break;


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]