The manual item for -freorder-blocks says:- Enabled at levels -O2, -O3, -Os. Yet, in the same manual, the item for -Os says:- -Os disables the following optimization flags: -falign-functions -falign-jumps -falign-loops -falign-labels -freorder-blocks -fprefetch-loop-arrays Obviously, one has to be wrong. Compiling a test program with "-fverbose-asm -S" confirms that -freorder-blocks is not used at -Os
Confirm with respect to the documentation on the web site and looking at toplev.c and seeing that -Os disables reorder blocks. This (regression?) is caused by the following patch: 2003-01-24 Jerry Quinn <jlquinn@optonline.net> * gcc/doc/invoke.texi (Optimization Options): List -O levels for each optimization flag. which did not update for the following patch which was made earlier (4 months) 2002-08-01 Richard Henderson <rth@redhat.com> * toplev.c (parse_options_and_default_flags): Don't set flag_reorder_blocks for -Os. I am adding jlquinn@optonline.net as he made the orginal patch to list the -O levels for each optimization flag.
I've submitted a patch: http://gcc.gnu.org/ml/gcc-patches/2003-06/msg02699.html
Patch committed to mainline and 3.3-branch.
Subject: Bug 11280 CVSROOT: /cvs/gcc Module name: gcc Changes by: gerald@gcc.gnu.org 2003-06-25 08:24:53 Modified files: gcc : ChangeLog gcc/doc : invoke.texi Log message: PR other/11280 * gcc/doc/invoke.texi (Optimization Options): Remove -Os from -freorder-functions description. Patches: http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&r1=2.151&r2=2.152 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/doc/invoke.texi.diff?cvsroot=gcc&r1=1.301&r2=1.302
Subject: Bug 11280 CVSROOT: /cvs/gcc Module name: gcc Branch: gcc-3_3-branch Changes by: gerald@gcc.gnu.org 2003-06-25 08:28:10 Modified files: gcc : ChangeLog gcc/doc : invoke.texi Log message: PR other/11280 * gcc/doc/invoke.texi (Optimization Options): Remove -Os from -freorder-functions description. Patches: http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=1.16114.2.615&r2=1.16114.2.616 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/doc/invoke.texi.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=1.209.2.37&r2=1.209.2.38