@@ -280,7 +280,13 @@ c_parser_parse_gimple_body (c_parser *cparser, char *gimple_pass,
for (tree var = BIND_EXPR_VARS (stmt); var; var = DECL_CHAIN (var))
if (VAR_P (var)
&& !DECL_EXTERNAL (var))
- add_local_decl (cfun, var);
+ {
+ add_local_decl (cfun, var);
+ /* When the middle-end re-gimplifies any expression we might
+ run into the assertion that we've seen the decl in a BIND. */
+ if (!TREE_STATIC (var))
+ DECL_SEEN_IN_BIND_EXPR_P (var) = 1;
+ }
/* We have a CFG. Build the edges. */
for (unsigned i = 0; i < parser.edges.length (); ++i)
{
new file mode 100644
@@ -0,0 +1,21 @@
+/* { dg-do compile } */
+/* { dg-options "-fgimple -fsanitize=undefined" } */
+
+int __GIMPLE(ssa) foo(int j)
+{
+ int c[1][10][1];
+ int _1;
+
+__BB(2):
+ c[0][1][0] = 1;
+ c[0][1] = _Literal (int[1]) {};
+ _1 = c[0][j_2(D)][0];
+ return _1;
+}
+
+int main()
+{
+ if (foo (1) != 0)
+ __builtin_abort ();
+ return 0;
+}