This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
-Os should default optimize to 2, without enforcing it
- To: gcc-patches at gcc dot gnu dot org
- Subject: -Os should default optimize to 2, without enforcing it
- From: Cosmin Truta <cosmin at cs dot toronto dot edu>
- Date: Fri, 9 Mar 2001 16:01:36 -0500 (EST)
- cc: Cosmin Truta <cosmint at cs dot ubbcluj dot ro>
Hi again,
I noticed an inconsistency between the comment of optimize_size (that
*defaults* optimize to 2 -- I guess this is the initial intention) and the
initialization (that *enforces* optimize to be 2). The patch below,
independent of the patch sent in my previous message, fixes the problem:
Index: gcc/gcc/toplev.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/toplev.c,v
retrieving revision 1.420.2.6
diff -c -3 -p -r1.420.2.6 toplev.c
*** toplev.c 2001/03/02 19:51:59 1.420.2.6
--- toplev.c 2001/03/09 20:53:46
*************** main (argc, argv)
*** 4690,4698 ****
if ((p[0] == 's') && (p[1] == 0))
{
optimize_size = 1;
-
- /* Optimizing for size forces optimize to be 2. */
- optimize = 2;
}
else
{
--- 4690,4695 ----
*************** main (argc, argv)
*** 4705,4710 ****
--- 4702,4711 ----
}
}
}
+
+ /* Optimizing for size defaults optimize to 2. */
+ if (optimize < 1 && optimize_size)
+ optimize = 2;
if (optimize >= 1)
{
Here is the ChangeLog entry:
Fri 9 Mar 2001 Cosmin Truta <cosmint@cs.ubbcluj.ro>
* toplev.c (main): Default optimize to 2, without enforcing it,
when the -Os option is used.
Best regards,
Cosmin