Commit 4a9f8a9f by Jakub Jelinek Committed by Jakub Jelinek

re PR c/72816 (ICE on x86_64-linux-gnu (tree check: expected tree that contains…

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
parent 47e0b45f
2016-08-07 Jakub Jelinek <jakub@redhat.com>
PR c/72816
* stor-layout.c (layout_decl): Fix up formatting.
(relayout_decl): Allow DECL to be FIELD_DECL.
2016-08-07 Alan Modra <amodra@gmail.com> 2016-08-07 Alan Modra <amodra@gmail.com>
* config/rs6000/rs6000.md (fix_trunc<mode>si2): Fix mode of reg. * config/rs6000/rs6000.md (fix_trunc<mode>si2): Fix mode of reg.
......
...@@ -596,7 +596,7 @@ layout_decl (tree decl, unsigned int known_align) ...@@ -596,7 +596,7 @@ layout_decl (tree decl, unsigned int known_align)
return; return;
gcc_assert (code == VAR_DECL || code == PARM_DECL || code == RESULT_DECL 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); rtl = DECL_RTL_IF_SET (decl);
...@@ -768,8 +768,8 @@ layout_decl (tree decl, unsigned int known_align) ...@@ -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 /* Given a VAR_DECL, PARM_DECL, RESULT_DECL, or FIELD_DECL, clears the
a previous call to layout_decl and calls it again. */ results of a previous call to layout_decl and calls it again. */
void void
relayout_decl (tree decl) relayout_decl (tree decl)
...@@ -778,7 +778,8 @@ relayout_decl (tree decl) ...@@ -778,7 +778,8 @@ relayout_decl (tree decl)
DECL_MODE (decl) = VOIDmode; DECL_MODE (decl) = VOIDmode;
if (!DECL_USER_ALIGN (decl)) if (!DECL_USER_ALIGN (decl))
SET_DECL_ALIGN (decl, 0); 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); layout_decl (decl, 0);
} }
......
2016-08-07 Jakub Jelinek <jakub@redhat.com>
PR c/72816
* gcc.dg/pr72816.c: New test.
2016-08-06 Jonathan Wakely <jwakely@redhat.com> 2016-08-06 Jonathan Wakely <jwakely@redhat.com>
* g++.dg/conversion/pr16333.C: Adjust dg-error regexp. * g++.dg/conversion/pr16333.C: Adjust dg-error regexp.
......
/* PR c/72816 */
/* { dg-do compile } */
/* { dg-options "-std=gnu11" } */
typedef const int A[];
struct S {
int a;
A b; /* { dg-error "array size missing" } */
};
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment