aboutsummaryrefslogtreecommitdiff
path: root/gcc/stor-layout.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2016-08-07 11:49:14 +0200
committerJakub Jelinek <jakub@gcc.gnu.org>2016-08-07 11:49:14 +0200
commit4a9f8a9f7c5a75c266bba5be0c08071d18ed23c6 (patch)
tree2d410bd345f7b2e9308e2a8de2908598f470c7c3 /gcc/stor-layout.c
parent47e0b45f626798ceb75fac2c0ffd1d3e0b8baead (diff)
downloadgcc-4a9f8a9f7c5a75c266bba5be0c08071d18ed23c6.zip
gcc-4a9f8a9f7c5a75c266bba5be0c08071d18ed23c6.tar.gz
gcc-4a9f8a9f7c5a75c266bba5be0c08071d18ed23c6.tar.bz2
re PR c/72816 (ICE on x86_64-linux-gnu (tree check: expected tree that contains ‘decl with RTL’ structure, have ‘field_decl’ in set_decl_rtl, at emit-rtl.c:1282))
PR c/72816 * stor-layout.c (layout_decl): Fix up formatting. (relayout_decl): Allow DECL to be FIELD_DECL. * gcc.dg/pr72816.c: New test. From-SVN: r239218
Diffstat (limited to 'gcc/stor-layout.c')
-rw-r--r--gcc/stor-layout.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/gcc/stor-layout.c b/gcc/stor-layout.c
index 242e79b..62ab804 100644
--- a/gcc/stor-layout.c
+++ b/gcc/stor-layout.c
@@ -596,7 +596,7 @@ layout_decl (tree decl, unsigned int known_align)
return;
gcc_assert (code == VAR_DECL || code == PARM_DECL || code == RESULT_DECL
- || code == TYPE_DECL ||code == FIELD_DECL);
+ || code == TYPE_DECL || code == FIELD_DECL);
rtl = DECL_RTL_IF_SET (decl);
@@ -768,8 +768,8 @@ layout_decl (tree decl, unsigned int known_align)
}
}
-/* Given a VAR_DECL, PARM_DECL or RESULT_DECL, clears the results of
- a previous call to layout_decl and calls it again. */
+/* Given a VAR_DECL, PARM_DECL, RESULT_DECL, or FIELD_DECL, clears the
+ results of a previous call to layout_decl and calls it again. */
void
relayout_decl (tree decl)
@@ -778,7 +778,8 @@ relayout_decl (tree decl)
DECL_MODE (decl) = VOIDmode;
if (!DECL_USER_ALIGN (decl))
SET_DECL_ALIGN (decl, 0);
- SET_DECL_RTL (decl, 0);
+ if (DECL_RTL_SET_P (decl))
+ SET_DECL_RTL (decl, 0);
layout_decl (decl, 0);
}