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/113396] [13/14 Regression] csmith: differences from -O2 to -O3 since r13-1268-g8c99e307b20c50
Date: Tue, 19 Mar 2024 14:25:11 +0000	[thread overview]
Message-ID: <bug-113396-4-LZg4u0CL5V@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-113396-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #31 from Richard Biener <rguenth at gcc dot gnu.org> ---
diff --git a/gcc/tree-dfa.cc b/gcc/tree-dfa.cc
index cbd3774b21f..1dbd9bd7a00 100644
--- a/gcc/tree-dfa.cc
+++ b/gcc/tree-dfa.cc
@@ -549,7 +549,8 @@ get_ref_base_and_extent (tree exp, poly_int64 *poffset,
                    /* Try to constrain maxsize with range information.  */
                    offset_int omax
                      = offset_int::from (max, TYPE_SIGN (TREE_TYPE (index)));
-                   if (known_lt (lbound, omax))
+                   if (wi::get_precision (max) < ADDR_MAX_PRECISION
+                       && known_lt (lbound, omax))
                      {
                        poly_offset_int rmaxsize;
                        rmaxsize = (omax - lbound + 1)
@@ -567,7 +568,8 @@ get_ref_base_and_extent (tree exp, poly_int64 *poffset,
                    /* Try to adjust bit_offset with range information.  */
                    offset_int omin
                      = offset_int::from (min, TYPE_SIGN (TREE_TYPE (index)));
-                   if (known_le (lbound, omin))
+                   if (wi::get_precision (min) < ADDR_MAX_PRECISION
+                       && known_le (lbound, omin))
                      {
                        poly_offset_int woffset
                          = wi::sext (omin - lbound,


fixes the testcase but I'm not 100% sure the condition is correct.  We
possibly need to cover for the << LOG2_BITS_PER_UNIT done, so maybe
using ADDR_MAX_BITSIZE is better.  I'm going to test a variant with
using <= ADDR_MAX_BITSIZE.

  parent reply	other threads:[~2024-03-19 14:25 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-15 11:53 [Bug c/113396] New: csmith: differences from -O2 to -O3 dcb314 at hotmail dot com
2024-01-15 12:16 ` [Bug c/113396] " dcb314 at hotmail dot com
2024-01-15 19:14 ` dcb314 at hotmail dot com
2024-01-15 19:15 ` dcb314 at hotmail dot com
2024-01-15 22:34 ` [Bug middle-end/113396] [13/14 Regression] " pinskia at gcc dot gnu.org
2024-01-16  8:46 ` dcb314 at hotmail dot com
2024-01-16  9:30 ` dcb314 at hotmail dot com
2024-01-16  9:48 ` dcb314 at hotmail dot com
2024-01-16 10:22 ` dcb314 at hotmail dot com
2024-01-16 10:30 ` dcb314 at hotmail dot com
2024-01-17 17:28 ` jakub at gcc dot gnu.org
2024-01-17 17:32 ` dcb314 at hotmail dot com
2024-03-15 15:02 ` law at gcc dot gnu.org
2024-03-15 15:55 ` rguenth at gcc dot gnu.org
2024-03-15 15:58 ` rguenth at gcc dot gnu.org
2024-03-15 16:47 ` dcb314 at hotmail dot com
2024-03-15 16:57 ` jakub at gcc dot gnu.org
2024-03-15 17:15 ` dcb314 at hotmail dot com
2024-03-15 17:21 ` dcb314 at hotmail dot com
2024-03-15 21:07 ` dcb314 at hotmail dot com
2024-03-16 16:56 ` dcb314 at hotmail dot com
2024-03-16 18:33 ` dcb314 at hotmail dot com
2024-03-18  5:56 ` sjames at gcc dot gnu.org
2024-03-19  3:47 ` sjames at gcc dot gnu.org
2024-03-19  5:01 ` pinskia at gcc dot gnu.org
2024-03-19  5:16 ` pinskia at gcc dot gnu.org
2024-03-19  5:30 ` pinskia at gcc dot gnu.org
2024-03-19  5:30 ` pinskia at gcc dot gnu.org
2024-03-19  5:39 ` pinskia at gcc dot gnu.org
2024-03-19  5:41 ` pinskia at gcc dot gnu.org
2024-03-19  6:21 ` sjames at gcc dot gnu.org
2024-03-19  7:32 ` [Bug middle-end/113396] [13/14 Regression] csmith: differences from -O2 to -O3 since r13-1268-g8c99e307b20c50 sjames at gcc dot gnu.org
2024-03-19 14:18 ` rguenth at gcc dot gnu.org
2024-03-19 14:25 ` rguenth at gcc dot gnu.org [this message]
2024-03-20  8:22 ` cvs-commit at gcc dot gnu.org
2024-03-20  8:22 ` [Bug middle-end/113396] [13 " rguenth at gcc dot gnu.org
2024-05-08 11:49 ` cvs-commit at gcc dot gnu.org
2024-05-08 11:50 ` 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-113396-4-LZg4u0CL5V@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).