re PR middle-end/71494 (label as value in nested function)
authorJakub Jelinek <jakub@gcc.gnu.org>
Fri, 10 Jun 2016 19:49:05 +0000 (21:49 +0200)
committerJakub Jelinek <jakub@gcc.gnu.org>
Fri, 10 Jun 2016 19:49:05 +0000 (21:49 +0200)
PR middle-end/71494
* tree-nested.c (convert_nonlocal_reference_stmt): For GIMPLE_GOTO
without LABEL_DECL, set *handled_ops_p to false instead of true.

* gcc.c-torture/execute/pr71494.c: New test.

From-SVN: r237317

gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.c-torture/execute/pr71494.c [new file with mode: 0644]
gcc/tree-nested.c

index b4ce8dbaaaa704c91f824b1318f502b9de619028..0af20baea1fd94c178a38d7991f9255a9ca6f752 100644 (file)
@@ -1,3 +1,9 @@
+2016-06-10  Jakub Jelinek  <jakub@redhat.com>
+
+       PR middle-end/71494
+       * tree-nested.c (convert_nonlocal_reference_stmt): For GIMPLE_GOTO
+       without LABEL_DECL, set *handled_ops_p to false instead of true.
+
 2016-06-10  Martin Sebor  <msebor@redhat.com>
 
        PR c/71392
@@ -12,7 +18,7 @@
        (BUILT_IN_UADDL_OVERFLOW, BUILT_IN_UADDLL_OVERFLOW): Same.
        (BUILT_IN_USUB_OVERFLOW, BUILT_IN_USUBL_OVERFLOW): Same.
        (BUILT_IN_USUBLL_OVERFLOW, BUILT_IN_UMUL_OVERFLOW): Same.
-       (BUILT_IN_UMULL_OVERFLOW, BUILT_IN_UMULLL_OVERFLOW):
+       (BUILT_IN_UMULL_OVERFLOW, BUILT_IN_UMULLL_OVERFLOW): Same.
 
 2016-06-10  Bernd Edlinger  <bernd.edlinger@hotmail.de>
 
         sysroot/usr/lib/32api for additional win32 libraries,
         fixes failing Cygwin bootstrapping.
 
-2016-06-09  Marcin Baczyński <marbacz@gmail.com>
+2016-06-09  Marcin Baczyński  <marbacz@gmail.com>
 
        * diagnostic.h (diagnostic_line_cutoff, diagnostic_flush_buffer):
        delete.
        only edges out of BB are EH edges.
 
 2016-06-04  Martin Sebor  <msebor@redhat.com>
-           Marcin Baczyński <marbacz@gmail.com>
+           Marcin Baczyński  <marbacz@gmail.com>
 
        PR c/48116
        * doc/invoke.texi (-Wreturn-type): Mention not warning on return with
index cf9c24bb40e6426e74643ab9d913f7922aa13f7c..c35bcb69d5261249047d8b9aab67a0882ac262e2 100644 (file)
@@ -1,5 +1,8 @@
 2016-06-10  Jakub Jelinek  <jakub@redhat.com>
 
+       PR middle-end/71494
+       * gcc.c-torture/execute/pr71494.c: New test.
+
        PR c/68657
        * gcc.target/i386/pr68657.c: New test.
 
diff --git a/gcc/testsuite/gcc.c-torture/execute/pr71494.c b/gcc/testsuite/gcc.c-torture/execute/pr71494.c
new file mode 100644 (file)
index 0000000..f962f2c
--- /dev/null
@@ -0,0 +1,22 @@
+/* PR middle-end/71494 */
+
+int
+main ()
+{
+  void *label = &&out;
+  int i = 0;
+  void test (void)
+  {
+    label = &&out2;
+    goto *label;
+   out2:;
+    i++;
+  }
+  goto *label;
+ out:
+  i += 2;
+  test ();
+  if (i != 3)
+    __builtin_abort ();
+  return 0;
+}
index 6fc6326000061df1a71bed7797cf56ed7cfacfbe..812f619c05faef9149d422f7e5044fbb334649f5 100644 (file)
@@ -1347,7 +1347,7 @@ convert_nonlocal_reference_stmt (gimple_stmt_iterator *gsi, bool *handled_ops_p,
        {
          wi->val_only = true;
          wi->is_lhs = false;
-         *handled_ops_p = true;
+         *handled_ops_p = false;
          return NULL_TREE;
        }
       break;