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 handling of %U in specs



The following patch corrects the behaviour of %U in GCC's specs
to match the documentation in the comments of gcc.c.  The described
behaviour is that %U should expand to the filename created by the
previous %u.  Unfortunately, the current code fails to match %U
with earlier %u, as the "unique" field of the association get set
to incompatible values.

This bug was causing the last remaining bootstrap failure for
mainline on alphaev67-dec-osf5.1.  I've now been able to run
the regression suite for the first time since the 3.4 merge!


The fix below adds 'U' to the list of strict character codes, so
that 'U' and 'u' return the same value.


The following patch has been tested on both i686-pc-linux-gnu and
alphaev67-dec-osf5.1 with a complete "make bootstrap", all languages
except Ada and treelang, and a full "make -k check" with no new
regressions.  I'd like to thank Zack for his patience and help
whilst we debugged this problem.


Ok for mainline?



2003-02-27  Roger Sayle  <roger at eyesopen dot com>
	    Zack Weinberg <zack at codesourcery dot com>

	* gcc.c (do_spec_1):  Treat %U like %u for unique associations.


Index: gcc.c
===================================================================
RCS file: /cvsroot/gcc/gcc/gcc/gcc.c,v
retrieving revision 1.363
diff -c -3 -p -r1.363 gcc.c
*** gcc.c	24 Feb 2003 14:52:42 -0000	1.363
--- gcc.c	27 Feb 2003 07:29:14 -0000
*************** do_spec_1 (spec, inswitch, soft_matched_
*** 4706,4712 ****
  		for (t = temp_names; t; t = t->next)
  		  if (t->length == suffix_length
  		      && strncmp (t->suffix, suffix, suffix_length) == 0
! 		      && t->unique == (c == 'u' || c == 'j'))
  		    break;

  		/* Make a new association if needed.  %u and %j
--- 4706,4712 ----
  		for (t = temp_names; t; t = t->next)
  		  if (t->length == suffix_length
  		      && strncmp (t->suffix, suffix, suffix_length) == 0
! 		      && t->unique == (c == 'u' || c == 'U' || c == 'j'))
  		    break;

  		/* Make a new association if needed.  %u and %j
*************** do_spec_1 (spec, inswitch, soft_matched_
*** 4727,4733 ****
  		      }
  		    else
  		      t->suffix = save_string (suffix, suffix_length);
! 		    t->unique = (c == 'u' || c == 'j');
  		    temp_filename = make_temp_file (t->suffix);
  		    temp_filename_length = strlen (temp_filename);
  		    t->filename = temp_filename;
--- 4727,4733 ----
  		      }
  		    else
  		      t->suffix = save_string (suffix, suffix_length);
! 		    t->unique = (c == 'u' || c == 'U' || c == 'j');
  		    temp_filename = make_temp_file (t->suffix);
  		    temp_filename_length = strlen (temp_filename);
  		    t->filename = temp_filename;

Roger
--
Roger Sayle,                         E-mail: roger at eyesopen dot 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]