[cfe-dev] No loop optimisation?

mats petersson via cfe-dev cfe-dev at lists.llvm.org
Fri Nov 6 06:18:09 PST 2015


I was using a pre-3.8 but not latest. Will pull latest and check again.

--
Mats
On 6 Nov 2015 12:24, "Joerg Sonnenberger via cfe-dev" <
cfe-dev at lists.llvm.org> wrote:

> On Fri, Nov 06, 2015 at 10:32:50AM +0000, mats petersson via cfe-dev wrote:
> > I saw a question on "why does clang do this" on Stack Overflow, and
> boiling
> > it down to simple code, the following is the code:
> >
> >      size_t ret;
> >      for(int i = 0; i < LOOP_COUNT; i++)
> >         ret = sizeof("abcd");
> >
> > Which I would expect to be optimsied into:
> >
> >     size_t ret = 5;
> >
> > and the loop disappear.
>
> Works fine here. How exactly did you compile it and which version of
> clang are you using?
>
> Joerg
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20151106/6fe3c6c7/attachment.html>


More information about the cfe-dev mailing list