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/104986] [12 Regression] bogus writing 1 byte into a region of size 0 with -fwrapv and -O2 -fpeel-loops since r12-4698-gf6d012338bf87f42
Date: Wed, 23 Mar 2022 15:05:05 +0000	[thread overview]
Message-ID: <bug-104986-4-vtQPiCSHV5@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-104986-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #8 from Richard Biener <rguenth at gcc dot gnu.org> ---
(In reply to Andrew Macleod from comment #5)
> Looking at the strlen1 output, it only ever asks ranger about 6 names:
> 
> 334      range_of_expr(_36) at stmt _52 = iftmp.1_17 + _36;
>          TRUE : (334) range_of_expr (_36) sizetype [3, 5]
> maybe_invalidate called for *_52 = _60;
> maybe_invalidate returns 1
> 342      range_of_expr(_69) at stmt _71 = iftmp.1_7 + _69;
>          TRUE : (342) range_of_expr (_69) sizetype [3, 5]
> maybe_invalidate called for *_71 = _72;
> maybe_invalidate returns 1
> 348      range_of_expr(_6) at stmt _31 = iftmp.1_76 + _6;
>          TRUE : (348) range_of_expr (_6) sizetype [2, 4]
> maybe_invalidate called for *_31 = _32;
> maybe_invalidate returns 1
> 367      range_of_expr(_37) at stmt _39 = iftmp.1_76 + _37;
>          TRUE : (367) range_of_expr (_37) sizetype [1, 3]
> maybe_invalidate called for *_39 = _40;
>   statement may clobber object _31 0 bytes in size
>   
> maybe_invalidate returns 1
> 375      range_of_expr(_45) at stmt _47 = iftmp.1_76 + _45;
>          TRUE : (375) range_of_expr (_45) sizetype [0, 2]
> maybe_invalidate called for *_47 = _48;
>   statement may clobber object _39 0 bytes in size
> maybe_invalidate returns 1
> 383      range_of_expr(_53) at stmt _55 = iftmp.1_76 + _53;
>          TRUE : (383) range_of_expr (_53) sizetype [1, 1]

So maybe strlen can invoke ranger on GIMPLE_CONDs to mark unreachable
code on the fly?  IIRC domwalk has some ability to skip not executable
edges so if the walk makes sure to properly initialize that for
outgoing edges it might work in that it would refrain from
optimizing/diagnosing
in unreachable regions.

> Is there a reason it runs before vrp2?

Likely historical or the idea that VRP can do something with its results,
like propagate constants (but there's now a CCP pass after it).

  parent reply	other threads:[~2022-03-23 15:05 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-19 17:07 [Bug middle-end/104986] New: [12 Regression] bogus writing 1 byte into a region of size 0 with -fwrapv and -O2 -fpeel-loops andres at anarazel dot de
2022-03-21  8:53 ` [Bug middle-end/104986] " rguenth at gcc dot gnu.org
2022-03-21  9:31 ` [Bug middle-end/104986] [12 Regression] bogus writing 1 byte into a region of size 0 with -fwrapv and -O2 -fpeel-loops since r12-4698-gf6d012338bf87f42 marxin at gcc dot gnu.org
2022-03-23  9:45 ` aldyh at gcc dot gnu.org
2022-03-23 13:05 ` rguenth at gcc dot gnu.org
2022-03-23 14:45 ` aldyh at gcc dot gnu.org
2022-03-23 14:46 ` amacleod at redhat dot com
2022-03-23 14:49 ` aldyh at gcc dot gnu.org
2022-03-23 14:58 ` amacleod at redhat dot com
2022-03-23 15:05 ` rguenth at gcc dot gnu.org [this message]
2022-04-19  5:20 ` jakub at gcc dot gnu.org
2022-05-06  8:33 ` [Bug middle-end/104986] [12/13 " jakub at gcc dot gnu.org
2022-07-26 12:38 ` rguenth at gcc dot gnu.org
2023-05-08 12:24 ` [Bug middle-end/104986] [12/13/14 " rguenth at gcc dot gnu.org
2023-09-02 20:02 ` 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-104986-4-vtQPiCSHV5@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).