Commit 74d1a34e by Thomas Koenig

re PR fortran/49693 (Spurious "unused-variable" warnings for COMMON block module variables.)

2012-01-04  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR fortran/49693
	* trans-common.c (create_common): Update copyright years.  Mark
	variables as used to avoid warnings about unused variables in
	common blocks.

2012-01-04  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR fortran/49693
	* gfortran.dg/common_17.f90:  New test.

From-SVN: r182869
parent 925b0ed8
2012-01-04 Thomas Koenig <tkoenig@gcc.gnu.org>
PR fortran/49693
* trans-common.c (create_common): Update copyright years. Mark
variables as used to avoid warnings about unused variables in
common blocks.
2012-01-03 Hans-Peter Nilsson <hp@axis.com>
* gfortran.h (struct gfc_expr): Add missing "struct"
......
/* Common block and equivalence list handling
Copyright (C) 2000, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
Copyright (C) 2000, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
2011, 2012
Free Software Foundation, Inc.
Contributed by Canqun Yang <canqun@nudt.edu.cn>
......@@ -689,7 +690,9 @@ create_common (gfc_common_head *com, segment_info *head, bool saw_equiv)
VAR_DECL, DECL_NAME (s->field),
TREE_TYPE (s->field));
TREE_STATIC (var_decl) = TREE_STATIC (decl);
TREE_USED (var_decl) = TREE_USED (decl);
/* Mark the variable as used in order to avoid warnings about
unused variables. */
TREE_USED (var_decl) = 1;
if (s->sym->attr.use_assoc)
DECL_IGNORED_P (var_decl) = 1;
if (s->sym->attr.target)
......
2012-01-04 Thomas Koenig <tkoenig@gcc.gnu.org>
PR fortran/49693
* gfortran.dg/common_17.f90: New test.
2012-01-04 Richard Guenther <rguenther@suse.de>
PR tree-optimization/49651
......
! { dg-do compile }
! { dg-options "-Wall" }
! PR fortran/49693 - this used to cause a spurious warning for the
! variable in the common block.
! Test case by Stephan Kramer.
module foo
implicit none
integer:: a, b
common a
end module foo
! { dg-final { cleanup-modules "foo" } }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment