public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "hjl.tools at gmail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug debug/106746] [13 Regression] '-fcompare-debug' failure (length) with -O2 -fsched2-use-superblocks since r13-2041-g6624ad73064de241
Date: Thu, 01 Sep 2022 17:01:50 +0000	[thread overview]
Message-ID: <bug-106746-4-DYYGyUvaTD@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-106746-4@http.gcc.gnu.org/bugzilla/>

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

H.J. Lu <hjl.tools at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |richard.sandiford at arm dot com,
                   |                            |roger at nextmovesoftware dot com,
                   |                            |segher at kernel dot crashing.org

--- Comment #6 from H.J. Lu <hjl.tools at gmail dot com> ---
Revert

diff --git a/gcc/simplify-rtx.cc b/gcc/simplify-rtx.cc
index fa20665bb01..7d09bf7103d 100644
--- a/gcc/simplify-rtx.cc
+++ b/gcc/simplify-rtx.cc
@@ -1615,6 +1639,24 @@ simplify_context::simplify_unary_operation_1 (rtx_code
co
de, machine_mode mode,
            }
        }

+      /* We can canonicalize SIGN_EXTEND (op) as ZERO_EXTEND (op) when
+         we know the sign bit of OP must be clear.  */
+      if (val_signbit_known_clear_p (GET_MODE (op),
+                                    nonzero_bits (op, GET_MODE (op))))
+       return simplify_gen_unary (ZERO_EXTEND, mode, op, GET_MODE (op));
+
+      /* (sign_extend:DI (subreg:SI (ctz:DI ...))) is (ctz:DI ...).  */
+      if (GET_CODE (op) == SUBREG
+         && subreg_lowpart_p (op)
+         && GET_MODE (SUBREG_REG (op)) == mode
+         && is_a <scalar_int_mode> (mode, &int_mode)
+         && is_a <scalar_int_mode> (GET_MODE (op), &op_mode)
+         && GET_MODE_PRECISION (int_mode) <= HOST_BITS_PER_WIDE_INT
+         && GET_MODE_PRECISION (op_mode) < GET_MODE_PRECISION (int_mode)
+         && (nonzero_bits (SUBREG_REG (op), mode)
+             & ~(GET_MODE_MASK (op_mode) >> 1)) == 0)
+       return SUBREG_REG (op);
+
 #if defined(POINTERS_EXTEND_UNSIGNED)
       /* As we do not know which address space the pointer is referring to,
         we can do this only if the target does not support different pointer

fixes the failure.

  parent reply	other threads:[~2022-09-01 17:01 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-26  5:41 [Bug debug/106746] New: [13 Regression] '-fcompare-debug' failure (length) with -O2 -fsched2-use-superblocks zsojka at seznam dot cz
2022-08-26  6:20 ` [Bug debug/106746] " rguenth at gcc dot gnu.org
2022-08-26 12:42 ` [Bug debug/106746] [13 Regression] '-fcompare-debug' failure (length) with -O2 -fsched2-use-superblocks since r13-2041-g6624ad73064de241 marxin at gcc dot gnu.org
2022-08-27  2:33 ` hjl.tools at gmail dot com
2022-08-30 15:48 ` hjl.tools at gmail dot com
2022-09-01  0:06 ` hjl.tools at gmail dot com
2022-09-01 14:52 ` hjl.tools at gmail dot com
2022-09-01 17:01 ` hjl.tools at gmail dot com [this message]
2022-09-01 23:55 ` hjl.tools at gmail dot com
2022-09-02 17:05 ` roger at nextmovesoftware dot com
2022-09-02 17:09 ` hjl.tools at gmail dot com
2022-10-19  7:06 ` rguenth at gcc dot gnu.org
2022-12-01 11:48 ` jakub at gcc dot gnu.org
2022-12-01 12:02 ` jakub at gcc dot gnu.org
2022-12-01 14:35 ` segher at gcc dot gnu.org
2022-12-01 14:42 ` jakub at gcc dot gnu.org
2022-12-01 15:07 ` segher at gcc dot gnu.org
2023-01-14  5:39 ` aoliva at gcc dot gnu.org
2023-01-14  8:29 ` aoliva at gcc dot gnu.org
2023-01-14  8:59 ` jakub at gcc dot gnu.org
2023-01-19  4:12 ` cvs-commit at gcc dot gnu.org
2023-01-19  4:18 ` aoliva at gcc dot gnu.org
2023-01-19 10:56 ` segher at gcc dot gnu.org
2023-01-20 18:42 ` jsm28 at gcc dot gnu.org
2023-01-30 17:49 ` jakub at gcc dot gnu.org
2023-01-30 17:58 ` segher at gcc dot gnu.org
2023-01-30 18:01 ` jakub at gcc dot gnu.org
2023-01-30 18:01 ` jakub at gcc dot gnu.org
2023-02-02 12:56 ` cvs-commit at gcc dot gnu.org
2023-02-02 12:57 ` 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-106746-4-DYYGyUvaTD@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).