[Bug tree-optimization/27039] [4.1/4.2 Regression] Unable to determine # of iterations for a simple loop

rguenther at suse dot de gcc-bugzilla@gcc.gnu.org
Wed Apr 5 10:47:00 GMT 2006



------- Comment #7 from rguenther at suse dot de  2006-04-05 10:47 -------
Subject: Re:  [4.1/4.2 Regression] Unable to
 determine # of iterations for a simple loop

> > would be much better here.  The question is of course, if the programmer
> > is allowed to write
> > 
> >  x + (size_t)-1
> > 
> > and expect the result to be defined.
> 
> if I understand the C standard correctly, no, this has undefined behavior.

This is also my understanding, so we should try to avoid creating the
above in the frontends.  But of course, as discussed, this doesn't solve
the problem (does it, for constant offsets?).


-- 


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



More information about the Gcc-bugs mailing list