On 9/29/2021 2:05 AM, Jakub Jelinek wrote:
On Mon, Sep 20, 2021 at 09:41:03AM -0600, Jeff Law via Gcc-patches wrote:
On 9/19/2021 10:14 PM, apinski--- via Gcc-patches wrote:
From: Andrew Pinski <apin...@marvell.com>
So GCC has always accepted non-pointer types in computed gotos but
that was wrong based on the documentation:
Any expression of type void * is allowed.
So this fixes the problem by requiring the type to
be a pointer type.
OK? Bootstrapped and tested on x86_64-linux-gnu with no regressions.
PR c/32122
gcc/c/ChangeLog:
* c-parser.c (c_parser_statement_after_labels): Pass
the c_expr instead of the tree to c_finish_goto_ptr.
* c-typeck.c (c_finish_goto_ptr): Change the second
argument type to c_expr.
* c-tree.h (c_finish_goto_ptr): Likewise.
Error out if the expression was not of a pointer type.
gcc/testsuite/ChangeLog:
* gcc.dg/comp-goto-5.c: New test.
* gcc.dg/comp-goto-6.c: New test.
OK
This change regressed:
+FAIL: gcc.c-torture/compile/920826-1.c -O0 (test for excess errors)
+FAIL: gcc.c-torture/compile/920826-1.c -O1 (test for excess errors)
+FAIL: gcc.c-torture/compile/920826-1.c -O2 (test for excess errors)
+FAIL: gcc.c-torture/compile/920826-1.c -O2 -flto -fno-use-linker-plugin
-flto-partition=none (test for excess errors)
+FAIL: gcc.c-torture/compile/920826-1.c -O2 -flto -fuse-linker-plugin
-fno-fat-lto-objects (test for excess errors)
+FAIL: gcc.c-torture/compile/920826-1.c -O3 -g (test for excess errors)
+FAIL: gcc.c-torture/compile/920826-1.c -Os (test for excess errors)
+FAIL: gcc.c-torture/compile/920831-1.c -O0 (test for excess errors)
+FAIL: gcc.c-torture/compile/920831-1.c -O1 (test for excess errors)
+FAIL: gcc.c-torture/compile/920831-1.c -O2 (test for excess errors)
+FAIL: gcc.c-torture/compile/920831-1.c -O2 -flto -fno-use-linker-plugin
-flto-partition=none (test for excess errors)
+FAIL: gcc.c-torture/compile/920831-1.c -O2 -flto -fuse-linker-plugin
-fno-fat-lto-objects (test for excess errors)
+FAIL: gcc.c-torture/compile/920831-1.c -O3 -g (test for excess errors)
+FAIL: gcc.c-torture/compile/920831-1.c -Os (test for excess errors)
+FAIL: gcc.c-torture/compile/pr27863.c -O0 (test for excess errors)
+FAIL: gcc.c-torture/compile/pr27863.c -O1 (test for excess errors)
+FAIL: gcc.c-torture/compile/pr27863.c -O2 (test for excess errors)
+FAIL: gcc.c-torture/compile/pr27863.c -O2 -flto -fno-use-linker-plugin
-flto-partition=none (test for excess errors)
+FAIL: gcc.c-torture/compile/pr27863.c -O2 -flto -fuse-linker-plugin
-fno-fat-lto-objects (test for excess errors)
+FAIL: gcc.c-torture/compile/pr27863.c -O3 -g (test for excess errors)
+FAIL: gcc.c-torture/compile/pr27863.c -Os (test for excess errors)
+FAIL: gcc.c-torture/compile/pr70190.c -O0 (test for excess errors)
+FAIL: gcc.c-torture/compile/pr70190.c -O1 (test for excess errors)
+FAIL: gcc.c-torture/compile/pr70190.c -O2 (test for excess errors)
+FAIL: gcc.c-torture/compile/pr70190.c -O2 -flto -fno-use-linker-plugin
-flto-partition=none (test for excess errors)
+FAIL: gcc.c-torture/compile/pr70190.c -O2 -flto -fuse-linker-plugin
-fno-fat-lto-objects (test for excess errors)
+FAIL: gcc.c-torture/compile/pr70190.c -O3 -g (test for excess errors)
+FAIL: gcc.c-torture/compile/pr70190.c -Os (test for excess errors)
+FAIL: gcc.dg/torture/pr89135.c -O0 (test for excess errors)
+FAIL: gcc.dg/torture/pr89135.c -O1 (test for excess errors)
+FAIL: gcc.dg/torture/pr89135.c -O2 (test for excess errors)
+FAIL: gcc.dg/torture/pr89135.c -O2 -flto -fno-use-linker-plugin
-flto-partition=none (test for excess errors)
+FAIL: gcc.dg/torture/pr89135.c -O2 -flto -fuse-linker-plugin
-fno-fat-lto-objects (test for excess errors)
+FAIL: gcc.dg/torture/pr89135.c -O3 -fomit-frame-pointer -funroll-loops
-fpeel-loops -ftracer -finline-functions (test for excess errors)
+FAIL: gcc.dg/torture/pr89135.c -O3 -g (test for excess errors)
+FAIL: gcc.dg/torture/pr89135.c -Os (test for excess errors)
+FAIL: gcc.dg/torture/pr90071.c -O0 (test for excess errors)
+FAIL: gcc.dg/torture/pr90071.c -O1 (test for excess errors)
+FAIL: gcc.dg/torture/pr90071.c -O2 (test for excess errors)
+FAIL: gcc.dg/torture/pr90071.c -O2 -flto -fno-use-linker-plugin
-flto-partition=none (test for excess errors)
+FAIL: gcc.dg/torture/pr90071.c -O2 -flto -fuse-linker-plugin
-fno-fat-lto-objects (test for excess errors)
+FAIL: gcc.dg/torture/pr90071.c -O3 -fomit-frame-pointer -funroll-loops
-fpeel-loops -ftracer -finline-functions (test for excess errors)
+FAIL: gcc.dg/torture/pr90071.c -O3 -g (test for excess errors)
+FAIL: gcc.dg/torture/pr90071.c -Os (test for excess errors)
And on a ton of embedded targets....
jeff