diff options
author | Bernd Schmidt <bernds@codesourcery.com> | 2014-07-09 10:34:40 +0000 |
---|---|---|
committer | Bernd Schmidt <bernds@gcc.gnu.org> | 2014-07-09 10:34:40 +0000 |
commit | 059345ce40dc68e771f4e38c64597bbe56194551 (patch) | |
tree | 9044910faadc531436a3432208a53c52cf9aa110 /gcc | |
parent | 7bb7b8369311925f717feb1891f42316e06cd676 (diff) | |
download | gcc-059345ce40dc68e771f4e38c64597bbe56194551.zip gcc-059345ce40dc68e771f4e38c64597bbe56194551.tar.gz gcc-059345ce40dc68e771f4e38c64597bbe56194551.tar.bz2 |
Avoid using create_tmp_var for static decls.
* trans-array.c (gfc_build_constant_array_constructor): Build a
static decl manually.
* trans-decl.c (create_main_function): Likewise.
From-SVN: r212388
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/fortran/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/fortran/trans-array.c | 6 | ||||
-rw-r--r-- | gcc/fortran/trans-decl.c | 7 |
3 files changed, 17 insertions, 2 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index 4d9f0c3..daf0040 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,9 @@ +2014-07-09 Bernd Schmidt <bernds@codesourcery.com> + + * trans-array.c (gfc_build_constant_array_constructor): Build a + static decl manually. + * trans-decl.c (create_main_function): Likewise. + 2014-07-07 Paul Thomas <pault@gcc.gnu.org> PR fortran/61459 diff --git a/gcc/fortran/trans-array.c b/gcc/fortran/trans-array.c index 0e01899..c30318a 100644 --- a/gcc/fortran/trans-array.c +++ b/gcc/fortran/trans-array.c @@ -2045,11 +2045,15 @@ gfc_build_constant_array_constructor (gfc_expr * expr, tree type) TREE_CONSTANT (init) = 1; TREE_STATIC (init) = 1; - tmp = gfc_create_var (tmptype, "A"); + tmp = build_decl (input_location, VAR_DECL, create_tmp_var_name ("A"), + tmptype); + DECL_ARTIFICIAL (tmp) = 1; + DECL_IGNORED_P (tmp) = 1; TREE_STATIC (tmp) = 1; TREE_CONSTANT (tmp) = 1; TREE_READONLY (tmp) = 1; DECL_INITIAL (tmp) = init; + pushdecl (tmp); return tmp; } diff --git a/gcc/fortran/trans-decl.c b/gcc/fortran/trans-decl.c index 93c59b1..00ac010 100644 --- a/gcc/fortran/trans-decl.c +++ b/gcc/fortran/trans-decl.c @@ -5383,11 +5383,16 @@ create_main_function (tree fndecl) TREE_STATIC (array) = 1; /* Create a static variable to hold the jump table. */ - var = gfc_create_var (array_type, "options"); + var = build_decl (input_location, VAR_DECL, + create_tmp_var_name ("options"), + array_type); + DECL_ARTIFICIAL (var) = 1; + DECL_IGNORED_P (var) = 1; TREE_CONSTANT (var) = 1; TREE_STATIC (var) = 1; TREE_READONLY (var) = 1; DECL_INITIAL (var) = array; + pushdecl (var); var = gfc_build_addr_expr (build_pointer_type (integer_type_node), var); tmp = build_call_expr_loc (input_location, |