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]

Re: [patches] Re: i386 REG_ALLOC_ORDER tweek


> On Wed, Feb 14, 2001 at 11:48:40PM +0100, Jan Hubicka wrote:
> > BTW speaking about deprecated options - whats about warning about -mpentium
> > and friends - these are extremly often used making users to not realize
> > that for instance k6 is supported by just trying -mk6 and seeing error
> > message.
> 
> Can specs do warnings instead of errors?  If so, go for it.
Hmm, the can't, but wait a moment... what about this?

Wed Feb 14 13:12:45 CET 2001  Jan Hubicka  <jh@suse.cz>
	* gcc.c (do_spec_1): 'n' for printing notices.
	* i386.h (CC1_CPU_SPEC): Notice deprecated options as deprecated.
Index: gcc.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/gcc.c,v
retrieving revision 1.206
diff -c -3 -p -r1.206 gcc.c
*** gcc.c	2001/02/14 16:37:14	1.206
--- gcc.c	2001/02/14 23:14:25
*************** or with constant text in a single argume
*** 360,365 ****
--- 360,366 ----
  	and substitute the full name found.
   %eSTR  Print STR as an error message.  STR is terminated by a newline.
          Use this when inconsistent options are detected.
+  %nSTR  Print STR as an notice.  STR is terminated by a newline.
   %x{OPTION}	Accumulate an option for %X.
   %X	Output the accumulated linker options specified by compilations.
   %Y	Output the accumulated assembler options specified by compilations.
*************** do_spec_1 (spec, inswitch, soft_matched_
*** 4194,4199 ****
--- 4195,4216 ----
  	      buf[p - q] = 0;
  	      error ("%s", buf);
  	      return -1;
+ 	    }
+ 	    break;
+ 	  case 'n':
+ 	    /* %nfoo means report an notice with `foo' as error message
+ 	       and don't execute any more commands for this file.  */
+ 	    {
+ 	      const char *q = p;
+ 	      char *buf;
+ 	      while (*p != 0 && *p != '\n')
+ 		p++;
+ 	      buf = (char *) alloca (p - q + 1);
+ 	      strncpy (buf, q, p - q);
+ 	      buf[p - q] = 0;
+ 	      notice ("%s\n", buf);
+ 	      if (*p)
+ 		p++;
  	    }
  	    break;
  
Index: config/i386/i386.h
===================================================================
RCS file: /cvs/gcc/egcs/gcc/config/i386/i386.h,v
retrieving revision 1.155
diff -c -3 -p -r1.155 i386.h
*** i386.h	2001/02/14 22:47:54	1.155
--- i386.h	2001/02/14 23:14:35
*************** extern int ix86_arch;
*** 405,414 ****
  #ifndef CC1_CPU_SPEC
  #define CC1_CPU_SPEC "\
  %{!mcpu*: \
! %{m386:-mcpu=i386} \
! %{m486:-mcpu=i486} \
! %{mpentium:-mcpu=pentium} \
! %{mpentiumpro:-mcpu=pentiumpro}}"
  #endif
  
  #ifndef CPP_CPU_DEFAULT_SPEC
--- 405,418 ----
  #ifndef CC1_CPU_SPEC
  #define CC1_CPU_SPEC "\
  %{!mcpu*: \
! %{m386:-mcpu=i386 \
! %n`-mpentium' is deprecated. Use `-march' or `-mcpu' instead.\n} \
! %{m486:-mcpu=i486 \
! %n`-mpentium' is deprecated. Use `-march' or `-mcpu' instead.\n} \
! %{mpentium:-mcpu=pentium \
! %n`-mpentium' is deprecated. Use `-march' or `-mcpu' instead.\n} \
! %{mpentiumpro:-mcpu=pentiumpro \
! %n`-mpentiumpro' is deprecated. Use `-march' or `-mcpu' instead.\n}}"
  #endif
  
  #ifndef CPP_CPU_DEFAULT_SPEC


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