public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "hubicka at kam dot mff.cuni.cz" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug ipa/103830] [12 Regression] null pointer access optimized away by removing function call at -Og
Date: Tue, 04 Jan 2022 14:52:17 +0000	[thread overview]
Message-ID: <bug-103830-4-enusrKEnzp@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-103830-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #5 from hubicka at kam dot mff.cuni.cz ---
> I think the recent modref change made the function const.
> 
> And no, we shouldn't DSE any volatile store and generally we don't.  It's
> probably some side-effect of modref that we do.  Using -fno-ipa-pure-const
> "fixes" this bug with -Og:
> 
>  local analysis of void MyClass::call()/1
>    NULL memory access; terminating BB
> Function is locally const.
> callgraph:
> 
> so it's caused by the recent change to mitigate path-isolation damage to
> modref.

The change indeed assumes that with -fdelete-null-pointer-checks the
access to NULL is invalid no matter if it is volatile or normal.  I
would expect code having exception handlers at address 0 to be always
built with -fno-delete-null-pointer-checks.

If we want to preserve user defined volaitle NULL, is there way to stick
another flag on the memory accesses synthetised by isolate-paths to mark
them as OK to be optimized this way?

  parent reply	other threads:[~2022-01-04 14:52 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-26 10:00 [Bug rtl-optimization/103830] New: volatile optimized away bernd.edlinger at hotmail dot de
2021-12-26 10:10 ` [Bug rtl-optimization/103830] " pinskia at gcc dot gnu.org
2021-12-26 10:19 ` [Bug ipa/103830] [12 Regression] null pointer access optimized away by removing function call at -Og pinskia at gcc dot gnu.org
2021-12-27 16:20 ` jakub at gcc dot gnu.org
2022-01-04 13:35 ` rguenth at gcc dot gnu.org
2022-01-04 14:52 ` hubicka at kam dot mff.cuni.cz [this message]
2022-01-28 12:02 ` rguenth at gcc dot gnu.org
2022-01-28 12:04 ` rguenth at gcc dot gnu.org
2022-01-28 12:06 ` rguenth at gcc dot gnu.org
2022-01-28 12:08 ` bernd.edlinger at hotmail dot de

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-103830-4-enusrKEnzp@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).