diff options
author | Mark Mitchell <mark@codesourcery.com> | 2004-03-18 18:58:08 +0000 |
---|---|---|
committer | Mark Mitchell <mmitchel@gcc.gnu.org> | 2004-03-18 18:58:08 +0000 |
commit | 4ada538bd6381192f941d50068463fcf84775d76 (patch) | |
tree | 04de0b96dfb183513bec30c4171b9fce14927dd4 | |
parent | 79e9ebdc7db0be1cd866c3ab3d219053b46835d8 (diff) | |
download | gcc-4ada538bd6381192f941d50068463fcf84775d76.zip gcc-4ada538bd6381192f941d50068463fcf84775d76.tar.gz gcc-4ada538bd6381192f941d50068463fcf84775d76.tar.bz2 |
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
-rw-r--r-- | gcc/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/c-decl.c | 3 | ||||
-rw-r--r-- | gcc/dwarf2out.c | 7 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/debug/dwarf2/c99-typedef1.c | 9 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/local1.c | 7 |
6 files changed, 38 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index d55df0a..fe19b78 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +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> * config/xtensa/xtensa.c (current_function_arg_words): Delete. diff --git a/gcc/c-decl.c b/gcc/c-decl.c index e59789b..9589d54 100644 --- a/gcc/c-decl.c +++ b/gcc/c-decl.c @@ -4416,7 +4416,7 @@ grokdeclarator (tree declarator, tree declspecs, /* It is invalid to create an `extern' declaration for a 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) { tree global_decl; @@ -4424,6 +4424,7 @@ grokdeclarator (tree declarator, tree declspecs, global_decl = identifier_global_value (declarator); if (global_decl && TREE_CODE (global_decl) == VAR_DECL + && lookup_name (declarator) != global_decl && !TREE_PUBLIC (global_decl)) error ("variable previously declared `static' redeclared " "`extern'"); diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c index cb28ffc..88a06e2 100644 --- a/gcc/dwarf2out.c +++ b/gcc/dwarf2out.c @@ -8716,6 +8716,13 @@ loc_descriptor_from_tree (tree loc, int addressp) case CALL_EXPR: 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: /* We can support this only if we can look through conversions and find an INDIRECT_EXPR. */ diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index b2f0ee11..b7ff475 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,9 @@ +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> * gcc.dg/torture/builtin-convert-1.c: New test. diff --git a/gcc/testsuite/gcc.dg/debug/dwarf2/c99-typedef1.c b/gcc/testsuite/gcc.dg/debug/dwarf2/c99-typedef1.c new file mode 100644 index 0000000..b7bd66a --- /dev/null +++ b/gcc/testsuite/gcc.dg/debug/dwarf2/c99-typedef1.c @@ -0,0 +1,9 @@ +// { dg-options "-std=iso9899:1999 -gdwarf-2" } + +void f() { + int n = 3; + typedef int T[n++]; + + T t; + t[0] = 7; +} diff --git a/gcc/testsuite/gcc.dg/local1.c b/gcc/testsuite/gcc.dg/local1.c new file mode 100644 index 0000000..700070a --- /dev/null +++ b/gcc/testsuite/gcc.dg/local1.c @@ -0,0 +1,7 @@ +static int i; + +extern int i; + +static void f() { + extern int i; +} |