Commit 5ff225fc by Mark Mitchell Committed by Mark Mitchell

varasm.c (make_decl_rtl): Don't allow weak variables to be placed in common.

	* varasm.c (make_decl_rtl): Don't allow weak variables to be
	placed in common.

	* gcc/testsuite/gcc.dg/weak-8.c: New test.

From-SVN: r53798
parent 0f72964f
2002-05-23 Mark Mitchell <mark@codesourcery.com>
* varasm.c (make_decl_rtl): Don't allow weak variables to be
placed in common.
Thu May 23 19:43:41 CEST 2002 Jan Hubicka <jh@suse.cz>
* cfg.c (dump_flow_info): Print results of
......
2002-05-23 Mark Mitchell <mark@codesourcery.com>
* gcc/testsuite/gcc.dg/weak-8.c: New test.
Thu May 23 11:09:26 2002 J"orn Rennecke <joern.rennecke@superh.com>
* gcc.dg/weak-2.c: Allow optional leading underscore
......
/* { dg-do assemble } */
/* COFF does not support weak, and dg doesn't support UNSUPPORTED. */
/* { dg-do assemble { xfail *-*-coff i?86-pc-cygwin h8300-*-hms } } */
__attribute__ ((weak)) int i;
int f() {
return i;
}
......@@ -922,6 +922,10 @@ make_decl_rtl (decl, asmspec)
&& DECL_COMMON (decl))
DECL_COMMON (decl) = 0;
/* Variables can't be both common and weak. */
if (TREE_CODE (decl) == VAR_DECL && DECL_WEAK (decl))
DECL_COMMON (decl) = 0;
/* Can't use just the variable's own name for a variable
whose scope is less than the whole file, unless it's a member
of a local class (which will already be unambiguous).
......
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