gsi_next (gsi_p);
}
+ tree lab;
/* Remember the last statement. Skip labels that are of no interest
to us. */
if (gimple_code (gsi_stmt (*gsi_p)) == GIMPLE_LABEL)
;
else if (flag_auto_var_init > AUTO_INIT_UNINITIALIZED
&& gimple_code (gsi_stmt (*gsi_p)) == GIMPLE_GOTO
- && VACUOUS_INIT_LABEL_P (gimple_goto_dest (gsi_stmt (*gsi_p))))
+ && (lab = gimple_goto_dest (gsi_stmt (*gsi_p)))
+ && TREE_CODE (lab) == LABEL_DECL
+ && VACUOUS_INIT_LABEL_P (lab))
;
else if (!is_gimple_debug (gsi_stmt (*gsi_p)))
prev = gsi_stmt (*gsi_p);
gimple_stmt_iterator gsi2 = *gsi_p;
stmt = gsi_stmt (gsi2);
+ tree lab;
if (flag_auto_var_init > AUTO_INIT_UNINITIALIZED
&& gimple_code (stmt) == GIMPLE_GOTO
- && VACUOUS_INIT_LABEL_P (gimple_goto_dest (stmt)))
+ && (lab = gimple_goto_dest (stmt))
+ && TREE_CODE (lab) == LABEL_DECL
+ && VACUOUS_INIT_LABEL_P (lab))
{
/* Handle for C++ artificial -ftrivial-auto-var-init=
sequences. Those look like:
--- /dev/null
+/* PR middle-end/122773 */
+/* { dg-do compile } */
+/* { dg-options "-Wimplicit-fallthrough -O2 -ftrivial-auto-var-init=zero" } */
+
+void *l;
+int
+foo (int x)
+{
+ __label__ l1, l2, l3;
+ static void *l[] = { &&l1, &&l2, &&l3 };
+ switch (0)
+ {
+ case 0:
+ while (0)
+ ;
+ goto *l[x];
+ }
+ l1:
+ ++x;
+ l2:
+ ++x;
+ l3:
+ ++x;
+ return x;
+}