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/105679] [12/13 Regression] extra -Warray-bounds warning added with -fsanitize=shift due to jump threading
Date: Fri, 29 Jul 2022 08:19:35 +0000	[thread overview]
Message-ID: <bug-105679-4-DXebGg6FGP@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-105679-4@http.gcc.gnu.org/bugzilla/>

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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
     Ever confirmed|0                           |1
   Last reconfirmed|                            |2022-07-29
             Status|UNCONFIRMED                 |ASSIGNED
           Assignee|unassigned at gcc dot gnu.org      |rguenth at gcc dot gnu.org

--- Comment #3 from Richard Biener <rguenth at gcc dot gnu.org> ---
Checking profitability of path (backwards):  bb:5 (2 insns) bb:4 (7 insns) bb:3
  Control statement insns: 2
  Overall: 7 insns
  [1] Registering jump thread: (3, 4) incoming edge;  (4, 5) normal (5, 6)
nocopy;
path: 3->4->5->6 SUCCESS

but from the following you can see BB3 is known to probably never execute.

;;   basic block 2, loop depth 0, count 1073741823 (estimated locally), maybe
hot
;;    prev block 9, next block 3, flags: (NEW, REACHABLE, VISITED)
;;    pred:       9 [always]  count:1073741823 (estimated locally)
(FALLTHRU,EXECUTABLE)
  if (irq_1(D) > 31)
    goto <bb 3>; [0.00%]
  else
    goto <bb 4>; [100.00%]

;;   basic block 3, loop depth 0, count 0 (precise), probably never executed
;;    prev block 2, next block 4, flags: (NEW, REACHABLE, VISITED)
;;    pred:       2 [never]  count:0 (precise) (TRUE_VALUE,EXECUTABLE)
  _2 = (unsigned long) irq_1(D);
  __builtin___ubsan_handle_shift_out_of_bounds (&*.Lubsan_data0, 1, _2);
;;    succ:       4 [never]  count:0 (precise) (FALLTHRU,EXECUTABLE)

;;   basic block 4, loop depth 0, count 1073741823 (estimated locally), maybe
hot
;;    prev block 3, next block 5, flags: (NEW, REACHABLE, VISITED)
;;    pred:       2 [always]  count:1073741823 (estimated locally)
(FALSE_VALUE,EXECUTABLE)
;;                3 [never]  count:0 (precise) (FALLTHRU,EXECUTABLE)
  _3 = 1 << irq_1(D);
  mask_4 = (u32) _3;
  entry = instance_5(D)->array[irq_1(D)];
  capture (mask_4);
  if (level_6(D) != 0)
    goto <bb 7>; [34.00%]
  else
    goto <bb 5>; [66.00%]
;;    succ:       7 [34.0% (guessed)]  count:365072224 (estimated locally)
(TRUE_VALUE,EXECUTABLE)
;;                5 [66.0% (guessed)]  count:708669599 (estimated locally)
(FALSE_VALUE,EXECUTABLE)

;;   basic block 5, loop depth 0, count 708669600 (estimated locally), maybe
hot
;;    prev block 4, next block 6, flags: (NEW, REACHABLE, VISITED)
;;    pred:       4 [66.0% (guessed)]  count:708669599 (estimated locally)
(FALSE_VALUE,EXECUTABLE)
  if (irq_1(D) == 1)
    goto <bb 7>; [20.97%]
  else
    goto <bb 6>; [79.03%]
;;    succ:       7 [21.0% (guessed)]  count:148608017 (estimated locally)
(TRUE_VALUE,EXECUTABLE)
;;                6 [79.0% (guessed)]  count:560061583 (estimated locally)
(FALSE_VALUE,EXECUTABLE)

  parent reply	other threads:[~2022-07-29  8:19 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-21  0:32 [Bug c/105679] New: erroneous -Warray-bounds warning with sanitizer kees at outflux dot net
2022-05-21  0:33 ` [Bug c/105679] " kees at outflux dot net
2022-05-21  1:02 ` [Bug tree-optimization/105679] " pinskia at gcc dot gnu.org
2022-05-23  6:50 ` [Bug tree-optimization/105679] [12/13 Regression] extra -Warray-bounds warning added with -fsanitize=shift due to jump threading rguenth at gcc dot gnu.org
2022-07-29  8:19 ` rguenth at gcc dot gnu.org [this message]
2022-07-29 10:06 ` cvs-commit at gcc dot gnu.org
2022-07-29 10:06 ` [Bug tree-optimization/105679] [12 " rguenth at gcc dot gnu.org
2022-07-30 23:50 ` kees at outflux dot net
2022-08-01  8:01 ` rguenth at gcc dot gnu.org
2022-08-02  6:35 ` rguenth at gcc dot gnu.org
2022-10-06 17:27 ` kees at outflux dot net
2022-10-07  6:57 ` rguenth at gcc dot gnu.org
2022-10-08  2:31 ` kees at outflux dot net
2023-05-08 12:24 ` 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-105679-4-DXebGg6FGP@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).