re PR fortran/35724 (Compile time segmentation fault for CSHIFT with negative third...
authorJerry DeLisle <jvdelisle@gcc.gnu.org>
Sat, 19 Apr 2008 06:34:12 +0000 (06:34 +0000)
committerJerry DeLisle <jvdelisle@gcc.gnu.org>
Sat, 19 Apr 2008 06:34:12 +0000 (06:34 +0000)
2008-04-18  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

PR fortran/35724
* trans-common.c (create_common): Revert patch causing regression.

From-SVN: r134464

gcc/fortran/ChangeLog
gcc/fortran/trans-common.c

index c8ec87acdb11525bf160d42b985bf277a77b3e6e..1b9b29554b23c1b8319797042abb1fbd4b7fb36f 100644 (file)
@@ -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
index f7042cb29d6e05d55259067722f0266fbf8d8159..d7e3e645965fbf166cea4357676af3ce8ef52fd5 100644 (file)
@@ -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),