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]

PATCH to gcc/gcc.c: do_spec_1 off-by-one error


The gcc library's name is constructed by gcc.c:do_spec (), which calls
do_spec_1 () to perform most of the work.  The '%M' case for
processing the multilib_dir contained an off-by-one string processing
error.  The symptom evidenced on nightly mips-sgi-irix6.5 builds was a
failure to resolve "-lgcc_s^O_mabi=6" rather than "-lgcc_s_mabi=64".

2001-02-14  Jeffrey Oldham  <oldham@codesourcery.com>

        * gcc.c (do_spec_1): Fix off-by-one error for '%M' case.

Tested on       mips-sgi-irix6.5
                  Numerous "g++.dg/vtgc1.C scan-assembler .vtable_inherit"
                  errors, as previously seen for i686-pc-linux-gnu, appeared.
                i686-pc-linux-gnu (bootstrap only but it is uninteresting)
Approved by	Mark Mitchell (mark@codesourcery.com)

Thanks,
Jeffrey D. Oldham
oldham@codesourcery.com
Index: gcc.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/gcc.c,v
retrieving revision 1.205
diff -c -p -r1.205 gcc.c
*** gcc.c	2001/02/09 07:43:13	1.205
--- gcc.c	2001/02/13 18:54:44
*************** do_spec_1 (spec, inswitch, soft_matched_
*** 4493,4499 ****
  
  		len = strlen (multilib_dir);
  		obstack_blank (&obstack, len + 1);
! 		p = obstack_next_free (&obstack) - len;
  
  		*p++ = '_';
  		for (q = multilib_dir; *q ; ++q, ++p)
--- 4493,4499 ----
  
  		len = strlen (multilib_dir);
  		obstack_blank (&obstack, len + 1);
! 		p = obstack_next_free (&obstack) - (len + 1);
  
  		*p++ = '_';
  		for (q = multilib_dir; *q ; ++q, ++p)

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