Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does '#pragma GCC optimize ("O3")' mean?

Tags:

linux

gcc

pragma

I came through this line in project source code written before a function. I want to know, what is the use of it ?

#pragma GCC optimize ("O3")

void somefunction()
{
  ....
}

Requesting to explain every argument used in the directive.

Thanks and Regards.

like image 377
Madhu R Avatar asked Nov 10 '17 11:11

Madhu R


People also ask

What the Fox say Meaning?

Speaking of the meaning of the song, Vegard characterizes it as coming from "a genuine wonder of what the fox says, because we didn't know". Although interpreted by some commentators as a reference to the furry fandom, the brothers have stated they did not know about its existence when producing "The Fox".

What does the fox say for real?

One of the most common fox vocalizations is a raspy bark. Scientists believe foxes use this barking sound to identify themselves and communicate with other foxes. Another eerie fox vocalization is a type of high-pitched howl that's almost like a scream.

What is this song Google?

Ask Google Assistant to name a song On your phone, touch and hold the Home button or say "Hey Google." Ask "What's this song?" Play a song or hum, whistle, or sing the melody of a song. Hum, whistle, or sing: Google Assistant will identify potential matches for the song.


1 Answers

Pragmas are implementation specific but, in this case (gcc), it sets the optimisation level to 3 (high), similar in effect to using -O3 on the command line.

Details on optimisation levels for gcc, and the individual flags that get set in response, can be found here.

like image 69
paxdiablo Avatar answered Sep 18 '22 20:09

paxdiablo