Fix PR 17408 and PR 17409.

From-SVN: r87468
This commit is contained in:
Dale Johannesen 2004-09-14 00:35:02 +00:00 committed by Dale Johannesen
parent 3590f0a64a
commit c1bbfd3cf8
4 changed files with 21 additions and 2 deletions

View File

@ -1,3 +1,10 @@
2004-09-13 Dale Johannesen <dalej@apple.com>
PR 17408
PR 17409
* c-decl.c (start_decl): Repair TREE_STATIC for initialized
objects declared extern.
2004-09-14 Paul Brook <paul@codesourcery.com>
* config/arm/arm.c (arm_expand_prologue): Make args_to_push a

View File

@ -3012,8 +3012,11 @@ start_decl (struct c_declarator *declarator, struct c_declspecs *declspecs,
TEM may equal DECL or it may be a previous decl of the same name. */
tem = pushdecl (decl);
if (initialized)
DECL_EXTERNAL (tem) = 0;
if (initialized && DECL_EXTERNAL (tem))
{
DECL_EXTERNAL (tem) = 0;
TREE_STATIC (tem) = 1;
}
return tem;
}

View File

@ -1,3 +1,7 @@
2004-09-13 Dale Johannesen <dalej@apple.com>
* gcc.c-torture/compile/pr17408.c: New test case.
2004-09-13 Mark Mitchell <mark@codesourcery.com>
PR c++/16716

View File

@ -0,0 +1,5 @@
/* PRs 17408 and 17409, with different options. */
extern int t;
extern int t = 0;
void f(){t =0;}
void g(){h(&t);}