Commit 4ada538b by Mark Mitchell Committed by Mark Mitchell

c-decl.c (grokdeclarator): Do not complain about redeclaring visible "static"…

c-decl.c (grokdeclarator): Do not complain about redeclaring visible "static" identifiers "extern" in a...

	* c-decl.c (grokdeclarator): Do not complain about redeclaring
	visible "static" identifiers "extern" in a local scope.

	* dwarf2out.c (loc_descriptor_from_tree): Handle pre- and
	post-increments/decrements.

	* gcc.dg/local1.c: New test.

	* gcc.dg/debug/dwarf2/c99-typedef1.c: New test.

From-SVN: r79634
parent 79e9ebdc
2004-03-18 Mark Mitchell <mark@codesourcery.com>
* c-decl.c (grokdeclarator): Do not complain about redeclaring
visible "static" identifiers "extern" in a local scope.
* dwarf2out.c (loc_descriptor_from_tree): Handle pre- and
post-increments/decrements.
2004-03-18 Bob Wilson <bob.wilson@acm.org> 2004-03-18 Bob Wilson <bob.wilson@acm.org>
* config/xtensa/xtensa.c (current_function_arg_words): Delete. * config/xtensa/xtensa.c (current_function_arg_words): Delete.
......
...@@ -4416,7 +4416,7 @@ grokdeclarator (tree declarator, tree declspecs, ...@@ -4416,7 +4416,7 @@ grokdeclarator (tree declarator, tree declspecs,
/* It is invalid to create an `extern' declaration for a /* It is invalid to create an `extern' declaration for a
variable if there is a global declaration that is variable if there is a global declaration that is
`static'. */ `static' and the global declaration is not visible. */
if (extern_ref && current_scope != global_scope) if (extern_ref && current_scope != global_scope)
{ {
tree global_decl; tree global_decl;
...@@ -4424,6 +4424,7 @@ grokdeclarator (tree declarator, tree declspecs, ...@@ -4424,6 +4424,7 @@ grokdeclarator (tree declarator, tree declspecs,
global_decl = identifier_global_value (declarator); global_decl = identifier_global_value (declarator);
if (global_decl if (global_decl
&& TREE_CODE (global_decl) == VAR_DECL && TREE_CODE (global_decl) == VAR_DECL
&& lookup_name (declarator) != global_decl
&& !TREE_PUBLIC (global_decl)) && !TREE_PUBLIC (global_decl))
error ("variable previously declared `static' redeclared " error ("variable previously declared `static' redeclared "
"`extern'"); "`extern'");
......
...@@ -8716,6 +8716,13 @@ loc_descriptor_from_tree (tree loc, int addressp) ...@@ -8716,6 +8716,13 @@ loc_descriptor_from_tree (tree loc, int addressp)
case CALL_EXPR: case CALL_EXPR:
return 0; return 0;
case PREINCREMENT_EXPR:
case PREDECREMENT_EXPR:
case POSTINCREMENT_EXPR:
case POSTDECREMENT_EXPR:
/* There are no opcodes for these operations. */
return 0;
case ADDR_EXPR: case ADDR_EXPR:
/* We can support this only if we can look through conversions and /* We can support this only if we can look through conversions and
find an INDIRECT_EXPR. */ find an INDIRECT_EXPR. */
......
2004-03-18 Mark Mitchell <mark@codesourcery.com>
* gcc.dg/local1.c: New test.
* gcc.dg/debug/dwarf2/c99-typedef1.c: New test.
2004-03-17 Kaveh R. Ghazi <ghazi@caip.rutgers.edu> 2004-03-17 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* gcc.dg/torture/builtin-convert-1.c: New test. * gcc.dg/torture/builtin-convert-1.c: New test.
......
// { dg-options "-std=iso9899:1999 -gdwarf-2" }
void f() {
int n = 3;
typedef int T[n++];
T t;
t[0] = 7;
}
static int i;
extern int i;
static void f() {
extern int i;
}
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