public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "cvs-commit at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug middle-end/114753] from_chars aborts with -m32 -ftrapv when passed -9223372036854775808
Date: Sun, 21 Apr 2024 04:09:39 +0000	[thread overview]
Message-ID: <bug-114753-4-jfy8pPfRt4@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-114753-4@http.gcc.gnu.org/bugzilla/>

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114753

--- Comment #10 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-13 branch has been updated by Jakub Jelinek
<jakub@gcc.gnu.org>:

https://gcc.gnu.org/g:10f689596ad1633f4f5de1852c8f82a993fe948e

commit r13-8635-g10f689596ad1633f4f5de1852c8f82a993fe948e
Author: Jakub Jelinek <jakub@redhat.com>
Date:   Thu Apr 18 09:45:14 2024 +0200

    internal-fn: Temporarily disable flag_trapv during .{ADD,SUB,MUL}_OVERFLOW
etc. expansion [PR114753]

    __builtin_{add,sub,mul}_overflow{,_p} builtins are well defined
    for all inputs even for -ftrapv, and the -fsanitize=signed-integer-overflow
    ifns shouldn't abort in libgcc but emit the desired ubsan diagnostics
    or abort depending on -fsanitize* setting regardless of -ftrapv.
    The expansion of these internal functions uses expand_expr* in various
    places (e.g. MULT_EXPR at least in 2 spots), so temporarily disabling
    flag_trapv in all those spots would be hard.
    The following patch disables it around the bodies of 3 functions
    which can do the expand_expr calls.
    If it was in the C++ FE, I'd use some RAII sentinel, but I don't think
    we have one in the middle-end.

    2024-04-18  Jakub Jelinek  <jakub@redhat.com>

            PR middle-end/114753
            * internal-fn.cc (expand_mul_overflow): Save flag_trapv and
            temporarily clear it for the duration of the function, then
            restore previous value.
            (expand_vector_ubsan_overflow): Likewise.
            (expand_arith_overflow): Likewise.

            * gcc.dg/pr114753.c: New test.

    (cherry picked from commit 6c152c9db3b5b9d43e12846fb7a44977c0b65fc2)

  parent reply	other threads:[~2024-04-21  4:09 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-17 10:30 [Bug c++/114753] New: " gnu.ojxq8 at dralias dot com
2024-04-17 10:45 ` [Bug c++/114753] " redi at gcc dot gnu.org
2024-04-17 10:49 ` redi at gcc dot gnu.org
2024-04-17 10:56 ` [Bug middle-end/114753] " rguenth at gcc dot gnu.org
2024-04-17 11:00 ` rguenth at gcc dot gnu.org
2024-04-17 11:30 ` jakub at gcc dot gnu.org
2024-04-17 12:00 ` jakub at gcc dot gnu.org
2024-04-18  7:45 ` cvs-commit at gcc dot gnu.org
2024-04-18  7:51 ` jakub at gcc dot gnu.org
2024-04-19 16:16 ` cvs-commit at gcc dot gnu.org
2024-04-21  4:09 ` cvs-commit at gcc dot gnu.org [this message]
2024-04-23  6:43 ` jakub at gcc dot gnu.org

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=bug-114753-4-jfy8pPfRt4@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@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).