[LLVMdev] A simple case about SDiv

Zhou Sheng zhousheng00 at gmail.com
Fri Sep 5 21:45:13 PDT 2008


2008/9/5 Duncan Sands <baldrick at free.fr>

> > Any ideas?
>
> Most likely it is the gcc folder doing it.
> This gcc optimization is run in llvm-gcc
> because it's basically impossible to turn
> it off!

Agree. I found that gcc option -fstrict-overflow, with which gcc will do
that simplication.
Defaultly, that option is turn on with -O2 or above.


> You can check by passing
> -mllvm -disable-llvm-optzns
> to llvm-gcc along with -O2.  If the
> optimization still occurs then it was
> gcc that did it.

eh... I got some error as following:
llvm-gcc -O2 -mllvm -disable-llvm-optzns -emit-llvm -c test.c -o test.ll -S
cc1: warning: unrecognized gcc debugging option: i
cc1: warning: unrecognized gcc debugging option: s
cc1: warning: unrecognized gcc debugging option: b
cc1: warning: unrecognized gcc debugging option: l
cc1: warning: unrecognized gcc debugging option: e
cc1: warning: unrecognized gcc debugging option: -
cc1: warning: unrecognized gcc debugging option: l
cc1: warning: unrecognized gcc debugging option: l
cc1: warning: unrecognized gcc debugging option: m
cc1: warning: unrecognized gcc debugging option: -
cc1: warning: unrecognized gcc debugging option: o
cc1: warning: unrecognized gcc debugging option: t
cc1: warning: unrecognized gcc debugging option: z
cc1: warning: unrecognized gcc debugging option: n
cc1: warning: unrecognized gcc debugging option: s
cc1: Unknown command line argument '-mtune=generic'. Try: 'cc1 --help'

Am I missing something?
Sheng.


>
>
> Ciao,
>
> Duncan.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20080906/52b83751/attachment.html>


More information about the llvm-dev mailing list