public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "jakub at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug target/93353] ICE: in final_scan_insn_1, at final.c:3073 (error: could not split insn)
Date: Sat, 27 Feb 2021 09:02:17 +0000	[thread overview]
Message-ID: <bug-93353-4-OR2eEAr0KD@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-93353-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #7 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
And to explain what was happening,
rs6000_legitimize_address has been called on x
(plus:SI (reg/f:SI 117)
    (const_int 2147483647 [0x7fffffff]))
and mode QImode, oldx == x.
((0x7fffffff & 0xffff) ^ 0x8000) - 0x8000
is low_int -1 and
      if (low_int >= 0x8000 - extra)
is not true and 0x7fffffff - -1 is 0x80000000 (with UB on the compiler side).
So maybe the above mentioned commit wasn't sufficient and
we should
-      high_int = INTVAL (XEXP (x, 1)) - low_int;
+      high_int = UINTVAL (XEXP (x, 1)) - low_int;
But also
      && ((unsigned HOST_WIDE_INT) (INTVAL (XEXP (x, 1)) + 0x8000)
can invoke UB in the compiler, shouldn't it be just
      && ((UINTVAL (XEXP (x, 1)) + 0x8000)
?

  parent reply	other threads:[~2021-02-27  9:02 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <bug-93353-4@http.gcc.gnu.org/bugzilla/>
2021-02-26  9:34 ` andrew.goodbody at linaro dot org
2021-02-26  9:43 ` andrew.goodbody at linaro dot org
2021-02-26  9:46 ` andrew.goodbody at linaro dot org
2021-02-27  0:21 ` segher at gcc dot gnu.org
2021-02-27  5:28 ` asolokha at gmx dot com
2021-02-27  8:54 ` jakub at gcc dot gnu.org
2021-02-27  9:02 ` jakub at gcc dot gnu.org [this message]
2021-02-27 20:48 ` segher at gcc dot gnu.org
2021-02-27 20:56 ` segher at gcc dot gnu.org
2024-03-23 23:17 ` pinskia 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-93353-4-OR2eEAr0KD@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).