===================================================================
@@ -9392,7 +9392,8 @@
enum expand_modifier modifier, rtx *alt_rtl,
bool inner_reference_p)
{
- rtx op0, op1, temp, decl_rtl;
+ rtx op0, op1, temp;
+ rtx decl_rtl = NULL_RTX;
tree type;
int unsignedp;
machine_mode mode, dmode;
@@ -9590,11 +9591,22 @@
&& (TREE_STATIC (exp) || DECL_EXTERNAL (exp)))
layout_decl (exp, 0);
+ decl_rtl = DECL_RTL (exp);
+
+ if (MEM_P (decl_rtl)
+ && (VECTOR_TYPE_P (type) && DECL_MODE (exp) != mode))
+ {
+ if (current_function_decl
+ && (! reload_completed && !reload_in_progress))
+ decl_rtl = change_address (decl_rtl, TYPE_MODE (type), 0);
+ }
+
/* ... fall through ... */
case FUNCTION_DECL:
case RESULT_DECL:
- decl_rtl = DECL_RTL (exp);
+ if (! decl_rtl)
+ decl_rtl = DECL_RTL (exp);
expand_decl_rtl:
gcc_assert (decl_rtl);
decl_rtl = copy_rtx (decl_rtl);