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 middle-end/100810] [12 Regression] wrong code at -O1 and above on x86_64-linux-gnu since r12-397-gda9e6e63d1ae22e530ec7baf59f6ed028bf05776 Date: Fri, 03 Jun 2022 07:05:05 +0000 [thread overview] Message-ID: <bug-100810-4-KC6h1Q46aJ@http.gcc.gnu.org/bugzilla/> (raw) In-Reply-To: <bug-100810-4@http.gcc.gnu.org/bugzilla/> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100810 --- Comment #16 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Alexandre Oliva <aoliva@gcc.gnu.org>: https://gcc.gnu.org/g:be2861fe8c527a5952257462ceca899bb43b1452 commit r13-972-gbe2861fe8c527a5952257462ceca899bb43b1452 Author: Alexandre Oliva <oliva@adacore.com> Date: Fri Jun 3 03:59:03 2022 -0300 [PR105665] ivopts: check defs of names in base for undefs The patch for PR 100810 tested for undefined SSA_NAMEs appearing directly in the base expression of the potential IV candidate, but that's not enough. The testcase for PR105665 shows an undefined SSA_NAME has the same ill effect if it's referenced as an PHI_NODE arg in the referenced SSA_NAME. The variant of that test shows it can be further removed from the referenced SSA_NAME. To avoid deep recursion, precompute maybe-undefined SSA_NAMEs: start from known-undefined nonvirtual default defs, and propagate them to any PHI nodes reached by a maybe-undefined arg, as long as there aren't intervening non-PHI uses, that would imply the maybe-undefined name must be defined at that point, otherwise it would invoke undefined behavior. Also test for intervening non-PHI uses of DEFs in the base expr. The test for intervening uses implemented herein relies on dominance; this could be further extended, regarding conditional uses in every path leading to a point as an unconditional use dominating that point, but I haven't implemented that. for gcc/ChangeLog PR tree-optimization/105665 PR tree-optimization/100810 * tree-ssa-loop-ivopts.cc (ssa_name_maybe_undef_p, ssa_name_set_maybe_undef): New. (ssa_name_any_use_dominates_bb_p, mark_ssa_maybe_undefs): New. (find_ssa_undef): Check precomputed flag and intervening uses. (tree_ssa_iv_optimize): Call mark_ssa_maybe_undefs. for gcc/testsuite/ChangeLog PR tree-optimization/105665 PR tree-optimization/100810 * gcc.dg/torture/pr105665.c: New.
next prev parent reply other threads:[~2022-06-03 7:05 UTC|newest] Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top 2021-05-28 8:59 [Bug tree-optimization/100810] New: wrong code at -O1 and above on x86_64-linux-gnu zhendong.su at inf dot ethz.ch 2021-05-28 9:23 ` [Bug tree-optimization/100810] [12 Regression] wrong code at -O1 and above on x86_64-linux-gnu since r12-397-gda9e6e63d1ae22e530ec7baf59f6ed028bf05776 marxin at gcc dot gnu.org 2021-06-11 8:27 ` [Bug middle-end/100810] " roger at nextmovesoftware dot com 2021-06-14 9:37 ` jakub at gcc dot gnu.org 2021-08-03 21:21 ` roger at nextmovesoftware dot com 2021-08-03 21:36 ` pinskia at gcc dot gnu.org 2021-08-03 21:41 ` pinskia at gcc dot gnu.org 2021-08-03 21:47 ` pinskia at gcc dot gnu.org 2021-08-31 6:23 ` roger at nextmovesoftware dot com 2021-11-11 19:37 ` roger at nextmovesoftware dot com 2022-04-01 11:06 ` rguenth at gcc dot gnu.org 2022-04-01 11:08 ` rguenth at gcc dot gnu.org 2022-04-04 12:59 ` rguenth at gcc dot gnu.org 2022-04-04 13:00 ` rguenth at gcc dot gnu.org 2022-04-22 6:11 ` rguenth at gcc dot gnu.org 2022-04-25 7:52 ` cvs-commit at gcc dot gnu.org 2022-04-25 7:54 ` rguenth at gcc dot gnu.org 2022-06-03 7:05 ` cvs-commit at gcc dot gnu.org [this message] 2022-07-27 9:24 ` cvs-commit 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-100810-4-KC6h1Q46aJ@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).