Commit 19dbbf36 by Jakub Jelinek Committed by Jakub Jelinek

re PR middle-end/22028 (ICE after invalid struct declaration)

	PR middle-end/22028
	* gimplify.c (gimplify_type_sizes): Check for type == error_mark_node
	earlier in the function.

	* gcc.dg/20050620-1.c: New test.

From-SVN: r101332
parent 7a1df4e2
2005-06-26 Jakub Jelinek <jakub@redhat.com>
PR middle-end/22028
* gimplify.c (gimplify_type_sizes): Check for type == error_mark_node
earlier in the function.
* regrename.c (copy_value): Don't replace fixed or global
regs with older regs.
......
......@@ -4524,15 +4524,14 @@ gimplify_type_sizes (tree type, tree *list_p)
{
tree field, t;
if (type == NULL)
if (type == NULL || type == error_mark_node)
return;
/* We first do the main variant, then copy into any other variants. */
type = TYPE_MAIN_VARIANT (type);
/* Avoid infinite recursion. */
if (TYPE_SIZES_GIMPLIFIED (type)
|| type == error_mark_node)
if (TYPE_SIZES_GIMPLIFIED (type))
return;
TYPE_SIZES_GIMPLIFIED (type) = 1;
......
2005-06-26 Jakub Jelinek <jakub@redhat.com>
PR middle-end/22028
* gcc.dg/20050620-1.c: New test.
2005-06-26 Kazu Hirata <kazu@codesourcery.com>
PR tree-optimization/22026
......
/* PR middle-end/22028 */
/* { dg-do compile } */
/* { dg-options "" } */
void
foo (void)
{
struct { int i[]; } u; /* { dg-error "flexible array member" } */
}
void
bar (void)
{
struct { struct a b; } c; /* { dg-error "has incomplete type" } */
}
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