[cfe-dev] Constant folding in clang

Giacomo Tagliabue giacomo.tag at gmail.com
Tue Mar 5 09:36:57 PST 2013


already tried, doesn't work


On 5 March 2013 11:33, Jeffrey Walton <noloader at gmail.com> wrote:

> On Tue, Mar 5, 2013 at 12:16 PM, Giacomo Tagliabue
> <giacomo.tag at gmail.com> wrote:
> > Hello,
> > let's say I have this function:
> >
> > int main(int argc, char const *argv[])
> > {
> >   return 10+1;
> > }
> >
> > When I compile it with -emit-llvm -S I expect that clang doesn't fold my
> > constant, but if I look at the .s file i see
> >
> > ret i32 11
> >
> > How do I prevent clang to perform folding, or, in general, any kind of
> > optimization?
> -O0?
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20130305/67a5f17d/attachment.html>


More information about the cfe-dev mailing list