public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/21451] New: Missed constant propagation
@ 2005-05-08 13:59 steven at gcc dot gnu dot org
2005-05-08 17:35 ` [Bug tree-optimization/21451] " pinskia at gcc dot gnu dot org
` (2 more replies)
0 siblings, 3 replies; 6+ messages in thread
From: steven at gcc dot gnu dot org @ 2005-05-08 13:59 UTC (permalink / raw)
To: gcc-bugs
This test case is not fully optimized on mainline:
------------------------------------
typedef int (*objc_typed_write_func) (void *, const char *, int);
typedef struct objc_typed_stream
{
void *physical;
objc_typed_write_func write;
} TypedStream;
int
foo (struct objc_typed_stream *stream, unsigned int val)
{
unsigned char buf[sizeof (unsigned int) + 1];
int len;
if ((val & 0x1fU) == val)
{
buf[0] = val | 0x20U;
len = 1;
}
else
{
int c, b;
buf[0] = 0x40U;
for (c = sizeof (int); c != 0; c -= 1)
if (((val >> (8 * (c - 1))) % 0x100) != 0)
break;
buf[0] |= c;
for (b = 1; c != 0; c--, b++)
{
buf[b] = (val >> (8 * (c - 1))) % 0x100;
}
len = b;
}
return (*stream->write) (stream->physical, buf, len);
}
------------------------------------
---> (in the .optimized dump):
# BLOCK 3
# PRED: 2 [95.0%] (false,exec)
<L3>:;
cD.1575_38 = cD.1575_46 - 1;
ivtmp.25D.1650_58 = ivtmp.25D.1650_18 - 8;
if (cD.1575_38 != 0) goto <L2>; else goto <L24>;
# SUCC: 2 [89.0%] (dfs_back,true,exec) 9 [11.0%] (loop_exit,false,exec)
(...)
# BLOCK 9
# PRED: 3 [11.0%] (loop_exit,false,exec)
Invalid sum of outgoing probabilities 0.0%
Invalid sum of incoming frequencies 1045, should be 0
# cD.1575_13 = PHI <cD.1575_38(3)>;
<L24>:;
D.1592_60 = (signed charD.9) cD.1575_13;
D.1593_61 = D.1592_60 | 64;
D.1594_62 = (unsigned charD.10) D.1593_61;
# bufD.1573_63 = V_MAY_DEF <bufD.1573_15>;
bufD.1573[0] = D.1594_62;
goto <bb 8> (<L9>);
# SUCC: 8 (fallthru,exec)
cD.1575_13 is equal to 0 on entry of basic block 9. We don't propagate
this constant until GCSE CPROP1.
Maybe the new pass order from the tree-cleanup-branch will fix this,
which is why I've added Diego to the CC list.
--
Summary: Missed constant propagation
Product: gcc
Version: 4.1.0
Status: UNCONFIRMED
Keywords: missed-optimization, TREE
Severity: normal
Priority: P2
Component: tree-optimization
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: steven at gcc dot gnu dot org
CC: dnovillo at redhat dot com,gcc-bugs at gcc dot gnu dot
org,kazu at cs dot umass dot edu
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21451
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug tree-optimization/21451] Missed constant propagation
2005-05-08 13:59 [Bug tree-optimization/21451] New: Missed constant propagation steven at gcc dot gnu dot org
@ 2005-05-08 17:35 ` pinskia at gcc dot gnu dot org
2005-05-08 23:18 ` steven at gcc dot gnu dot org
2005-07-15 12:08 ` steven at gcc dot gnu dot org
2 siblings, 0 replies; 6+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-05-08 17:35 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2005-05-08 17:35 -------
Confirmed.
--
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Ever Confirmed| |1
Last reconfirmed|0000-00-00 00:00:00 |2005-05-08 17:35:38
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21451
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug tree-optimization/21451] Missed constant propagation
2005-05-08 13:59 [Bug tree-optimization/21451] New: Missed constant propagation steven at gcc dot gnu dot org
2005-05-08 17:35 ` [Bug tree-optimization/21451] " pinskia at gcc dot gnu dot org
@ 2005-05-08 23:18 ` steven at gcc dot gnu dot org
2005-07-15 12:08 ` steven at gcc dot gnu dot org
2 siblings, 0 replies; 6+ messages in thread
From: steven at gcc dot gnu dot org @ 2005-05-08 23:18 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From steven at gcc dot gnu dot org 2005-05-08 23:18 -------
Kazu and I discussed a plan for how to fix this, I'll try implementing it.
--
What |Removed |Added
----------------------------------------------------------------------------
AssignedTo|unassigned at gcc dot gnu |steven at gcc dot gnu dot
|dot org |org
Status|NEW |ASSIGNED
Last reconfirmed|2005-05-08 17:35:38 |2005-05-08 23:18:48
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21451
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug tree-optimization/21451] Missed constant propagation
2005-05-08 13:59 [Bug tree-optimization/21451] New: Missed constant propagation steven at gcc dot gnu dot org
2005-05-08 17:35 ` [Bug tree-optimization/21451] " pinskia at gcc dot gnu dot org
2005-05-08 23:18 ` steven at gcc dot gnu dot org
@ 2005-07-15 12:08 ` steven at gcc dot gnu dot org
2 siblings, 0 replies; 6+ messages in thread
From: steven at gcc dot gnu dot org @ 2005-07-15 12:08 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From steven at gcc dot gnu dot org 2005-07-15 11:59 -------
>From today's .vars dump:
# BLOCK 4
# PRED: 3 [95.0%] (false,exec)
<L3>:;
c = c - 1;
ivtmp.54 = ivtmp.54 - 8;
if (c != 0) goto <L2>; else goto <L16>;
# SUCC: 3 [75.0%] (dfs_back,true,exec) 10 [25.0%] (loop_exit,false,exec)
(...)
# BLOCK 10
# PRED: 4 [25.0%] (loop_exit,false,exec)
<L16>:;
buf[0] = (unsigned char) ((signed char) c | 64);
len = 1;
goto <bb 9> (<L9>);
# SUCC: 9 [100.0%] (fallthru,exec)
So this is still not fixed.
--
What |Removed |Added
----------------------------------------------------------------------------
Last reconfirmed|2005-05-08 23:18:48 |2005-07-15 11:59:22
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21451
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug tree-optimization/21451] Missed constant propagation
[not found] <bug-21451-280@http.gcc.gnu.org/bugzilla/>
2005-10-07 21:21 ` steven at gcc dot gnu dot org
@ 2006-02-11 0:55 ` steven at gcc dot gnu dot org
1 sibling, 0 replies; 6+ messages in thread
From: steven at gcc dot gnu dot org @ 2006-02-11 0:55 UTC (permalink / raw)
To: gcc-bugs
------- Comment #5 from steven at gcc dot gnu dot org 2006-02-11 00:55 -------
Fixed with Jeff's 2nd VRP pass:
2006-02-07 Jeff Law <law at redhat dot com>
* tree-vrp.c (find_conditional_asserts): Update comments.
(simplify_stmt_for_jump_threading): New.
(etc.)
--
steven at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |law at redhat dot com
Status|NEW |RESOLVED
Resolution| |FIXED
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21451
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug tree-optimization/21451] Missed constant propagation
[not found] <bug-21451-280@http.gcc.gnu.org/bugzilla/>
@ 2005-10-07 21:21 ` steven at gcc dot gnu dot org
2006-02-11 0:55 ` steven at gcc dot gnu dot org
1 sibling, 0 replies; 6+ messages in thread
From: steven at gcc dot gnu dot org @ 2005-10-07 21:21 UTC (permalink / raw)
To: gcc-bugs
------- Comment #4 from steven at gcc dot gnu dot org 2005-10-07 21:21 -------
I don't have time to work on these (new job), so unassigning.
--
steven at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
AssignedTo|steven at gcc dot gnu dot |unassigned at gcc dot gnu
|org |dot org
Status|ASSIGNED |NEW
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21451
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2006-02-11 0:55 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-05-08 13:59 [Bug tree-optimization/21451] New: Missed constant propagation steven at gcc dot gnu dot org
2005-05-08 17:35 ` [Bug tree-optimization/21451] " pinskia at gcc dot gnu dot org
2005-05-08 23:18 ` steven at gcc dot gnu dot org
2005-07-15 12:08 ` steven at gcc dot gnu dot org
[not found] <bug-21451-280@http.gcc.gnu.org/bugzilla/>
2005-10-07 21:21 ` steven at gcc dot gnu dot org
2006-02-11 0:55 ` steven 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).