diff options
| author | matz <matz@138bc75d-0d04-0410-961f-82ee72b054a4> | 2009-08-19 10:17:33 +0000 |
|---|---|---|
| committer | matz <matz@138bc75d-0d04-0410-961f-82ee72b054a4> | 2009-08-19 10:17:33 +0000 |
| commit | e1b3b79beacf0e6747eb7e6a1055d3cd0a436327 (patch) | |
| tree | b794f6439d5a67d4ade17d342bf5bd2bff70ce2f /gcc/fortran/trans-expr.c | |
| parent | 0f156b474f341794275de1527abf3434f1e66539 (diff) | |
| download | ppe42-gcc-e1b3b79beacf0e6747eb7e6a1055d3cd0a436327.tar.gz ppe42-gcc-e1b3b79beacf0e6747eb7e6a1055d3cd0a436327.zip | |
* tree-ssa-structalias.c (create_variable_info_for): Also mark
first field in a struct.
(intra_create_variable_infos): Don't deal with flag_argument_noalias.
fortran/
* trans-expr.c (gfc_conv_substring): Don't evaluate casted decl early,
change order of length calculation to (end - start) + 1.
(gfc_get_interface_mapping_array): Adjust call to
gfc_get_nodesc_array_type.
* trans-array.c (gfc_trans_create_temp_array,
gfc_build_constant_array_constructor, gfc_conv_expr_descriptor): Ditto.
* trans-stmt.c (gfc_trans_pointer_assign_need_temp): Ditto.
* trans.c (gfc_add_modify): Assignment between base type and nontarget
type are equal enough.
(gfc_call_malloc): Use prvoid_type_node for return value of
__builtin_malloc.
(gfc_allocate_with_status): Ditto.
* trans-types.c (gfc_array_descriptor_base): Double size of this array.
(gfc_init_types): Build prvoid_type_node.
(gfc_build_array_type): New bool parameter "restricted".
(gfc_get_nodesc_array_type): Ditto, build restrict qualified pointers,
if it's true.
(gfc_get_array_descriptor_base): Ditto.
(gfc_get_array_type_bounds): Ditto.
(gfc_sym_type): Use symbol attributes to feed calls to above functions.
(gfc_get_derived_type): Ditto.
* trans.h (struct lang_type): Add nontarget_type member.
* trans-types.h (prvoid_type_node): Declare.
(gfc_get_array_type_bounds, gfc_get_nodesc_array_type): Declare new
parameter.
* trans-decl.c (gfc_finish_var_decl): Give scalars that can't be
aliased a type with a different alias set than the base type.
(gfc_build_dummy_array_decl): Adjust call to gfc_get_nodesc_array_type.
testsuite/
* gfortran.dg/vect/vect-gems.f90: New test.
* gcc.dg/tree-ssa/alias-1.c: Remove, it checks something broken.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@150934 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/fortran/trans-expr.c')
| -rw-r--r-- | gcc/fortran/trans-expr.c | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/gcc/fortran/trans-expr.c b/gcc/fortran/trans-expr.c index 144c20441e9..7672f0b092d 100644 --- a/gcc/fortran/trans-expr.c +++ b/gcc/fortran/trans-expr.c @@ -374,8 +374,10 @@ gfc_conv_substring (gfc_se * se, gfc_ref * ref, int kind, gfc_conv_string_parameter (se); else { + tmp = start.expr; + STRIP_NOPS (tmp); /* Avoid multiple evaluation of substring start. */ - if (!CONSTANT_CLASS_P (start.expr) && !DECL_P (start.expr)) + if (!CONSTANT_CLASS_P (tmp) && !DECL_P (tmp)) start.expr = gfc_evaluate_now (start.expr, &se->pre); /* Change the start of the string. */ @@ -397,7 +399,9 @@ gfc_conv_substring (gfc_se * se, gfc_ref * ref, int kind, gfc_conv_expr_type (&end, ref->u.ss.end, gfc_charlen_type_node); gfc_add_block_to_block (&se->pre, &end.pre); } - if (!CONSTANT_CLASS_P (end.expr) && !DECL_P (end.expr)) + tmp = end.expr; + STRIP_NOPS (tmp); + if (!CONSTANT_CLASS_P (tmp) && !DECL_P (tmp)) end.expr = gfc_evaluate_now (end.expr, &se->pre); if (gfc_option.rtcheck & GFC_RTCHECK_BOUNDS) @@ -440,9 +444,9 @@ gfc_conv_substring (gfc_se * se, gfc_ref * ref, int kind, } tmp = fold_build2 (MINUS_EXPR, gfc_charlen_type_node, - build_int_cst (gfc_charlen_type_node, 1), - start.expr); - tmp = fold_build2 (PLUS_EXPR, gfc_charlen_type_node, end.expr, tmp); + end.expr, start.expr); + tmp = fold_build2 (PLUS_EXPR, gfc_charlen_type_node, + build_int_cst (gfc_charlen_type_node, 1), tmp); tmp = fold_build2 (MAX_EXPR, gfc_charlen_type_node, tmp, build_int_cst (gfc_charlen_type_node, 0)); se->string_length = tmp; @@ -1611,7 +1615,9 @@ gfc_get_interface_mapping_array (stmtblock_t * block, gfc_symbol * sym, tree var; type = gfc_typenode_for_spec (&sym->ts); - type = gfc_get_nodesc_array_type (type, sym->as, packed); + type = gfc_get_nodesc_array_type (type, sym->as, packed, + !sym->attr.target && !sym->attr.pointer + && !sym->attr.proc_pointer); var = gfc_create_var (type, "ifm"); gfc_add_modify (block, var, fold_convert (type, data)); |

