This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[trunk<-vta] Re: [vta] fix -frepo testsuite errors with -fcompare-debug
- From: Alexandre Oliva <oliva at lsd dot ic dot unicamp dot br>
- To: gcc-patches at gcc dot gnu dot org
- Date: Mon, 01 Jun 2009 05:28:04 -0300
- Subject: [trunk<-vta] Re: [vta] fix -frepo testsuite errors with -fcompare-debug
- References: <orzljb3z65.fsf@livre.oliva.athome.lsd.ic.unicamp.br>
On Dec 5, 2008, Alexandre Oliva <aoliva@redhat.com> wrote:
> The second -fcompare-debug compilation always has a -o flag, but we
> don't want to use /dev/null here. This patch arranges for use to use
> the same repo file we use for the first stage, so that we compile the
> same symbols.
Ok for trunk?
for gcc/cp/ChangeLog
from Alexandre Oliva <aoliva@redhat.com>
* repo.c (get_base_filename): Use aux_base_name rather than
alternate temporary file during second compare debug compilation.
Index: gcc/cp/repo.c
===================================================================
--- gcc/cp/repo.c.orig 2008-09-11 05:26:15.000000000 -0300
+++ gcc/cp/repo.c 2008-11-25 16:44:50.000000000 -0200
@@ -90,7 +90,7 @@ static const char *
get_base_filename (const char *filename)
{
char *p = getenv ("COLLECT_GCC_OPTIONS");
- char *output = NULL;
+ const char *output = NULL;
int compiling = 0;
while (p && *p)
@@ -98,7 +98,15 @@ get_base_filename (const char *filename)
char *q = extract_string (&p);
if (strcmp (q, "-o") == 0)
- output = extract_string (&p);
+ {
+ if (flag_compare_debug)
+ /* Just in case aux_base_name was based on a name with two
+ or more '.'s, add an arbitrary extension that will be
+ stripped by the caller. */
+ output = concat (aux_base_name, ".o", NULL);
+ else
+ output = extract_string (&p);
+ }
else if (strcmp (q, "-c") == 0)
compiling = 1;
}
--
Alexandre Oliva, freedom fighter http://FSFLA.org/~lxoliva/
You must be the change you wish to see in the world. -- Gandhi
Be Free! -- http://FSFLA.org/ FSF Latin America board member
Free Software Evangelist Red Hat Brazil Compiler Engineer