public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/105801] New: Missed CCP with -ftrivial-auto-var-init=zero
@ 2022-06-01 10:24 rguenth at gcc dot gnu.org
2022-12-13 14:17 ` [Bug tree-optimization/105801] " cvs-commit at gcc dot gnu.org
2022-12-13 14:18 ` rguenth at gcc dot gnu.org
0 siblings, 2 replies; 3+ messages in thread
From: rguenth at gcc dot gnu.org @ 2022-06-01 10:24 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105801
Bug ID: 105801
Summary: Missed CCP with -ftrivial-auto-var-init=zero
Product: gcc
Version: 12.1.1
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: tree-optimization
Assignee: unassigned at gcc dot gnu.org
Reporter: rguenth at gcc dot gnu.org
Target Milestone: ---
int foo (int flag)
{
int i;
if (flag)
i = 1;
return i;
}
CCP used to optimize this to 'return 1;' but with -ftrivial-auto-var-init=zero
only FRE does this now.
^ permalink raw reply [flat|nested] 3+ messages in thread
* [Bug tree-optimization/105801] Missed CCP with -ftrivial-auto-var-init=zero
2022-06-01 10:24 [Bug tree-optimization/105801] New: Missed CCP with -ftrivial-auto-var-init=zero rguenth at gcc dot gnu.org
@ 2022-12-13 14:17 ` cvs-commit at gcc dot gnu.org
2022-12-13 14:18 ` rguenth at gcc dot gnu.org
1 sibling, 0 replies; 3+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2022-12-13 14:17 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105801
--- Comment #1 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Richard Biener <rguenth@gcc.gnu.org>:
https://gcc.gnu.org/g:8f4634fb82d5670183d0ee42de9dae3b55ab5087
commit r13-4678-g8f4634fb82d5670183d0ee42de9dae3b55ab5087
Author: Richard Biener <rguenther@suse.de>
Date: Tue Dec 13 14:24:02 2022 +0100
tree-optimization/105801 - CCP and .DEFERRED_INIT
This makes sure we treat .DEFERRED_INIT as producing UNDEFINED so
we can continue optimizing uninitialized uses the same as without
-ftrivial-auto-var-init=zero. For the testcase this means we
catch the return 1 optimization opportunity at CCP rather than
only at FRE which already does the right thing here.
PR tree-optimization/105801
* tree-ssa-ccp.cc (likely_value): .DEFERRED_INIT produces
UNDEFINED.
* doc/invoke.texi (ftrivial-auto-var-init): Explicitely
mention we treat variables without an initializer as
undefined also for optimization purposes.
* gcc.dg/tree-ssa/ssa-ccp-43.c: New testcase.
^ permalink raw reply [flat|nested] 3+ messages in thread
* [Bug tree-optimization/105801] Missed CCP with -ftrivial-auto-var-init=zero
2022-06-01 10:24 [Bug tree-optimization/105801] New: Missed CCP with -ftrivial-auto-var-init=zero rguenth at gcc dot gnu.org
2022-12-13 14:17 ` [Bug tree-optimization/105801] " cvs-commit at gcc dot gnu.org
@ 2022-12-13 14:18 ` rguenth at gcc dot gnu.org
1 sibling, 0 replies; 3+ messages in thread
From: rguenth at gcc dot gnu.org @ 2022-12-13 14:18 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105801
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|--- |13.0
Resolution|--- |FIXED
Status|UNCONFIRMED |RESOLVED
--- Comment #2 from Richard Biener <rguenth at gcc dot gnu.org> ---
Fixed for GCC 13.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2022-12-13 14:18 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-01 10:24 [Bug tree-optimization/105801] New: Missed CCP with -ftrivial-auto-var-init=zero rguenth at gcc dot gnu.org
2022-12-13 14:17 ` [Bug tree-optimization/105801] " cvs-commit at gcc dot gnu.org
2022-12-13 14:18 ` rguenth at gcc dot gnu.org
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).