[Bug tree-optimization/20514] hoisting of label out of jumptable would take place at cse, should happen at trees

pinskia at gcc dot gnu dot org gcc-bugzilla@gcc.gnu.org
Fri May 6 13:40:00 GMT 2005


------- Additional Comments From pinskia at gcc dot gnu dot org  2005-05-06 13:39 -------
(In reply to comment #3)
> Can someone explain what is expected here?  I get the following .optimized 

This is what it should look like instead:
main () 
{ 
  int lsm_tmp.1; 
  int D.1572; 
  int D.1571; 
  int i.0; 
 
<L8>:; 
  lsm_tmp.1 = i; 
  goto <bb 2> (<L10>); 
 
<L9>:; 
  goto <L9>;
 
<L10>:; 
  switch (lsm_tmp.1) 
    { 
      case 0 ... 1: goto <L1>; 
      case 2 ... 3: goto <L13>; 
      case 5: goto <L5>; 
      default : goto <L9>; 
    } 
 
<L1>:; 
  i = lsm_tmp.1; 
  D.1571 = 1; 
  goto <bb 6> (<L7>); 
 
<L5>:; 
  lsm_tmp.1 = 4; 
  goto <bb 1> (<L9>); 
 
<L13>:; 
  i = lsm_tmp.1; 
  D.1571 = 0; 
 
<L7>:; 
  return D.1571; 
 
} 

So we should get an infinite loop for L9 because there is no way lsm_tmp.1 can change.

-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20514



More information about the Gcc-bugs mailing list