This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug optimization/14341] Missed comparision optimization (jump threading related)
- From: "pinskia at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 29 Feb 2004 06:37:29 -0000
- Subject: [Bug optimization/14341] Missed comparision optimization (jump threading related)
- References: <20040229062941.14341.pinskia@gcc.gnu.org>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From pinskia at gcc dot gnu dot org 2004-02-29 06:37 -------
This should be done on the tree-ssa with the jump threading code, as this code is done
right:
void f(int);
int h(int, int);
void t()
{
int i;
int x;
for( i = 0; i < 100000000; i++ ){
if (i < 100000000)
f(1);
else
f(0);
}
}
And this one:
void t1()
{
int i;
int x;
for( i = 0; i < 100000000; i++ ){
int t;
if (i < 100000000) t=1;else t =0;
f( t );
}
}
But note this one is not either:
void t()
{
int i;
int x;
for( i = 0; i < 100000000; i++ ){
int t = ({int i;if (i < 100000000) i=1;else i =0; i;});
f( t );
}
}
--
What |Removed |Added
----------------------------------------------------------------------------
CC| |law at gcc dot gnu dot org
Keywords| |pessimizes-code
Known to fail| |tree-ssa
Summary|Missed optimization |Missed comparision
| |optimization (jump threading
| |related)
Target Milestone|--- |tree-ssa
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14341