public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "rguenth 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: Wed, 17 Apr 2024 11:00:01 +0000	[thread overview]
Message-ID: <bug-114753-4-LhikVYNeqH@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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jakub at gcc dot gnu.org

--- Comment #4 from Richard Biener <rguenth at gcc dot gnu.org> ---
#0  expand_binop (mode=E_DImode, binoptab=smulv_optab, op0=0x7ffff71b53f0, 
    op1=0x7ffff71b85a0, target=0x0, unsignedp=0, methods=OPTAB_LIB_WIDEN)
    at /space/rguenther/src/gcc/gcc/optabs.cc:1497
#1  0x000000000116edf5 in expand_mult (mode=E_DImode, op0=0x7ffff71b53f0, 
    op1=0x7ffff71b85a0, target=0x0, unsignedp=0, no_libcall=false)
    at /space/rguenther/src/gcc/gcc/expmed.cc:3610
#2  0x00000000011a38e0 in expand_expr_real_2 (ops=0x7fffffffcef0, target=0x0, 
    tmode=E_DImode, modifier=EXPAND_NORMAL)
    at /space/rguenther/src/gcc/gcc/expr.cc:10275
#3  0x0000000001359608 in expand_mul_overflow (loc=2147483653, 
    lhs=<ssa_name 0x7ffff7016ee8 6>, arg0=<nop_expr 0x7ffff7181aa0>, 
    arg1=<nop_expr 0x7ffff7181a80>, unsr_p=false, uns0_p=false, uns1_p=true, 
    is_ubsan=false, datap=0x0)
    at /space/rguenther/src/gcc/gcc/internal-fn.cc:2359
#4  0x000000000135b7f7 in expand_arith_overflow (code=MULT_EXPR, 
    stmt=<gimple_call 0x7ffff7019f30>)
    at /space/rguenther/src/gcc/gcc/internal-fn.cc:2827
#5  0x000000000135b9c3 in expand_MUL_OVERFLOW (stmt=0x7ffff7019f30)
    at /space/rguenther/src/gcc/gcc/internal-fn.cc:2876

so a hack would be to reset flag_trapv around

2354                 For unsigned multiplication when high parts are both
non-zero
2355                 this overflows always.  */
2356              ops.code = MULT_EXPR;
2357              ops.op0 = make_tree (type, op0);
2358              ops.op1 = make_tree (type, op1);
2359              tem = expand_expr_real_2 (&ops, NULL_RTX, mode,
EXPAND_NORMAL);

in expand_mul_overflow.

  parent reply	other threads:[~2024-04-17 11:00 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 [this message]
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
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-LhikVYNeqH@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).