public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jeff Law <jeffreyalaw@gmail.com>
To: apinski@marvell.com, gcc-patches@gcc.gnu.org
Subject: Re: [PATCH] c: [PR32122] Require pointer types for computed gotos
Date: Mon, 20 Sep 2021 09:41:03 -0600	[thread overview]
Message-ID: <6c94af85-7948-b498-73bb-e2b4f1500581@gmail.com> (raw)
In-Reply-To: <1632111261-18790-1-git-send-email-apinski@marvell.com>



On 9/19/2021 10:14 PM, apinski--- via Gcc-patches wrote:
> From: Andrew Pinski <apinski@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
jeff


  reply	other threads:[~2021-09-20 15:41 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-20  4:14 apinski
2021-09-20 15:41 ` Jeff Law [this message]
2021-09-29  8:05   ` Jakub Jelinek
2021-09-29  8:08     ` Andrew Pinski
2021-09-29 13:40       ` Jeff Law
2021-09-29 13:39     ` Jeff Law
2021-10-01 11:02 ` Eric Gallager
2021-10-01 11:04   ` Andrew Pinski

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=6c94af85-7948-b498-73bb-e2b4f1500581@gmail.com \
    --to=jeffreyalaw@gmail.com \
    --cc=apinski@marvell.com \
    --cc=gcc-patches@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).