public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/36188] New: missed CCP
@ 2008-05-09 15:32 rguenth at gcc dot gnu dot org
2008-05-09 15:36 ` [Bug tree-optimization/36188] " rguenth at gcc dot gnu dot org
` (8 more replies)
0 siblings, 9 replies; 10+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2008-05-09 15:32 UTC (permalink / raw)
To: gcc-bugs
int f(int lay)
{
static int syncsize, init;
if (init == 0)
syncsize = 1344, init = 1;
return syncsize;
}
store-ccp should handle that.
--
Summary: missed CCP
Product: gcc
Version: 4.4.0
Status: UNCONFIRMED
Keywords: missed-optimization
Severity: normal
Priority: P3
Component: tree-optimization
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: rguenth at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36188
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug tree-optimization/36188] missed CCP
2008-05-09 15:32 [Bug tree-optimization/36188] New: missed CCP rguenth at gcc dot gnu dot org
@ 2008-05-09 15:36 ` rguenth at gcc dot gnu dot org
2008-05-09 15:40 ` pinskia at gcc dot gnu dot org
` (7 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2008-05-09 15:36 UTC (permalink / raw)
To: gcc-bugs
------- Comment #1 from rguenth at gcc dot gnu dot org 2008-05-09 15:35 -------
A get_symbol_constant_value at the right place and time should do the trick.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36188
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug tree-optimization/36188] missed CCP
2008-05-09 15:32 [Bug tree-optimization/36188] New: missed CCP rguenth at gcc dot gnu dot org
2008-05-09 15:36 ` [Bug tree-optimization/36188] " rguenth at gcc dot gnu dot org
@ 2008-05-09 15:40 ` pinskia at gcc dot gnu dot org
2008-05-13 14:43 ` rguenth at gcc dot gnu dot org
` (6 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2008-05-09 15:40 UTC (permalink / raw)
To: gcc-bugs
------- Comment #2 from pinskia at gcc dot gnu dot org 2008-05-09 15:39 -------
I thought I had a bug filed already ...
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36188
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug tree-optimization/36188] missed CCP
2008-05-09 15:32 [Bug tree-optimization/36188] New: missed CCP rguenth at gcc dot gnu dot org
2008-05-09 15:36 ` [Bug tree-optimization/36188] " rguenth at gcc dot gnu dot org
2008-05-09 15:40 ` pinskia at gcc dot gnu dot org
@ 2008-05-13 14:43 ` rguenth at gcc dot gnu dot org
2008-05-13 14:44 ` rguenth at gcc dot gnu dot org
` (5 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2008-05-13 14:43 UTC (permalink / raw)
To: gcc-bugs
------- Comment #3 from rguenth at gcc dot gnu dot org 2008-05-13 14:43 -------
So the problem is that we are not optimistically treating static variables. If
we fix that then the testcase is optimized to return 1344 with store_ccp. The
question is how many bugs we hit with that and how restrictive we need to be ;)
--
rguenth at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Ever Confirmed|0 |1
Last reconfirmed|0000-00-00 00:00:00 |2008-05-13 14:43:14
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36188
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug tree-optimization/36188] missed CCP
2008-05-09 15:32 [Bug tree-optimization/36188] New: missed CCP rguenth at gcc dot gnu dot org
` (2 preceding siblings ...)
2008-05-13 14:43 ` rguenth at gcc dot gnu dot org
@ 2008-05-13 14:44 ` rguenth at gcc dot gnu dot org
2008-05-13 15:01 ` rguenth at gcc dot gnu dot org
` (4 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2008-05-13 14:44 UTC (permalink / raw)
To: gcc-bugs
------- Comment #4 from rguenth at gcc dot gnu dot org 2008-05-13 14:44 -------
Created an attachment (id=15635)
--> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=15635&action=view)
very optimistic patch
Which also handles
int f(int lay)
{
static int syncsize, init;
if (init == 1)
syncsize = 1344, init = 1;
return syncsize;
}
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36188
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug tree-optimization/36188] missed CCP
2008-05-09 15:32 [Bug tree-optimization/36188] New: missed CCP rguenth at gcc dot gnu dot org
` (3 preceding siblings ...)
2008-05-13 14:44 ` rguenth at gcc dot gnu dot org
@ 2008-05-13 15:01 ` rguenth at gcc dot gnu dot org
2008-08-15 23:54 ` pinskia at gcc dot gnu dot org
` (3 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2008-05-13 15:01 UTC (permalink / raw)
To: gcc-bugs
------- Comment #5 from rguenth at gcc dot gnu dot org 2008-05-13 15:01 -------
Ok, that doesn't really work well.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36188
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug tree-optimization/36188] missed CCP
2008-05-09 15:32 [Bug tree-optimization/36188] New: missed CCP rguenth at gcc dot gnu dot org
` (4 preceding siblings ...)
2008-05-13 15:01 ` rguenth at gcc dot gnu dot org
@ 2008-08-15 23:54 ` pinskia at gcc dot gnu dot org
2009-04-22 21:56 ` rguenth at gcc dot gnu dot org
` (2 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2008-08-15 23:54 UTC (permalink / raw)
To: gcc-bugs
------- Comment #6 from pinskia at gcc dot gnu dot org 2008-08-15 23:52 -------
On the trunk we get:
lis 11,.LANCHOR0@ha
la 9,.LANCHOR0@l(11)
lwz 0,.LANCHOR0@l(11)
cmpwi 7,0,0
bne 7,.L6
li 0,1344
li 3,1344
stw 0,4(9)
li 9,1
stw 9,.LANCHOR0@l(11)
blr
Which is better but still can be improved. Basically we have to prove syncsize
is only set when init is set.
--
pinskia at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Severity|normal |enhancement
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36188
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug tree-optimization/36188] missed CCP
2008-05-09 15:32 [Bug tree-optimization/36188] New: missed CCP rguenth at gcc dot gnu dot org
` (5 preceding siblings ...)
2008-08-15 23:54 ` pinskia at gcc dot gnu dot org
@ 2009-04-22 21:56 ` rguenth at gcc dot gnu dot org
2009-04-25 22:24 ` steven at gcc dot gnu dot org
2009-04-26 16:37 ` rguenth at gcc dot gnu dot org
8 siblings, 0 replies; 10+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2009-04-22 21:56 UTC (permalink / raw)
To: gcc-bugs
------- Comment #7 from rguenth at gcc dot gnu dot org 2009-04-22 21:56 -------
This also happens in 189.lucas where it prevents propagating constant 1 array
strides to the access.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36188
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug tree-optimization/36188] missed CCP
2008-05-09 15:32 [Bug tree-optimization/36188] New: missed CCP rguenth at gcc dot gnu dot org
` (6 preceding siblings ...)
2009-04-22 21:56 ` rguenth at gcc dot gnu dot org
@ 2009-04-25 22:24 ` steven at gcc dot gnu dot org
2009-04-26 16:37 ` rguenth at gcc dot gnu dot org
8 siblings, 0 replies; 10+ messages in thread
From: steven at gcc dot gnu dot org @ 2009-04-25 22:24 UTC (permalink / raw)
To: gcc-bugs
------- Comment #8 from steven at gcc dot gnu dot org 2009-04-25 22:24 -------
Re. comment #5 -- what doesn't work very well, i.e. what massive breakage does
your patch cause?
Maybe you can treat static locals optimistically if they are only stored to
once?
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36188
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug tree-optimization/36188] missed CCP
2008-05-09 15:32 [Bug tree-optimization/36188] New: missed CCP rguenth at gcc dot gnu dot org
` (7 preceding siblings ...)
2009-04-25 22:24 ` steven at gcc dot gnu dot org
@ 2009-04-26 16:37 ` rguenth at gcc dot gnu dot org
8 siblings, 0 replies; 10+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2009-04-26 16:37 UTC (permalink / raw)
To: gcc-bugs
------- Comment #9 from rguenth at gcc dot gnu dot org 2009-04-26 16:36 -------
comment #5 doesn't work anymore because CCP no longer tracks stores.
What we would need is predication in value-numbering.
--
rguenth at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |dberlin at gcc dot gnu dot
| |org, rguenth at gcc dot gnu
| |dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36188
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2009-04-26 16:37 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-05-09 15:32 [Bug tree-optimization/36188] New: missed CCP rguenth at gcc dot gnu dot org
2008-05-09 15:36 ` [Bug tree-optimization/36188] " rguenth at gcc dot gnu dot org
2008-05-09 15:40 ` pinskia at gcc dot gnu dot org
2008-05-13 14:43 ` rguenth at gcc dot gnu dot org
2008-05-13 14:44 ` rguenth at gcc dot gnu dot org
2008-05-13 15:01 ` rguenth at gcc dot gnu dot org
2008-08-15 23:54 ` pinskia at gcc dot gnu dot org
2009-04-22 21:56 ` rguenth at gcc dot gnu dot org
2009-04-25 22:24 ` steven at gcc dot gnu dot org
2009-04-26 16:37 ` rguenth at gcc dot gnu dot 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).