@@ -102,6 +102,8 @@ NB: the build flags are shared with the run command too:
102102 Compile the executable in production mode, where most optimizations are enabled.
103103 Note that most V warnings turn to errors, if you pass -prod, so you will have
104104 to fix them first.
105+ Note: gcc versions > 12.0 often have issues with inlining, that manifest with `-prod`.
106+ To work around them, you can use `-prod -cflags -fno-inline-small-functions` .
105107
106108 -no-prod-options
107109 Useful in combination with -prod and -cflags, for allowing more complete customisation,
@@ -110,7 +112,9 @@ NB: the build flags are shared with the run command too:
110112 will compile the program, without passing `-O3` and `-flto`, that would otherwise
111113 have been used, but passing `-Os` instead. Note, since `-prod` is used, the V compiler
112114 itself will still compile your potential `$if prod {` branches, and it will still do the
113- optimisations on the V side, that -prod enables.
115+ optimisations on the V side, that -prod enables. You can also use it to compile programs
116+ with different optimisation options passed to the C compiler, like `-O2` instead of
117+ the default ones, which can be beneficial for working with older or newer buggy compilers.
114118
115119 -no-bounds-checking
116120 Programs compiled with this option, will do no runtime checking of array access operations.
0 commit comments