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
This commit is contained in:
parent
0f72964f10
commit
5ff225fc29
@ -1,3 +1,8 @@
|
||||
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
|
||||
|
@ -1,3 +1,7 @@
|
||||
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
|
||||
|
10
gcc/testsuite/gcc.dg/weak-8.c
Normal file
10
gcc/testsuite/gcc.dg/weak-8.c
Normal file
@ -0,0 +1,10 @@
|
||||
/* { 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).
|
||||
|
Loading…
Reference in New Issue
Block a user