# Optimize generated code with just CPUTYPE



## ediondo69 (May 5, 2012)

Hi, I'm a noob in the FreeBSD world but I like it. If I just add this line to /etc/make.conf 


```
CPUTYPE?= native
```

Then gcc will set -march=native and -O2 right? Is this simple tuning option enough for a decent output code?  May I set -O3?  I'm confused because some books I've read said that using -03 will break some ports and the compiler sometimes doesn't detect the right processor, but they were written two or three years ago.

Thank you, English is not my first language.


----------



## graudeejs (May 5, 2012)

ediondo69 said:
			
		

> Hi, I'm a noob in the FreeBSD world but I like it. If I just add this line to /etc/make.conf
> 
> CPUTYPE?= native
> 
> Then gcc will set -march=native and -O2 right?




Wrong.
And you don't need to optimize anything (at least while you're noob. When you will not be noob, then you probably won't want to optimize anyway  )


----------



## ediondo69 (May 6, 2012)

Thank you very much.  I'm sorry for my unformatted first post, I didn't know those rules for posting.


----------

