public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "pinskia at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug target/113010] [RISCV] sign-extension lost in comparison with constant embedded in comma-op expression
Date: Tue, 09 Jan 2024 22:12:35 +0000	[thread overview]
Message-ID: <bug-113010-4-TEZOYUVnqI@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-113010-4@http.gcc.gnu.org/bugzilla/>

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
     Ever confirmed|0                           |1
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2024-01-09
   Target Milestone|---                         |13.3

--- Comment #5 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
(In reply to Andrew Pinski from comment #4)
> (In reply to Greg McGary from comment #3)
> > This fixes it, though I would like second look from someone more familiar
> > with the combiner:
> 
> I almost sure this is still an issue with WORD_REGISTER_OPERATIONS .

That is this is missing that check:

```
  /* Convert sign extension to zero extension, if we know that the high
     bit is not set, as this is easier to optimize.  It will be converted
     back to cheaper alternative in make_extraction.  */
  if (GET_CODE (x) == SIGN_EXTEND
      && HWI_COMPUTABLE_MODE_P (mode)
      && ((nonzero_bits (XEXP (x, 0), inner_mode)
           & ~(((unsigned HOST_WIDE_INT) GET_MODE_MASK (inner_mode)) >> 1))
          == 0))

```

Should most likely need the same check as what was added in r14-6806 . And yes
it a similar bug dealing with WORD_REGISTER_OPERATIONS  which is why I thought
it was the same.

  parent reply	other threads:[~2024-01-09 22:12 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-13 21:55 [Bug target/113010] New: " gkm at rivosinc dot com
2023-12-13 22:06 ` [Bug target/113010] " pinskia at gcc dot gnu.org
2024-01-04  1:55 ` patrick at rivosinc dot com
2024-01-09 21:56 ` gkm at rivosinc dot com
2024-01-09 22:05 ` pinskia at gcc dot gnu.org
2024-01-09 22:12 ` pinskia at gcc dot gnu.org [this message]
2024-01-09 22:12 ` pinskia at gcc dot gnu.org
2024-01-11  2:45 ` gkm at rivosinc dot com
2024-01-11  2:50 ` gkm at rivosinc dot com
2024-01-24 21:33 ` patrick at rivosinc dot com
2024-01-24 21:47 ` pinskia at gcc dot gnu.org
2024-03-03 21:50 ` cvs-commit at gcc dot gnu.org
2024-03-03 21:53 ` law at gcc dot gnu.org
2024-03-04 18:24 ` cvs-commit 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-113010-4-TEZOYUVnqI@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).