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]
Other format: [Raw text]

[PATCH] Fix specs processing


On Wed, 5 Feb 2003, Richard Henderson wrote:
> On Wed, Feb 05, 2003 at 12:17:29AM -0700, Roger Sayle wrote:
> > I have a suspicion that although the requirement for a whitespace
> > terminator is documented in the comments in the source code...
>
> I have a suspicion that it's documented nowhere, and was not
> in fact intended at all.  Certainly I consider it a bug.


The following patch fixes a bug in specs processing on mainline CVS
that is currently causing bootstraps on Tru64 with the native assembler
to fail.  The problem is that as written, we require all conditional
arguments "%{...}" to be followed by whitespace to update the argument
list.  This is fixed in the patch below by performing arg_going
processing upon return from handle_braces in "%{...}" exactly the same
way as we do for "%W{...}".

The following patch has been tested by a complete bootstrap and
regression test, all languages except Ada and treelang, on
i686-pc-linux-gnu with no new failures.  It also allows bootstrap of
alphaev67-dec-osf5.1 to proceed past its previous failure (without
changing ASM_FINAL_SPEC), and that now breaks somewhere else.

Ok for mainline?


2003-02-08  Roger Sayle  <roger@eyesopen.com>

	* gcc.c (do_spec_1) ['{']:  Handle pending argument upon return
	from handle_braces in "%{...}".


Index: gcc.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/gcc.c,v
retrieving revision 1.360
diff -c -3 -p -r1.360 gcc.c
*** gcc.c	27 Jan 2003 23:22:15 -0000	1.360
--- gcc.c	8 Feb 2003 03:41:29 -0000
***************
*** 1,6 ****
  /* Compiler driver program that can handle many languages.
     Copyright (C) 1987, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
!    1999, 2000, 2001, 2002 Free Software Foundation, Inc.

  This file is part of GCC.

--- 1,6 ----
  /* Compiler driver program that can handle many languages.
     Copyright (C) 1987, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
!    1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.

  This file is part of GCC.

*************** do_spec_1 (spec, inswitch, soft_matched_
*** 5130,5135 ****
--- 5130,5147 ----
  	    p = handle_braces (p);
  	    if (p == 0)
  	      return -1;
+ 	    /* End any pending argument.  */
+ 	    if (arg_going)
+ 	      {
+ 		obstack_1grow (&obstack, 0);
+ 		string = obstack_finish (&obstack);
+ 		if (this_is_library_file)
+ 		  string = find_file (string);
+ 		store_arg (string, delete_this_arg, this_is_output_file);
+ 		if (this_is_output_file)
+ 		  outfiles[input_file_number] = string;
+ 		arg_going = 0;
+ 	      }
  	    break;

  	  case ':':

Roger
--
Roger Sayle,                         E-mail: roger@eyesopen.com
OpenEye Scientific Software,         WWW: http://www.eyesopen.com/
Suite 1107, 3600 Cerrillos Road,     Tel: (+1) 505-473-7385
Santa Fe, New Mexico, 87507.         Fax: (+1) 505-473-0833


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