Bug 13211

Summary: using -###, warns about unused linker file
Product: gcc Reporter: Andrew Pinski <pinskia>
Component: driverAssignee: Andrew Pinski <pinskia>
Status: RESOLVED FIXED    
Severity: normal CC: gcc-bugs, zackw
Priority: P2 Keywords: diagnostic, patch
Version: 3.4.0   
Target Milestone: 3.3.3   
Host: Target:
Build: Known to work:
Known to fail: Last reconfirmed: 2003-11-29 01:58:52
Attachments: Patch to fix this

Description Andrew Pinski 2003-11-27 07:23:49 UTC
Do:
touch test.o
gcc -### test.o
And you will get a warning about an unused linker file which is not true.
Comment 1 Andrew Pinski 2003-11-27 07:24:23 UTC
Mine, I patch in progress.
Comment 2 Andrew Pinski 2003-11-29 01:58:51 UTC
Patch here: <http://gcc.gnu.org/ml/gcc-patches/2003-11/msg02296.html>.
Comment 3 Zack Weinberg 2003-12-02 01:19:04 UTC
I don't like changing the meaning of linker_was_run like that.  Better you
should change the place that emits the warning.
Comment 4 Zack Weinberg 2003-12-02 01:20:03 UTC
Oh, also, consider

gcc -### -c foo.c -lm

which should still issue the warning. 
Comment 5 Andrew Pinski 2003-12-02 01:29:42 UTC
Zack if I change where the warning happens, then the test you mentioned does not warn at all.
What about this, increment the value of execution_count when verbose_only_flag is set?
Comment 6 Zack Weinberg 2003-12-02 01:50:22 UTC
Subject: Re:  using -###, warns about unused linker file


I don't know if that's right.  What you need is a way to say that the
linker *would have* been run if not for -###.

zw
Comment 7 Jim Wilson 2003-12-03 03:08:18 UTC
I started looking at this because I thought it was an unreviewed patch.  There
was no response to the gcc-patches message.

The suggestion of incrementing execution_count when verbose_only_flag is true
looks like the right solution to me.  execution_count is only used for the
unused linker file error message, so nothing else should be affected.  It does
exactly what Zack asks for, it indicates that the linker would have been run if
not for -###.
Comment 8 Zack Weinberg 2003-12-03 06:18:15 UTC
Thanks for the clarification; I withdraw my objections.

It would be nice if there were a way to get the bugzilla comment box to
cc: gcc-patches.
Comment 9 Andrew Pinski 2003-12-05 04:56:01 UTC
Created attachment 5282 [details]
Patch to fix this

Just increment execution_count when verbose_only_flag is true.
Comment 10 CVS Commits 2003-12-06 03:48:07 UTC
Subject: Bug 13211

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	pinskia@gcc.gnu.org	2003-12-06 03:47:56

Modified files:
	gcc            : ChangeLog gcc.c 

Log message:
	2003-12-05  Andrew Pinski <pinskia@physics.uc.edu>
	
	PR driver/13211
	* gcc.c (execute) Increment execution_count when returning
	early because verbose_only_flag is true.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&r1=2.1935&r2=2.1936
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/gcc.c.diff?cvsroot=gcc&r1=1.397&r2=1.398

Comment 11 CVS Commits 2003-12-06 03:50:36 UTC
Subject: Bug 13211

CVSROOT:	/cvs/gcc
Module name:	gcc
Branch: 	gcc-3_3-branch
Changes by:	pinskia@gcc.gnu.org	2003-12-06 03:50:28

Modified files:
	gcc            : gcc.c ChangeLog 

Log message:
	2003-12-05  Andrew Pinski <pinskia@physics.uc.edu>
	
	PR driver/13211
	* gcc.c (execute) Increment execution_count when returning
	early because verbose_only_flag is true.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/gcc.c.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=1.350.2.7&r2=1.350.2.8
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=1.16114.2.828&r2=1.16114.2.829

Comment 12 Andrew Pinski 2003-12-06 03:51:05 UTC
Fixed for 3.3.3 and 3.4.