This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: fortran/892: -Wunused complains unnecessarily for COMMON block items
- To: toon at moene dot indiv dot nluug dot nl
- Subject: Re: fortran/892: -Wunused complains unnecessarily for COMMON block items
- From: Richard Henderson <rth at redhat dot com>
- Date: Tue, 28 Nov 2000 14:57:13 -0800
- Cc: gcc-gnats at gcc dot gnu dot org, gcc-patches at gcc dot gnu dot org, gcc-bugs at gcc dot gnu dot org
- References: <20001126162629.21952.qmail@sourceware.cygnus.com>
On Sun, Nov 26, 2000 at 04:26:29PM -0000, toon@moene.indiv.nluug.nl wrote:
> SUBROUTINE SUB
> COMMON /COM/ A
> END
[...]
> unused.f:3: warning: unused variable `a'
Fixed thus.
r~
* com.c (ffecom_member_phase2_): Set TREE_USED on the debugging decl.
Index: com.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/f/com.c,v
retrieving revision 1.99
diff -c -p -d -r1.99 com.c
*** com.c 2000/11/10 20:36:15 1.99
--- com.c 2000/11/28 22:55:36
*************** ffecom_member_phase2_ (ffestorag mst, ff
*** 7110,7115 ****
--- 7110,7116 ----
TREE_STATIC (t) = TREE_STATIC (mt);
DECL_INITIAL (t) = NULL_TREE;
TREE_ASM_WRITTEN (t) = 1;
+ TREE_USED (t) = 1;
DECL_RTL (t)
= gen_rtx (MEM, TYPE_MODE (type),