diff options
Diffstat (limited to 'gcc/emit-rtl.c')
-rw-r--r-- | gcc/emit-rtl.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/gcc/emit-rtl.c b/gcc/emit-rtl.c index d211e6b0ce5..a6ef154f3de 100644 --- a/gcc/emit-rtl.c +++ b/gcc/emit-rtl.c @@ -63,6 +63,7 @@ along with GCC; see the file COPYING3. If not see #include "target.h" #include "builtins.h" #include "rtl-iter.h" +#include "stor-layout.h" struct target_rtl default_target_rtl; #if SWITCHABLE_TARGET @@ -1233,6 +1234,9 @@ set_reg_attrs_for_parm (rtx parm_rtx, rtx mem) void set_reg_attrs_for_decl_rtl (tree t, rtx x) { + if (!t) + return; + tree tdecl = t; if (GET_CODE (x) == SUBREG) { gcc_assert (subreg_lowpart_p (x)); @@ -1241,7 +1245,9 @@ set_reg_attrs_for_decl_rtl (tree t, rtx x) if (REG_P (x)) REG_ATTRS (x) = get_reg_attrs (t, byte_lowpart_offset (GET_MODE (x), - DECL_MODE (t))); + DECL_P (tdecl) + ? DECL_MODE (tdecl) + : TYPE_MODE (TREE_TYPE (tdecl)))); if (GET_CODE (x) == CONCAT) { if (REG_P (XEXP (x, 0))) |