summaryrefslogtreecommitdiffstats
path: root/gcc/treelang
diff options
context:
space:
mode:
authorphython <phython@138bc75d-0d04-0410-961f-82ee72b054a4>2005-02-24 16:23:14 +0000
committerphython <phython@138bc75d-0d04-0410-961f-82ee72b054a4>2005-02-24 16:23:14 +0000
commitf0c1043db1df04dbd2fd5ce08c6aa2b7ecf6aaba (patch)
tree57bcaafaa0a3be3d79ad6e767354336a4807b3c7 /gcc/treelang
parent3e0fccfd1ab85fc4a11cfeb80c8d4139e7cb288c (diff)
downloadppe42-gcc-f0c1043db1df04dbd2fd5ce08c6aa2b7ecf6aaba.tar.gz
ppe42-gcc-f0c1043db1df04dbd2fd5ce08c6aa2b7ecf6aaba.zip
2005-02-24 James A. Morrison <phython@gcc.gnu.org>
PR other/19896 * treetree.c (tree_code_create_variable): Initialize DECL_EXTERNAL, TREE_PUBLIC, and TREE_STATIC for var_decl to zero. Don't call rest_of_decl_compilation on static variables. (pushdecl): Put DECL_EXPRs into the current BIND_EXPR for automatic variables. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@95503 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/treelang')
-rw-r--r--gcc/treelang/ChangeLog9
-rw-r--r--gcc/treelang/treetree.c19
2 files changed, 18 insertions, 10 deletions
diff --git a/gcc/treelang/ChangeLog b/gcc/treelang/ChangeLog
index 6d05ce1c9b9..892e3baabc4 100644
--- a/gcc/treelang/ChangeLog
+++ b/gcc/treelang/ChangeLog
@@ -1,5 +1,14 @@
2005-02-24 James A. Morrison <phython@gcc.gnu.org>
+ PR other/19896
+ * treetree.c (tree_code_create_variable): Initialize DECL_EXTERNAL,
+ TREE_PUBLIC, and TREE_STATIC for var_decl to zero. Don't call
+ rest_of_decl_compilation on static variables.
+ (pushdecl): Put DECL_EXPRs into the current BIND_EXPR for automatic
+ variables.
+
+2005-02-24 James A. Morrison <phython@gcc.gnu.org>
+
PR other/19897
* parse.y: (function_prototype): Accept EXTERNAL_REFERENCE_STORAGE.
Move function parameters check from ...
diff --git a/gcc/treelang/treetree.c b/gcc/treelang/treetree.c
index 73dab2d290e..eef293bb2f7 100644
--- a/gcc/treelang/treetree.c
+++ b/gcc/treelang/treetree.c
@@ -545,27 +545,25 @@ tree_code_create_variable (unsigned int storage_class,
DECL_SOURCE_LOCATION (var_decl) = loc;
+ DECL_EXTERNAL (var_decl) = 0;
+ TREE_PUBLIC (var_decl) = 0;
+ TREE_STATIC (var_decl) = 0;
/* Set the storage mode and whether only visible in the same file. */
switch (storage_class)
{
case STATIC_STORAGE:
TREE_STATIC (var_decl) = 1;
- TREE_PUBLIC (var_decl) = 0;
break;
case AUTOMATIC_STORAGE:
- TREE_STATIC (var_decl) = 0;
- TREE_PUBLIC (var_decl) = 0;
break;
case EXTERNAL_DEFINITION_STORAGE:
- TREE_STATIC (var_decl) = 0;
TREE_PUBLIC (var_decl) = 1;
break;
case EXTERNAL_REFERENCE_STORAGE:
DECL_EXTERNAL (var_decl) = 1;
- TREE_PUBLIC (var_decl) = 0;
break;
default:
@@ -575,11 +573,6 @@ tree_code_create_variable (unsigned int storage_class,
/* This should really only be set if the variable is used. */
TREE_USED (var_decl) = 1;
- /* Expand declaration and initial value if any. */
-
- if (TREE_STATIC (var_decl))
- rest_of_decl_compilation (var_decl, 0, 0);
-
TYPE_NAME (TREE_TYPE (var_decl)) = TYPE_NAME (var_type);
return pushdecl (copy_node (var_decl));
}
@@ -1127,6 +1120,12 @@ pushdecl (tree decl)
&& TYPE_NAME (TREE_TYPE (decl)) == 0)
TYPE_NAME (TREE_TYPE (decl)) = DECL_NAME (decl);
+ /* Put automatic variables into the intermediate representation. */
+ if (TREE_CODE (decl) == VAR_DECL && !DECL_EXTERNAL (decl)
+ && !TREE_STATIC (decl) && !TREE_PUBLIC (decl))
+ tree_code_output_expression_statement (build1 (DECL_EXPR, void_type_node,
+ decl),
+ DECL_SOURCE_LOCATION (decl));
return decl;
}
OpenPOWER on IntegriCloud