This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/27039] [4.1/4.2 Regression] Unable to determine # of iterations for a simple loop
- From: "rguenther at suse dot de" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 5 Apr 2006 10:47:27 -0000
- Subject: [Bug tree-optimization/27039] [4.1/4.2 Regression] Unable to determine # of iterations for a simple loop
- References: <bug-27039-5077@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- 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