diff options
Diffstat (limited to 'gcc/fortran/trans-array.c')
-rw-r--r-- | gcc/fortran/trans-array.c | 53 |
1 files changed, 8 insertions, 45 deletions
diff --git a/gcc/fortran/trans-array.c b/gcc/fortran/trans-array.c index e281619741d..bd77eb46850 100644 --- a/gcc/fortran/trans-array.c +++ b/gcc/fortran/trans-array.c @@ -99,43 +99,6 @@ static gfc_ss *gfc_walk_subexpr (gfc_ss *, gfc_expr *); static gfc_ss gfc_ss_terminator_var; gfc_ss * const gfc_ss_terminator = &gfc_ss_terminator_var; -unsigned HOST_WIDE_INT gfc_stack_space_left; - - -/* Returns true if a variable of specified size should go on the stack. */ - -int -gfc_can_put_var_on_stack (tree size) -{ - unsigned HOST_WIDE_INT low; - - if (!INTEGER_CST_P (size)) - return 0; - - if (gfc_option.flag_max_stack_var_size < 0) - return 1; - - if (TREE_INT_CST_HIGH (size) != 0) - return 0; - - low = TREE_INT_CST_LOW (size); - if (low > (unsigned HOST_WIDE_INT) gfc_option.flag_max_stack_var_size) - return 0; - -/* TODO: Set a per-function stack size limit. */ -#if 0 - /* We should be a bit more clever with array temps. */ - if (gfc_option.flag_max_function_vars_size >= 0) - { - if (low > gfc_stack_space_left) - return 0; - - gfc_stack_space_left -= low; - } -#endif - - return 1; -} static tree gfc_array_dataptr_type (tree desc) @@ -1271,7 +1234,7 @@ gfc_conv_ss_descriptor (stmtblock_t * block, gfc_ss * ss, int base) /* Also the data pointer. */ tmp = gfc_conv_array_data (se.expr); /* If this is a variable or address of a variable we use it directly. - Otherwise we must evaluate it now to to avoid break dependency + Otherwise we must evaluate it now to avoid breaking dependency analysis by pulling the expressions for elemental array indices inside the loop. */ if (!(DECL_P (tmp) @@ -3071,7 +3034,7 @@ gfc_trans_auto_array_allocation (tree decl, gfc_symbol * sym, tree fnbody) gcc_assert (!sym->attr.use_assoc); gcc_assert (!TREE_STATIC (decl)); - gcc_assert (!sym->module[0]); + gcc_assert (!sym->module); if (sym->ts.type == BT_CHARACTER && !INTEGER_CST_P (sym->ts.cl->backend_decl)) @@ -4194,18 +4157,18 @@ gfc_walk_op_expr (gfc_ss * ss, gfc_expr * expr) gfc_ss *head2; gfc_ss *newss; - head = gfc_walk_subexpr (ss, expr->op1); - if (expr->op2 == NULL) + head = gfc_walk_subexpr (ss, expr->value.op.op1); + if (expr->value.op.op2 == NULL) head2 = head; else - head2 = gfc_walk_subexpr (head, expr->op2); + head2 = gfc_walk_subexpr (head, expr->value.op.op2); /* All operands are scalar. Pass back and let the caller deal with it. */ if (head2 == ss) return head2; /* All operands require scalarization. */ - if (head != ss && (expr->op2 == NULL || head2 != head)) + if (head != ss && (expr->value.op.op2 == NULL || head2 != head)) return head2; /* One of the operands needs scalarization, the other is scalar. @@ -4223,7 +4186,7 @@ gfc_walk_op_expr (gfc_ss * ss, gfc_expr * expr) gcc_assert (head); newss->next = ss; head->next = newss; - newss->expr = expr->op1; + newss->expr = expr->value.op.op1; } else /* head2 == head */ { @@ -4231,7 +4194,7 @@ gfc_walk_op_expr (gfc_ss * ss, gfc_expr * expr) /* Second operand is scalar. */ newss->next = head2; head2 = newss; - newss->expr = expr->op2; + newss->expr = expr->value.op.op2; } return head2; |