This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] Fix PR44986, make code what the comment says
- From: Richard Guenther <rguenther at suse dot de>
- To: gcc-patches at gcc dot gnu dot org
- Cc: echristo at apple dot com
- Date: Mon, 29 Nov 2010 16:40:53 +0100 (CET)
- Subject: [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;