Commit 6f8f67e9 by Jakub Jelinek Committed by Jakub Jelinek

re PR c/54363 (ICE when compiling malformed struct initializers)

	PR c/54363
	* gimplify.c (optimize_compound_literals_in_ctor): Only recurse
	if init is a CONSTRUCTOR.

	* gcc.dg/pr54363.c: New test.

From-SVN: r190657
parent 6265d07c
2012-08-24 Jakub Jelinek <jakub@redhat.com>
PR c/54363
* gimplify.c (optimize_compound_literals_in_ctor): Only recurse
if init is a CONSTRUCTOR.
2012-08-24 Steven Bosscher <steven@gcc.gnu.org>
* tree-ssa-live.c (dump_var_map): Do not dump the partition
......
......@@ -3857,7 +3857,8 @@ optimize_compound_literals_in_ctor (tree orig_ctor)
if (!TREE_ADDRESSABLE (value)
&& !TREE_ADDRESSABLE (decl)
&& init)
&& init
&& TREE_CODE (init) == CONSTRUCTOR)
newval = optimize_compound_literals_in_ctor (init);
}
if (newval == value)
......
2012-08-24 Jakub Jelinek <jakub@redhat.com>
PR c/54363
* gcc.dg/pr54363.c: New test.
PR c/54355
* gcc.dg/pr54355.c: New test.
......
/* PR c/54363 */
/* { dg-do compile } */
/* { dg-options "-std=gnu99" } */
struct S { char **a; };
void
test (void)
{
struct S b = { .a = (char **) { "a", "b" } }; /* { dg-warning "(initialization|excess elements)" } */
struct S c = { .a = (char *[]) { "a", "b" } };
}
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