[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[Bug tree-optimization/18694] [4.0 regression] loop miscompilation at -O1 (-ftree-ch)



------- Additional Comments From pinskia at gcc dot gnu dot org  2004-12-09 01:33 -------
And here is a testcase which aborts and it is independent of storing to memory:
extern void abort (void);

void 
divisors_bug(long t, long e, long P) 
{ 
  long int tmp;
  long int act_d;
  long int old_d;
  long int d;
  long int j;
  
  d = t + 1;
  old_d = t;
  j = e;
  while (j != 0) {
    act_d = d;
    tmp = old_d;
    while (tmp < act_d) {
      d++;
      tmp++;
    }
    if (tmp != act_d)
      abort ();
    old_d = act_d;
    j--;
  }
} 
 
int main(void) 
{
  divisors_bug(0,2,2); 
  return 0; 
} 

-- 


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

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.



Reply to: