Patchwork make -flto -save-temps less verbose

login
register
mail settings
Submitter Cesar Philippidis
Date March 13, 2014, 12:10 a.m.
Message ID <5320F75B.1010002@codesourcery.com>
Download mbox | patch
Permalink /patch/329752/
State New
Headers show

Comments

Cesar Philippidis - March 13, 2014, 12:10 a.m.
I noticed that the lto-wrapper is a little noisy without the -v option
when -save-temps is used. E.g.,

$ gcc main.c -flto -save-temps
[Leaving LTRANS /tmp/ccSEvaB7.args]
[Leaving LTRANS /tmp/ccQomDzb.ltrans.out]
[Leaving LTRANS /tmp/ccVzWdGZ.args]
[Leaving LTRANS /tmp/ccQomDzb.ltrans0.o]

Those messages probably should be suppressed unless the user wants
verbose diagnostics. They also show up as errors in the testsuite
(although none currently use -save-temps with -flto, yet). The attached
patch addresses this issue by disabling those messages unless the user
passes -v to the driver. I've also included a simple test case which
would fail without the change.

Is this OK for stage-4? If so, please check it in since I don't have an
SVN account.

Thanks,
Cesar
2014-03-12  Cesar Philippidis  <cesar@codesourcery.com>

	gcc/
	* lto-wrapper.c (maybe_unlink_file): Suppress diagnostic
	messages.

	gcc/testsuites/
	* gcc.dg/lto/save-temps_0.c: New file.
Richard Guenther - March 13, 2014, 9:31 a.m.
On Thu, Mar 13, 2014 at 1:10 AM, Cesar Philippidis
<cesar@codesourcery.com> wrote:
> I noticed that the lto-wrapper is a little noisy without the -v option
> when -save-temps is used. E.g.,
>
> $ gcc main.c -flto -save-temps
> [Leaving LTRANS /tmp/ccSEvaB7.args]
> [Leaving LTRANS /tmp/ccQomDzb.ltrans.out]
> [Leaving LTRANS /tmp/ccVzWdGZ.args]
> [Leaving LTRANS /tmp/ccQomDzb.ltrans0.o]
>
> Those messages probably should be suppressed unless the user wants
> verbose diagnostics. They also show up as errors in the testsuite
> (although none currently use -save-temps with -flto, yet). The attached
> patch addresses this issue by disabling those messages unless the user
> passes -v to the driver. I've also included a simple test case which
> would fail without the change.
>
> Is this OK for stage-4? If so, please check it in since I don't have an
> SVN account.

Ok (I'll check it in).

Thanks,
Richard.

> Thanks,
> Cesar
>
Richard Guenther - March 13, 2014, 9:52 a.m.
On Thu, Mar 13, 2014 at 10:31 AM, Richard Biener
<richard.guenther@gmail.com> wrote:
> On Thu, Mar 13, 2014 at 1:10 AM, Cesar Philippidis
> <cesar@codesourcery.com> wrote:
>> I noticed that the lto-wrapper is a little noisy without the -v option
>> when -save-temps is used. E.g.,
>>
>> $ gcc main.c -flto -save-temps
>> [Leaving LTRANS /tmp/ccSEvaB7.args]
>> [Leaving LTRANS /tmp/ccQomDzb.ltrans.out]
>> [Leaving LTRANS /tmp/ccVzWdGZ.args]
>> [Leaving LTRANS /tmp/ccQomDzb.ltrans0.o]
>>
>> Those messages probably should be suppressed unless the user wants
>> verbose diagnostics. They also show up as errors in the testsuite
>> (although none currently use -save-temps with -flto, yet). The attached
>> patch addresses this issue by disabling those messages unless the user
>> passes -v to the driver. I've also included a simple test case which
>> would fail without the change.
>>
>> Is this OK for stage-4? If so, please check it in since I don't have an
>> SVN account.
>
> Ok (I'll check it in).

I have not committed the testcase as it leaves the saved-temps files
behind and

/* { dg-final { cleanup-saved-temps } } */

doesn't work.  May I ask you to see why and eventually fix it?
Supposedly some weird TCL "upvar" stuff ... I get (after my lto.exp fix)

Running /space/rguenther/src/svn/trunk/gcc/testsuite/gcc.dg/lto/lto.exp ...
ERROR: /space/rguenther/src/svn/trunk/gcc/testsuite/gcc.dg/lto/save-temps_0.c:
error executing dg-final: bad level "5"

not sure how to set verboseness or debug that stuff (and no time to
do that right now).

Richard.

> Thanks,
> Richard.
>
>> Thanks,
>> Cesar
>>

Patch

Index: gcc/lto-wrapper.c
===================================================================
--- gcc/lto-wrapper.c	(revision 208513)
+++ gcc/lto-wrapper.c	(working copy)
@@ -246,7 +246,7 @@  maybe_unlink_file (const char *file)
 	  && errno != ENOENT)
 	fatal_perror ("deleting LTRANS file %s", file);
     }
-  else
+  else if (verbose)
     fprintf (stderr, "[Leaving LTRANS %s]\n", file);
 }
 
Index: gcc/testsuite/gcc.dg/lto/save-temps_0.c
===================================================================
--- gcc/testsuite/gcc.dg/lto/save-temps_0.c	(revision 0)
+++ gcc/testsuite/gcc.dg/lto/save-temps_0.c	(revision 0)
@@ -0,0 +1,8 @@ 
+/* { dg-lto-options {{ -O -flto -save-temps}} } */
+/* { dg-lto-do link } */
+
+int
+main (void)
+{
+  return 0;
+}