aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
Diffstat (limited to 'gcc')
-rw-r--r--gcc/fortran/ChangeLog5
-rw-r--r--gcc/fortran/trans-common.c7
2 files changed, 10 insertions, 2 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog
index c8ec87a..1b9b295 100644
--- a/gcc/fortran/ChangeLog
+++ b/gcc/fortran/ChangeLog
@@ -1,3 +1,8 @@
+2008-04-18 Jerry DeLisle <jvdelisle@gcc.gnu.org>
+
+ PR fortran/35724
+ * trans-common.c (create_common): Revert patch causing regression.
+
2008-04-16 Jerry DeLisle <jvdelisle@gcc.gnu.org>
PR fortran/35724
diff --git a/gcc/fortran/trans-common.c b/gcc/fortran/trans-common.c
index f7042cb..d7e3e64 100644
--- a/gcc/fortran/trans-common.c
+++ b/gcc/fortran/trans-common.c
@@ -686,8 +686,11 @@ create_common (gfc_common_head *com, segment_info *head, bool saw_equiv)
TREE_ADDRESSABLE (var_decl) = 1;
/* This is a fake variable just for debugging purposes. */
TREE_ASM_WRITTEN (var_decl) = 1;
-
- gfc_add_decl_to_function (var_decl);
+
+ if (com)
+ var_decl = pushdecl_top_level (var_decl);
+ else
+ gfc_add_decl_to_function (var_decl);
SET_DECL_VALUE_EXPR (var_decl,
fold_build3 (COMPONENT_REF, TREE_TYPE (s->field),