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
+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
 
 
          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.
 
 
--- /dev/null
+/* 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" } };
+}