From 6c0c6ecc6fef374ff4dea99f42bc2e35d1ba03c6 Mon Sep 17 00:00:00 2001 From: Jerry DeLisle Date: Sat, 19 Apr 2008 06:34:12 +0000 Subject: re PR fortran/35724 (Compile time segmentation fault for CSHIFT with negative third arg) 2008-04-18 Jerry DeLisle PR fortran/35724 * trans-common.c (create_common): Revert patch causing regression. From-SVN: r134464 --- gcc/fortran/ChangeLog | 5 +++++ gcc/fortran/trans-common.c | 7 +++++-- 2 files changed, 10 insertions(+), 2 deletions(-) (limited to 'gcc') 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 + + PR fortran/35724 + * trans-common.c (create_common): Revert patch causing regression. + 2008-04-16 Jerry DeLisle 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), -- cgit v1.1