[backport from gcc-4.7/trunk r184436 ] gcc/ 2012-02-21 Richard Guenther PR middle-end/52314 * gimplify.c (create_tmp_from_val): Use the main variant type for the type of the temporary we create. --- gcc-4.6.3/gcc/gimplify.c.~1~ 2011-07-07 14:50:03.000000000 +0200 +++ gcc-4.6.3/gcc/gimplify.c 2012-03-10 11:56:40.000000000 +0100 @@ -492,7 +492,8 @@ create_tmp_reg (tree type, const char *p static inline tree create_tmp_from_val (tree val) { - return create_tmp_var (TREE_TYPE (val), get_name (val)); + /* Drop all qualifiers and address-space information from the value type. */ + return create_tmp_var (TYPE_MAIN_VARIANT (TREE_TYPE (val)), get_name (val)); } /* Create a temporary to hold the value of VAL. If IS_FORMAL, try to reuse