public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "cvs-commit at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug tree-optimization/97456] [10/11 Regression] An incorrect optimization causes a function to always return the same value when using -flto
Date: Wed, 30 Mar 2022 11:51:43 +0000	[thread overview]
Message-ID: <bug-97456-4-n1ntTLeiBM@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 #11 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-9 branch has been updated by Martin Jambor
<jamborm@gcc.gnu.org>:

https://gcc.gnu.org/g:1dc4bed43760c4e291e072aa0c8c450f5775e25f

commit r9-10000-g1dc4bed43760c4e291e072aa0c8c450f5775e25f
Author: Martin Jambor <mjambor@suse.cz>
Date:   Wed Mar 30 13:47:24 2022 +0200

    cplxlower: Avoid a transform when looking at a default definition

    In PR 97456, IPA-SRA triggers a bug in tree-complex.c where it
    converts:

     <bb 2>
       a$_M_value_21 = COMPLEX_EXPR <ISRA.18_10(D), ISRA.18_10(D)>;

    (where ISRA.18 is IPA-SRA created PARM_DECL with DECL_IGNORED_P set,
    which is why it only happens with IPA-SRA) into:

      <bb 2>
        a$_M_value_21 = COMPLEX_EXPR <a$_M_value$real_10(D),
a$_M_value$real_10(D)>;

    i.e. it replaces two uses of the parameter default-def with two
    uninitialized default-defs of a new variable - all in hope to produce
    code with better debug info.

    This patch fixes it by avoiding the transform when the SSA_NAME to be
    replaced is a default definition.

    gcc/ChangeLog:

    2020-10-19  Martin Jambor  <mjambor@suse.cz>

            PR tree-optimization/97456
            PR middle-end/105071
            * tree-complex.c (set_component_ssa_name): Do not replace ignored
decl
            default definitions with new component vars.  Reorder if
conditions.

    gcc/testsuite/ChangeLog:

    2020-10-19  Martin Jambor  <mjambor@suse.cz>

            PR tree-optimization/97456
            * gcc.dg/tree-ssa/pr97456.c: New test.

    (cherry picked from commit 619f91eaa8c8a50f1f9d3e7b96ee837037f0e806)

  parent reply	other threads:[~2022-03-30 11:51 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
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 [this message]
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-n1ntTLeiBM@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).