From: Jakub Jelinek <jakub@redhat.com>
To: Jason Merrill <jason@redhat.com>
Cc: gcc-patches@gcc.gnu.org
Subject: Re: [PATCH RFA] ubsan: -Wreturn-type and ubsan trap-on-error
Date: Mon, 13 Jun 2022 22:03:16 +0200 [thread overview]
Message-ID: <YqeYBBSPrLM5pJw0@tucnak> (raw)
In-Reply-To: <20220613193823.3233868-1-jason@redhat.com>
On Mon, Jun 13, 2022 at 03:38:23PM -0400, Jason Merrill via Gcc-patches wrote:
> I noticed that -fsanitize=undefined -fsanitize-undefined-trap-on-error was
> omitting the usual -Wreturn-type warning for control flowing off the end of
> a function. This was because the warning code was looking for calls either
> to __builtin_unreachable or the UBSan function, but these flags produce a
> call to __builtin_trap instead.
>
> Tested x86_64-pc-linux-gnu, OK for trunk?
>
> gcc/c-family/ChangeLog:
>
> * c-ubsan.cc (ubsan_instrument_return): Use BUILTINS_LOCATION.
>
> gcc/ChangeLog:
>
> * tree-cfg.cc (pass_warn_function_return::execute): Also check
> BUILT_IN_TRAP.
>
> gcc/testsuite/ChangeLog:
>
> * g++.dg/ubsan/return-8.C: New test.
LGTM.
Jakub
prev parent reply other threads:[~2022-06-13 20:03 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-06-13 19:38 Jason Merrill
2022-06-13 20:03 ` Jakub Jelinek [this message]
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=YqeYBBSPrLM5pJw0@tucnak \
--to=jakub@redhat.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=jason@redhat.com \
/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).