public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "hubicka at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug tree-optimization/103209] [12 Regression] wrong code at -O1 on x86_64-linux-gnu since r12-4324-g008e7397dad971c0
Date: Fri, 12 Nov 2021 20:55:55 +0000	[thread overview]
Message-ID: <bug-103209-4-RjysCCoVAg@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-103209-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #3 from Jan Hubicka <hubicka at gcc dot gnu.org> ---
This is bug I introduced to tree-ssa-structalias where I reversed order of
flags which deterine global memory read and writes. So pure functions are
handled as functions writting global memory but not reading it.  I am very
surprised it took so long to show as wrong code.

diff --git a/gcc/tree-ssa-structalias.c b/gcc/tree-ssa-structalias.c
index 153ddf57a61..34fd47fdf47 100644
--- a/gcc/tree-ssa-structalias.c
+++ b/gcc/tree-ssa-structalias.c
@@ -4996,7 +4996,7 @@ find_func_aliases_for_call (struct function *fn, gcall
*t)
         reachable from their arguments, but they are not an escape
         point for reachable memory of their arguments.  */
       else if (flags & (ECF_PURE|ECF_LOOPING_CONST_OR_PURE))
-       handle_rhs_call (t, &rhsc, implicit_pure_eaf_flags, true, false);
+       handle_rhs_call (t, &rhsc, implicit_pure_eaf_flags, false, true);
       /* If the call is to a replaceable operator delete and results
         from a delete expression as opposed to a direct call to
         such operator, then the effects for PTA (in particular

  parent reply	other threads:[~2021-11-12 20:55 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-12 12:17 [Bug tree-optimization/103209] New: [12 Regression] wrong code at -O1 on x86_64-linux-gnu haoxintu at gmail dot com
2021-11-12 13:13 ` [Bug tree-optimization/103209] [12 Regression] wrong code at -O1 on x86_64-linux-gnu since r12-4324-g008e7397dad971c0 marxin at gcc dot gnu.org
2021-11-12 13:17 ` rguenth at gcc dot gnu.org
2021-11-12 13:51 ` hubicka at gcc dot gnu.org
2021-11-12 20:55 ` hubicka at gcc dot gnu.org [this message]
2021-11-12 21:03 ` marxin at gcc dot gnu.org
2021-11-12 22:56 ` cvs-commit at gcc dot gnu.org
2021-11-12 22:58 ` hubicka 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-103209-4-RjysCCoVAg@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).