diff options
author | Tobias Burnus <burnus@net-b.de> | 2014-12-16 20:24:50 +0100 |
---|---|---|
committer | Tobias Burnus <burnus@gcc.gnu.org> | 2014-12-16 20:24:50 +0100 |
commit | 203c7ebffdd7042d9b08d303594eaeb9887ff503 (patch) | |
tree | a4dc2e881c78f7c7ab0768916f6c29c300f13996 /gcc/fortran/trans-expr.c | |
parent | 6a85804bf7b5aaf3288995fd6157af907c4d6ab1 (diff) | |
download | gcc-203c7ebffdd7042d9b08d303594eaeb9887ff503.zip gcc-203c7ebffdd7042d9b08d303594eaeb9887ff503.tar.gz gcc-203c7ebffdd7042d9b08d303594eaeb9887ff503.tar.bz2 |
2014-12-15 Tobias Burnus <burnus@net-b.de>
* lang.opt (fsecond-underscore, frecord-marker=8,
* frecord-marker=4,
frealloc-lhs, freal-8-real-16, freal-8-real-10, freal-8-real-4,
freal-4-real-16, freal-4-real-10, freal-4-real-8, fprotect-parens,
fstack-arrays, fmax-stack-var-size=, fmax-subrecord-length=,
ffrontend-optimize, ffree-line-length-, ffixed-line-length-,
finteger-4-integer-8, fdefault-real-8, fdefault-integer-8,
fdefault-double-8): Add Var() and Init().
* gfortran.h (gfc_option_t): Remove moved flags.
* options.c (gfc_init_options, gfc_handle_option): Ditto.
(gfc_post_options): Update for name change.
* decl.c (gfc_match_old_kind_spec, gfc_match_kind_spec): Handle
flag-name change.
* frontend-passes.c (gfc_run_passes): Ditto.
* module.c (use_iso_fortran_env_module): Ditto.
* primary.c (match_integer_constant, match_real_constant):
* Ditto.
* resolve.c (resolve_ordinary_assign): Ditto.
* scanner.c (gfc_next_char_literal, load_line): Ditto.
* trans-array.c (gfc_trans_allocate_array_storage,
gfc_conv_resolve_dependencies, gfc_trans_auto_array_allocation,
gfc_conv_ss_startstride): Ditto.
* trans-common.c (gfc_sym_mangled_common_id): Ditto.
* trans-decl.c (gfc_sym_mangled_function_id,
create_main_function): Ditto.
* trans-expr.c (gfc_conv_expr_op, gfc_conv_procedure_call,
arrayfunc_assign_needs_temporary, gfc_trans_arrayfunc_assign,
gfc_trans_assignment_1): Ditto.
* trans-stmt.c (gfc_trans_allocate): Ditto.
* trans-types.c (gfc_init_kinds): Ditto.
From-SVN: r218790
Diffstat (limited to 'gcc/fortran/trans-expr.c')
-rw-r--r-- | gcc/fortran/trans-expr.c | 27 |
1 files changed, 10 insertions, 17 deletions
diff --git a/gcc/fortran/trans-expr.c b/gcc/fortran/trans-expr.c index a82203c..143decc 100644 --- a/gcc/fortran/trans-expr.c +++ b/gcc/fortran/trans-expr.c @@ -2653,9 +2653,8 @@ gfc_conv_expr_op (gfc_se * se, gfc_expr * expr) switch (expr->value.op.op) { case INTRINSIC_PARENTHESES: - if ((expr->ts.type == BT_REAL - || expr->ts.type == BT_COMPLEX) - && gfc_option.flag_protect_parens) + if ((expr->ts.type == BT_REAL || expr->ts.type == BT_COMPLEX) + && flag_protect_parens) { gfc_conv_unary_op (PAREN_EXPR, se, expr); gcc_assert (FLOAT_TYPE_P (TREE_TYPE (se->expr))); @@ -5176,7 +5175,7 @@ gfc_conv_procedure_call (gfc_se * se, gfc_symbol * sym, /* If the lhs of an assignment x = f(..) is allocatable and f2003 is allowed, we must do the automatic reallocation. TODO - deal with intrinsics, without using a temporary. */ - if (gfc_option.flag_realloc_lhs + if (flag_realloc_lhs && se->ss && se->ss->loop_chain && se->ss->loop_chain->is_alloc_lhs && !expr->value.function.isym @@ -5214,8 +5213,7 @@ gfc_conv_procedure_call (gfc_se * se, gfc_symbol * sym, f2003 is allowed, we must not generate the function call here but should just send back the results of the mapping. This is signalled by the function ss being flagged. */ - if (gfc_option.flag_realloc_lhs - && se->ss && se->ss->is_alloc_lhs) + if (flag_realloc_lhs && se->ss && se->ss->is_alloc_lhs) { gfc_free_interface_mapping (&mapping); return has_alternate_specifier; @@ -5250,8 +5248,7 @@ gfc_conv_procedure_call (gfc_se * se, gfc_symbol * sym, f2003 is allowed, we must not generate the function call here but should just send back the results of the mapping. This is signalled by the function ss being flagged. */ - if (gfc_option.flag_realloc_lhs - && se->ss && se->ss->is_alloc_lhs) + if (flag_realloc_lhs && se->ss && se->ss->is_alloc_lhs) { gfc_free_interface_mapping (&mapping); return has_alternate_specifier; @@ -7409,9 +7406,7 @@ arrayfunc_assign_needs_temporary (gfc_expr * expr1, gfc_expr * expr2) need a temporary except in the particular case that reallocation on assignment is active and the lhs is allocatable and a target. */ if (expr2->value.function.isym) - return (gfc_option.flag_realloc_lhs - && sym->attr.allocatable - && sym->attr.target); + return (flag_realloc_lhs && sym->attr.allocatable && sym->attr.target); /* If the LHS is a dummy, we need a temporary if it is not INTENT(OUT). */ @@ -7652,7 +7647,7 @@ gfc_trans_arrayfunc_assign (gfc_expr * expr1, gfc_expr * expr2) calls, the array data is freed and the library takes care of allocation. TODO: Add logic of trans-array.c: gfc_alloc_allocatable_for_assignment to the library. */ - if (gfc_option.flag_realloc_lhs + if (flag_realloc_lhs && gfc_is_reallocatable_lhs (expr1) && !gfc_expr_attr (expr1).codimension && !gfc_is_coindexed (expr1) @@ -8312,8 +8307,7 @@ gfc_trans_assignment_1 (gfc_expr * expr1, gfc_expr * expr2, bool init_flag, otherwise the character length of the result is not known. NOTE: This relies on having the exact dependence of the length type parameter available to the caller; gfortran saves it in the .mod files. */ - if (gfc_option.flag_realloc_lhs && expr2->ts.type == BT_CHARACTER - && expr1->ts.deferred) + if (flag_realloc_lhs && expr2->ts.type == BT_CHARACTER && expr1->ts.deferred) gfc_add_block_to_block (&block, &rse.pre); tmp = gfc_trans_scalar_assign (&lse, &rse, expr1->ts, @@ -8325,8 +8319,7 @@ gfc_trans_assignment_1 (gfc_expr * expr1, gfc_expr * expr2, bool init_flag, if (lss == gfc_ss_terminator) { /* F2003: Add the code for reallocation on assignment. */ - if (gfc_option.flag_realloc_lhs - && is_scalar_reallocatable_lhs (expr1)) + if (flag_realloc_lhs && is_scalar_reallocatable_lhs (expr1)) alloc_scalar_allocatable_for_assignment (&block, rse.string_length, expr1, expr2); @@ -8366,7 +8359,7 @@ gfc_trans_assignment_1 (gfc_expr * expr1, gfc_expr * expr2, bool init_flag, } /* F2003: Allocate or reallocate lhs of allocatable array. */ - if (gfc_option.flag_realloc_lhs + if (flag_realloc_lhs && gfc_is_reallocatable_lhs (expr1) && !gfc_expr_attr (expr1).codimension && !gfc_is_coindexed (expr1) |