public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "jamborm at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug ipa/97456] [10/11 Regression] An incorrect optimization causes a function to always return the same value when using -flto Date: Fri, 16 Oct 2020 15:56:29 +0000 [thread overview] Message-ID: <bug-97456-4-0BGD1AAYkz@http.gcc.gnu.org/bugzilla/> (raw) In-Reply-To: <bug-97456-4@http.gcc.gnu.org/bugzilla/> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97456 --- Comment #5 from Martin Jambor <jamborm at gcc dot gnu.org> --- And indeed the following avoids the issue: diff --git a/gcc/tree-complex.c b/gcc/tree-complex.c index 2e54bbb917c..71ad7c18523 100644 --- a/gcc/tree-complex.c +++ b/gcc/tree-complex.c @@ -570,8 +570,10 @@ set_component_ssa_name (tree ssa_name, bool imag_p, tree value) /* Replace an anonymous base value with the variable from cvc_lookup. This should result in better debug info. */ if (SSA_NAME_VAR (ssa_name) - && (!SSA_NAME_VAR (value) || DECL_IGNORED_P (SSA_NAME_VAR (value))) - && !DECL_IGNORED_P (SSA_NAME_VAR (ssa_name))) + && !DECL_IGNORED_P (SSA_NAME_VAR (ssa_name)) + && (!SSA_NAME_VAR (value) + || (DECL_IGNORED_P (SSA_NAME_VAR (value)) + && !SSA_NAME_IS_DEFAULT_DEF (value)))) { comp = get_component_var (SSA_NAME_VAR (ssa_name), imag_p); replace_ssa_name_symbol (value, comp);
next prev parent reply other threads:[~2020-10-16 15:56 UTC|newest] Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top 2020-10-16 10:25 [Bug c++/97456] New: " pqfrml at gmail dot com 2020-10-16 10:29 ` [Bug c++/97456] " pqfrml at gmail dot com 2020-10-16 11:00 ` [Bug ipa/97456] [10/11 Regression] " rguenth at gcc dot gnu.org 2020-10-16 12:06 ` marxin at gcc dot gnu.org 2020-10-16 14:51 ` jamborm at gcc dot gnu.org 2020-10-16 15:56 ` jamborm at gcc dot gnu.org [this message] 2020-10-16 18:53 ` jamborm at gcc dot gnu.org 2020-10-16 18:54 ` [Bug tree-optimization/97456] " jamborm at gcc dot gnu.org 2020-10-19 17:22 ` cvs-commit at gcc dot gnu.org 2020-10-26 16:33 ` cvs-commit at gcc dot gnu.org 2020-10-26 16:34 ` jamborm at gcc dot gnu.org 2022-03-30 11:51 ` cvs-commit at gcc dot gnu.org 2022-03-30 11:53 ` jamborm 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-97456-4-0BGD1AAYkz@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: linkBe 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).