diff options
author | Paul Thomas <pault@gcc.gnu.org> | 2005-06-01 07:18:20 +0000 |
---|---|---|
committer | Paul Thomas <pault@gcc.gnu.org> | 2005-06-01 07:18:20 +0000 |
commit | 13a9737c1920fd99fc6116111cd60b7db0d5590c (patch) | |
tree | 2f78d4cac83d02db9c3f3fa93f5d4f4946f4b00b /gcc | |
parent | bacf5b96edee976363fed3b78ab5923a62cd9bbb (diff) | |
download | gcc-13a9737c1920fd99fc6116111cd60b7db0d5590c.zip gcc-13a9737c1920fd99fc6116111cd60b7db0d5590c.tar.gz gcc-13a9737c1920fd99fc6116111cd60b7db0d5590c.tar.bz2 |
trans-expr.c (gfc_conv_variable): Clean up bracketting.
2005-06-01 Paul Thomas <pault@gcc.gnu.org>
* fortran/trans-expr.c (gfc_conv_variable): Clean up bracketting.
* fortran/trans-expr.c (gfc_conv_function_call): Insert spaces.
Correct comments and replace convert of integer_one_node with
build_int_cst.
From-SVN: r100433
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/fortran/trans-expr.c | 27 |
1 files changed, 14 insertions, 13 deletions
diff --git a/gcc/fortran/trans-expr.c b/gcc/fortran/trans-expr.c index 3d7dc72..52d3703 100644 --- a/gcc/fortran/trans-expr.c +++ b/gcc/fortran/trans-expr.c @@ -365,29 +365,30 @@ gfc_conv_variable (gfc_se * se, gfc_expr * expr) /* Dereference character pointer dummy arguments or results. */ if ((sym->attr.pointer || sym->attr.allocatable) - && ((sym->attr.dummy) - || (sym->attr.function - || sym->attr.result))) + && (sym->attr.dummy + || sym->attr.function + || sym->attr.result)) se->expr = gfc_build_indirect_ref (se->expr); } else { /* Dereference non-character scalar dummy arguments. */ - if ((sym->attr.dummy) && (!sym->attr.dimension)) + if (sym->attr.dummy && !sym->attr.dimension) se->expr = gfc_build_indirect_ref (se->expr); /* Dereference scalar hidden result. */ - if ((gfc_option.flag_f2c && sym->ts.type == BT_COMPLEX) + if (gfc_option.flag_f2c && sym->ts.type == BT_COMPLEX && (sym->attr.function || sym->attr.result) - && (!sym->attr.dimension)) + && !sym->attr.dimension) se->expr = gfc_build_indirect_ref (se->expr); /* Dereference non-character pointer variables. These must be dummies, results, or scalars. */ if ((sym->attr.pointer || sym->attr.allocatable) - && ((sym->attr.dummy) - || (sym->attr.function || sym->attr.result) - || (!sym->attr.dimension))) + && (sym->attr.dummy + || sym->attr.function + || sym->attr.result + || !sym->attr.dimension)) se->expr = gfc_build_indirect_ref (se->expr); } @@ -1121,7 +1122,7 @@ gfc_conv_function_call (gfc_se * se, gfc_symbol * sym, gfc_advance_se_ss_chain (se); /* Bundle in the string length. */ - se->string_length=len; + se->string_length = len; return; } } @@ -1184,12 +1185,12 @@ gfc_conv_function_call (gfc_se * se, gfc_symbol * sym, type = gfc_get_character_type (sym->ts.kind, sym->ts.cl); type = build_pointer_type (type); - /* Return an address to a char[4]* temporary for character pointers. */ + /* Return an address to a char[0:len-1]* temporary for character pointers. */ if (sym->attr.pointer || sym->attr.allocatable) { - /* Build char[4] * pstr. */ + /* Build char[0:len-1] * pstr. */ tmp = fold_build2 (MINUS_EXPR, gfc_charlen_type_node, len, - convert (gfc_charlen_type_node, integer_one_node)); + build_int_cst (gfc_charlen_type_node, 1)); tmp = build_range_type (gfc_array_index_type, gfc_index_zero_node, tmp); tmp = build_array_type (gfc_character1_type_node, tmp); var = gfc_create_var (build_pointer_type (tmp), "pstr"); |