public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "rguenth at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/64322] More optimize opportunity for constant folding Date: Tue, 16 Dec 2014 10:11:00 -0000 [thread overview] Message-ID: <bug-64322-4-n6qZ3P13cE@http.gcc.gnu.org/bugzilla/> (raw) In-Reply-To: <bug-64322-4@http.gcc.gnu.org/bugzilla/> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64322 Richard Biener <rguenth at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEW Last reconfirmed| |2014-12-16 Ever confirmed|0 |1 --- Comment #2 from Richard Biener <rguenth at gcc dot gnu.org> --- Well, I rather wonder how the store to an otherwise unused value can affect the code. It doesn't on the GIMPLE level. I suppose RTL somehow invalidly thinks that after b = 0; c = 0; b is still zero (so it only considers the two volatiles aliasing but doesn't consider the b volatile). It seems to be combine optimizing the case with c = 0, not sure why it doens't with c = 0x1000000L. Ah, the large constant is split to a reg. Difference: -Successfully matched this instruction: -(set (reg:DI 98) - (ashift:DI (reg:DI 94 [ D.1849 ]) - (const_int 1 [0x1]))) -Successfully matched this instruction: -(set (reg:DI 97 [ a ]) - (const_int 0 [0])) -allowing combination of insns 10, 11 and 12 -original costs 4 + 3 + 0 = 0 -replacement costs 6 + 4 = 10 -deferring deletion of insn with uid = 10. -modifying insn i2 11: {r98:DI=r94:DI<<0x1;clobber flags:CC;} Otherwise I agree with Jakub that VRP should be enhanced (it's weak with handling non-initeger-VR_RANGES for most codes). But combine probably exposes a RTL simplification so I wonder if we can add a similar one (after figuring out which one applies) on the GIMPLE level. Confirmed (at -O2 both codes are bad).
next prev parent reply other threads:[~2014-12-16 10:11 UTC|newest] Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top 2014-12-15 23:01 [Bug tree-optimization/64322] New: " ishiura-compiler at ml dot kwansei.ac.jp 2014-12-16 0:41 ` [Bug tree-optimization/64322] " jakub at gcc dot gnu.org 2014-12-16 10:11 ` rguenth at gcc dot gnu.org [this message] 2014-12-16 10:26 ` jakub at gcc dot gnu.org 2014-12-16 11:50 ` rguenth at gcc dot gnu.org 2014-12-17 9:29 ` jakub at gcc dot gnu.org 2014-12-17 12:36 ` jakub at gcc dot gnu.org 2014-12-17 14:25 ` rguenther at suse dot de 2021-08-19 19:26 ` pinskia 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-64322-4-n6qZ3P13cE@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).