This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

-Os should default optimize to 2, without enforcing it



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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]