This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug optimization/14341] Missed comparision optimization (jump threading related)


------- 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]