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 tree-optimization/105368] [10/11/12 Regression] ICE: SIGSEGV in powi_lookup_cost (tree-ssa-math-opts.cc:1441) with -Ofast and __builtin_powf() Date: Mon, 25 Apr 2022 08:54:58 +0000 [thread overview] Message-ID: <bug-105368-4-5tVerfr8nQ@http.gcc.gnu.org/bugzilla/> (raw) In-Reply-To: <bug-105368-4@http.gcc.gnu.org/bugzilla/> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105368 Richard Biener <rguenth at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Last reconfirmed| |2022-04-25 Status|UNCONFIRMED |ASSIGNED Assignee|unassigned at gcc dot gnu.org |rguenth at gcc dot gnu.org Ever confirmed|0 |1 --- Comment #4 from Richard Biener <rguenth at gcc dot gnu.org> --- (In reply to Zdenek Sojka from comment #3) > I think the issue might be in the: > > > 1463 > > 1464 /* Ignore the reciprocal when calculating the cost. */ > > 1465 val = (n < 0) ? -n : n; > > expression, for the case n == LONG_MIN, but I am not a language lawyer. (-n > is not representable in the (promoted) signed type) Ah, good point. diff --git a/gcc/tree-ssa-math-opts.cc b/gcc/tree-ssa-math-opts.cc index 102b7a2cc99..7555793948e 100644 --- a/gcc/tree-ssa-math-opts.cc +++ b/gcc/tree-ssa-math-opts.cc @@ -1462,7 +1462,7 @@ powi_cost (HOST_WIDE_INT n) return 0; /* Ignore the reciprocal when calculating the cost. */ - val = (n < 0) ? -n : n; + val = absu_hwi (n); /* Initialize the exponent cache. */ memset (cache, 0, POWI_TABLE_SIZE * sizeof (bool)); should fix that.
next prev parent reply other threads:[~2022-04-25 8:54 UTC|newest] Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top 2022-04-24 19:07 [Bug tree-optimization/105368] New: " zsojka at seznam dot cz 2022-04-25 7:08 ` [Bug tree-optimization/105368] " rguenth at gcc dot gnu.org 2022-04-25 8:06 ` zsojka at seznam dot cz 2022-04-25 8:46 ` zsojka at seznam dot cz 2022-04-25 8:54 ` rguenth at gcc dot gnu.org [this message] 2022-04-25 8:55 ` pinskia at gcc dot gnu.org 2022-04-25 9:47 ` cvs-commit at gcc dot gnu.org 2022-04-25 10:00 ` zsojka at seznam dot cz 2022-04-25 10:31 ` [Bug tree-optimization/105368] [10/11 " rguenth at gcc dot gnu.org 2022-04-25 10:32 ` rguenth at gcc dot gnu.org 2022-05-19 14:03 ` cvs-commit at gcc dot gnu.org 2022-05-27 13:15 ` [Bug tree-optimization/105368] [10 " cvs-commit at gcc dot gnu.org 2022-05-27 13:17 ` rguenth 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-105368-4-5tVerfr8nQ@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: linkBe 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).