Bug 13211 - using -###, warns about unused linker file
Summary: using -###, warns about unused linker file
Alias: None
Product: gcc
Classification: Unclassified
Component: driver (show other bugs)
Version: 3.4.0
: P2 normal
Target Milestone: 3.3.3
Assignee: Andrew Pinski
Keywords: diagnostic, patch
Depends on:
Reported: 2003-11-27 07:23 UTC by Andrew Pinski
Modified: 2003-12-06 03:51 UTC (History)
2 users (show)

See Also:
Known to work:
Known to fail:
Last reconfirmed: 2003-11-29 01:58:52

Patch to fix this (345 bytes, patch)
2003-12-05 04:56 UTC, Andrew Pinski
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Andrew Pinski 2003-11-27 07:23:49 UTC
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 -###.

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.


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.


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