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 tree-optimization/27039] [4.1/4.2 Regression] Unable to determine # of iterations for a simple loop



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


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