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]

[PATCH] Fix middle-end/30164 invalid gimple produced for global_vector = CONSTRUCTOR


The problem here is that gimplify_init_constructor does not check if the
left hand is a gimple register before leaving the CONSTRUCTOR on the
right hand side.  This fixes the problem by generating a temporary
variable if the left hand side is not a gimple register.

OK?  Bootstrapped and tested on i686-linux-gnu with no regression.

Thanks,
Andrew Pinski

ChangeLog:

	* gimplify.c (gimplify_init_constructor <case VECTOR_TYPE>):
	Use a temporary variable if the left hand side is not a gimple
	register.
Index: gimplify.c
===================================================================
--- gimplify.c	(revision 120101)
+++ gimplify.c	(working copy)
@@ -3186,6 +3186,8 @@ gimplify_init_constructor (tree *expr_p,
 	    if (tret == GS_ERROR)
 	      ret = GS_ERROR;
 	  }
+	if (!is_gimple_reg (GENERIC_TREE_OPERAND (*expr_p, 0)))
+	  GENERIC_TREE_OPERAND (*expr_p, 1) = get_formal_tmp_var (ctor, pre_p);
       }
       break;
 

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