nightmorph 07/07/29 06:58:08 Modified: gcc-optimization.xml Log: changed Os stuff and backtraces, bug 186891
Revision Changes Path 1.7 xml/htdocs/doc/en/gcc-optimization.xml file : http://sources.gentoo.org/viewcvs.py/gentoo/xml/htdocs/doc/en/gcc-optimization.xml?rev=1.7&view=markup plain: http://sources.gentoo.org/viewcvs.py/gentoo/xml/htdocs/doc/en/gcc-optimization.xml?rev=1.7&content-type=text/plain diff : http://sources.gentoo.org/viewcvs.py/gentoo/xml/htdocs/doc/en/gcc-optimization.xml?r1=1.6&r2=1.7 Index: gcc-optimization.xml =================================================================== RCS file: /var/cvsroot/gentoo/xml/htdocs/doc/en/gcc-optimization.xml,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- gcc-optimization.xml 27 Jul 2007 17:34:45 -0000 1.6 +++ gcc-optimization.xml 29 Jul 2007 06:58:08 -0000 1.7 @@ -1,6 +1,6 @@ <?xml version='1.0' encoding='UTF-8'?> -<!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/gcc-optimization.xml,v 1.6 2007/07/27 17:34:45 nightmorph Exp $ --> +<!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/gcc-optimization.xml,v 1.7 2007/07/29 06:58:08 nightmorph Exp $ --> <!DOCTYPE guide SYSTEM "/dtd/guide.dtd"> @@ -22,8 +22,8 @@ <!-- See http://creativecommons.org/licenses/by-sa/2.5 --> <license/> -<version>1.3</version> -<date>2007-07-27</date> +<version>1.4</version> +<date>2007-07-28</date> <chapter> <title>Introduction</title> @@ -271,11 +271,10 @@ </li> <li> <c>-O2</c>: A step up from <c>-O1</c>. This is the <e>recommended</e> level - of optimization unless you have special needs (such as <c>-Os</c>, as will - be explained shortly). <c>-O2</c> will activate a few more flags in addition - to the ones activated by <c>-O1</c>. With <c>-O2</c>, the compiler will - attempt to increase code performance without compromising on size, and - without taking too much compilation time. + of optimization unless you have special needs. <c>-O2</c> will activate a + few more flags in addition to the ones activated by <c>-O1</c>. With + <c>-O2</c>, the compiler will attempt to increase code performance without + compromising on size, and without taking too much compilation time. </li> <li> <c>-O3</c>: This is the highest level of optimization possible, and also the @@ -292,9 +291,11 @@ </li> <li> <c>-Os</c>: This level will optimize your code for size. It activates all - <c>-O2</c> options that don't increase the size of the generated code. It's - useful for machines that have extremely limited disk storage space and/or - have CPUs with small cache sizes. + <c>-O2</c> options that don't increase the size of the generated code. It + can be useful for machines that have extremely limited disk storage space + and/or have CPUs with small cache sizes. However, it can cause quite a few + problems, which is why it is filtered out by many of the ebuilds in the + tree. Using <c>-Os</c> is not recommended. </li> </ul> @@ -302,8 +303,8 @@ As previously mentioned, <c>-O2</c> is the recommended optimization level. If package compilations error out, check to make sure that you aren't using <c>-O3</c>. As a fallback option, try setting your CFLAGS and CXXFLAGS to a -lower optimization level, such as <c>-O1</c> or <c>-Os</c> and recompile the -package. +lower optimization level, such as <c>-O1</c> or even <c>-O0 -g2 -ggdb</c> (for +error reporting and checking for possible problems) and recompile the package. </p> </body> @@ -338,10 +339,11 @@ <p> In particular, it makes troubleshooting applications written in Java much harder, though Java is not the only code affected by using this flag. So while -the flag can help, it can also make debugging harder. If you don't plan to do -much debugging and haven't added any other debugging-related CFLAGS such as -<c>-ggdb</c> (and you aren't installing packages with the <c>debug</c> USE -flag), then try using <c>-fomit-frame-pointer</c>. +the flag can help, it also makes debugging harder; backtraces will be useless. +However, if you don't plan to do much debugging and haven't added any other +debugging-related CFLAGS such as <c>-ggdb</c> (and you aren't installing +packages with the <c>debug</c> USE flag), then try using +<c>-fomit-frame-pointer</c>. </p> <impo> -- [EMAIL PROTECTED] mailing list
