From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-vk1-xa2e.google.com (mail-vk1-xa2e.google.com [IPv6:2607:f8b0:4864:20::a2e]) by sourceware.org (Postfix) with ESMTPS id 320D63858421 for ; Wed, 29 Sep 2021 08:08:39 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 320D63858421 Received: by mail-vk1-xa2e.google.com with SMTP id f73so749116vkf.6 for ; Wed, 29 Sep 2021 01:08:39 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=Ijv6mKlbIE5uEOECK73BksQ5/ws7AJ70z3KGAKUa1Ac=; b=f/eweF33XQhxScZ+12VYgytNo0KjrH7By4q3iu8SEHQtDoyKpdJkO1ZVgvJZ9FB503 0rR0mi8UxYcqw9BuHky2SKbCqXkB23/Ay035Xh4vzZAei6wL9qFZ4nNTeSNv4u/GfwZr BIo5+To/VvnJPFphWzgnxfz7xZdMfp7ml+rhfEdXxlSn7XcrjhkhaKNU9akC2wAERTGM dyECYb6HmPyYNlblvzpZfkYYCjgcVq+N8lcyWgkAegbWWSNpXRyexZB/GcFlqhIddC7i h1oJS6dM6/I2JMwVQeBYByU6mm2UZ82JXRNt8t3D4iG3d2ql2Q63RsisYzzBhH+j0crf zSXQ== X-Gm-Message-State: AOAM531N6lD9z88FahoJGg96rbvblTpltSmCjrV592wD+hq0MhHU8D3G BqKwIB74LzdRyzvrOoTCPbBJloIZMac4eU+wSfE= X-Google-Smtp-Source: ABdhPJw1BgL97duHxGpbrqAzqkFSZG6ziIn0lxqB62G1QGtqSLZioCLwQ6FOg3K2pd3l2yR9hcmN3MjPy1UxXSE8NAY= X-Received: by 2002:a1f:2ecb:: with SMTP id u194mr8511120vku.12.1632902918754; Wed, 29 Sep 2021 01:08:38 -0700 (PDT) MIME-Version: 1.0 References: <1632111261-18790-1-git-send-email-apinski@marvell.com> <6c94af85-7948-b498-73bb-e2b4f1500581@gmail.com> <20210929080555.GI304296@tucnak> In-Reply-To: <20210929080555.GI304296@tucnak> From: Andrew Pinski Date: Wed, 29 Sep 2021 01:08:27 -0700 Message-ID: Subject: Re: [PATCH] c: [PR32122] Require pointer types for computed gotos To: Jakub Jelinek Cc: Jeff Law , Andrew Pinski , GCC Patches Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Sep 2021 08:08:40 -0000 On Wed, Sep 29, 2021 at 1:06 AM Jakub Jelinek via Gcc-patches 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 > > > > > > 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) > on both x86_64-linux and i686-linux. I literally just pushed the testsuite fixes for this. Thanks, Andrew > > Jakub >