-O2 flag

Eduardo Morras emorrasg at yahoo.es
Sat Jun 10 20:38:52 UTC 2017


On Sat, 10 Jun 2017 16:20:25 -0300
Friedrich Locke <friedrich.locke at gmail.com> wrote:

> Hi folks,
> 
> i am trying compile a program with cc on freebsd 11.
> When i use -O2 compilation flag, the compiled code is giving error on 
> execution, but with i omit -O2 everything works ok.
> 
> Have anybody already faced such problem ?

No, which compiler are you using? Which version? Are you using the last
version? It looks like a bug in the compiler, perhaps modifying your
code you can bypass it.

In FreeBSD 11, the default cc is clang38, try with clang40. To install
it, use port llvm40, it includes clang40 now:

#pkg install llvm40

and use clang40 instead cc.

> Thanks in advance.

 HTH

---   ---
Eduardo Morras <emorrasg at yahoo.es>


More information about the freebsd-questions mailing list