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 PR44986, make code what the comment says


Eric, your change in r101934 introduced

  /* Reset the input file name to the first compile/object file name, for 
use
     with %b in LINK_SPEC. We use the first input file that we can find
     a compiler to compile it instead of using infiles.language since for
     languages other than C we use aliases that we then lookup later.  */
  if (n_infiles > 0)
    {
      int i;

      for (i = 0; i < n_infiles ; i++)
        if (infiles[i].language && infiles[i].language[0] != '*')
          {
            set_input (infiles[i].name);
            break;
          }
    }

in the driver which has mismatching comment/code.  This causes us to
end up with for example --end-group (from -Wl,--end-group) as current
input when entering link specs processing.  The following patch
makes us use the first input with a compiler or the first with a
specified language.

Bootstrapped on x86_64-unknown-linux-gnu, testing in progress.

Eric, any reason why you ended up writing different code than
commented?

Thanks,
Richard.

2010-11-29  Richard Guenther  <rguenther@suse.de>

	PR lto/44986
	* gcc.c (main): Use the first input with a compiler as infile
	for link spec processing.

Index: gcc/gcc.c
===================================================================
*** gcc/gcc.c	(revision 167235)
--- gcc/gcc.c	(working copy)
*************** warranty; not even for MERCHANTABILITY o
*** 6759,6765 ****
        int i;
  
        for (i = 0; i < n_infiles ; i++)
! 	if (infiles[i].language && infiles[i].language[0] != '*')
  	  {
  	    set_input (infiles[i].name);
  	    break;
--- 6759,6766 ----
        int i;
  
        for (i = 0; i < n_infiles ; i++)
! 	if (infiles[i].incompiler
! 	    || infiles[i].language && infiles[i].language[0] != '*')
  	  {
  	    set_input (infiles[i].name);
  	    break;


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