First Last Prev Next    No search results available      Search page      Enter new bug
Bug#: 15004
Product:  
Component:  
Status: RESOLVED
Resolution: FIXED
Assigned To: Not yet assigned to anyone <unassigned@gcc.gnu.org>
Host:
Reported against  
Priority:  
Severity:  
Target Milestone:  
 
 
Target:
Reporter: Andrew Pinski <pinskia@gcc.gnu.org>
Add CC:
CC:
Remove selected CCs
Build:
URL:
Summary:
Keywords:
Known to work:
Known to fail:

Attachment Description Type Created Size Actions
Create a New Attachment (proposed patch, testcase, etc.) View All

Bug 15004 depends on: Show dependency tree
Show dependency graph
Bug 15004 blocks:

Additional Comments:






View Bug Activity   |   Format For Printing   |   Clone This Bug


Description:   Last confirmed: 2004-04-18 21:56 Opened: 2004-04-18 15:53
Since t is inlined and no longer even tried to be emitted anymore there is no
unused 
paramater warning for t.

static int t(int i)
{
  return 0;
}
int tt()
{
  return t(0);
}

------- Comment #1 From Jan Hubicka 2004-04-18 21:14 -------
Subject: Re:  [3.4/3.5 Regression] [unit-at-a-time] no warning for unused
paramater in static function

Do we realy want this to have warned?  We never did so for C++ and it
would be pretty expensive to throw all the function into backend just to
get the warnings out.  Perhaps we may want to have such warnings only
for code that is really used...

Honza

------- Comment #2 From Andrew Pinski 2004-04-18 21:29 -------
Yes we want this, as if the function is too big to be inlined the function is
warned about but if it is okay 
to be inlined it will be inlined and not warned about which right now is
causing a bootstrap failure on 
some targets as the warning only applies to some targets only.  Maybe this
warning needs to be done 
earlier for C and C++ in that needs to be moved into the front-end or moved so
that goes through 
some of these warnings no matter what.

------- Comment #3 From Wolfgang Bangerth 2004-04-18 22:31 -------
From a user's perspective: yes, we want the warning. It is confusing 
if the warning depends on the inlining strategy or optimization flags. 
Besides this, the warning usually shows a real deficiency in user's code, 
which we certainly don't want to paper over just because we inline the 
function. 
W. 

------- Comment #4 From CVS Commits 2004-04-28 20:40 -------
Subject: Bug 15004

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	hubicka@gcc.gnu.org	2004-04-28 20:40:55

Modified files:
	gcc            : ChangeLog Makefile.in cgraphunit.c function.c 
	                 function.h 
	gcc/testsuite  : ChangeLog 
Added files:
	gcc/testsuite/gcc.dg: unused-6.c 

Log message:
	* gcc.dg/unused-6.c: New test.
	
	PR c/15004
	* function.c (do_warn_unused_parameter): Break out form ...
	(expand_function_end): ... here; warn only when not using cgraphunit.
	* function.h (do_warn_unused_parameter): Declare.
	* cgraphunit.c: Include function.h.
	(cgraph_finalize_function): Do unused parameter warning.
	* Makefile.in (cgraphunit.o): Depend on function.h

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&r1=2.3504&r2=2.3505
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/Makefile.in.diff?cvsroot=gcc&r1=1.1273&r2=1.1274
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cgraphunit.c.diff?cvsroot=gcc&r1=1.55&r2=1.56
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/function.c.diff?cvsroot=gcc&r1=1.512&r2=1.513
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/function.h.diff?cvsroot=gcc&r1=1.112&r2=1.113
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&r1=1.3704&r2=1.3705
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gcc.dg/unused-6.c.diff?cvsroot=gcc&r1=NONE&r2=1.1


------- Comment #5 From Andrew Pinski 2004-04-29 00:17 -------
Fixed on the mainline right now.

------- Comment #6 From CVS Commits 2004-05-05 23:24 -------
Subject: Bug 15004

CVSROOT:	/cvs/gcc
Module name:	gcc
Branch: 	gcc-3_4-branch
Changes by:	hubicka@gcc.gnu.org	2004-05-05 23:24:31

Modified files:
	gcc            : ChangeLog Makefile.in cgraphunit.c function.c 
	                 function.h 

Log message:
	PR c/15004
	* function.c (do_warn_unused_parameter): Break out form ...
	(expand_function_end): ... here; warn only when not using cgraphunit.
	* function.h (do_warn_unused_parameter): Declare.
	* cgraphunit.c: Include function.h.
	(cgraph_finalize_function): Do unused parameter warning.
	* Makefile.in (cgraphunit.o): Depend on function.h

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=2.2326.2.432&r2=2.2326.2.433
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/Makefile.in.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.1223.2.15&r2=1.1223.2.16
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cgraphunit.c.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.46.2.5&r2=1.46.2.6
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/function.c.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.483.4.11&r2=1.483.4.12
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/function.h.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.108.4.2&r2=1.108.4.3


------- Comment #7 From Jan Hubicka 2004-05-05 23:27 -------
Commited a fix to 3.4 branch. 

First Last Prev Next    No search results available      Search page      Enter new bug