GCC: Difference between revisions
→Useful flags: mention 10.1's -fanalyzer |
|||
| (3 intermediate revisions by the same user not shown) | |||
| Line 1: | Line 1: | ||
==Useful flags== | |||
* <tt>-fmax-errors=n</tt> print a maximum of n errors, 0 (the default) being unbounded | |||
* <tt>-E</tt> to generate preprocessor output, <tt>-s</tt> to generate assembly output | |||
* <tt>-fanalyzer</tt> (since 10.1) to do rich static analysis [https://clearlinux.org/blogs-news/major-improvements-gcc-101 ClearLinux blog] | |||
==Optimization== | |||
* Use '''-Q -Ox --help=optimizers''' to determine which optimization flags are enabled for a given -Ox setting (or read the info pages). | |||
* [[Compiler Design|Dataflow analysis]] is only performed at -O2 or above, and thus at least this level of optimization is necessary for use-of-uninitialized-variable warnings and such. | |||
==Extensions to [[C]]== | ==Extensions to [[C]]== | ||
Extensions to the [[C]] language are documented at the [http://gcc.gnu.org/onlinedocs/gcc/C-Extensions.html#C-Extensions online gcc docs], and in the Info pages distributed with gcc. | Extensions to the [[C]] language are documented at the [http://gcc.gnu.org/onlinedocs/gcc/C-Extensions.html#C-Extensions online gcc docs], and in the Info pages distributed with gcc. | ||
| Line 50: | Line 58: | ||
* "[http://www.cs.lth.se/home/Jonas_Skeppstedt/kongstad.pdf An Implementation of Global Value Numbering in the GNU Compiler Collection, with Performance Measurements]" (Kongstad 2004) | * "[http://www.cs.lth.se/home/Jonas_Skeppstedt/kongstad.pdf An Implementation of Global Value Numbering in the GNU Compiler Collection, with Performance Measurements]" (Kongstad 2004) | ||
* [http://gcc.gnu.org/onlinedocs/gccint/ GNU Compiler Collection Internals] | * [http://gcc.gnu.org/onlinedocs/gccint/ GNU Compiler Collection Internals] | ||
* [[Core]] files | |||
* [[Questions]] | |||