trans-intrinsic.c (gfc_conv_intrinsic_loc): Make LOC return a signed integer node.

* trans-intrinsic.c (gfc_conv_intrinsic_loc): Make LOC return a
	signed integer node.

From-SVN: r118151
This commit is contained in:
Francois-Xavier Coudert 2006-10-29 18:05:37 +01:00 committed by François-Xavier Coudert
parent 2c693a24a0
commit 0f8bc3e173
2 changed files with 8 additions and 5 deletions

View File

@ -1,3 +1,8 @@
2006-10-29 Francois-Xavier Coudert <coudert@clipper.ens.fr>
* trans-intrinsic.c (gfc_conv_intrinsic_loc): Make LOC return a
signed integer node.
2006-10-29 Jerry DeLisle <jvdelisle@gcc.gnu.org>
PR fortran/17741

View File

@ -3301,7 +3301,7 @@ gfc_conv_intrinsic_iargc (gfc_se * se, gfc_expr * expr)
gfc_index_integer_kind integer. */
static void
gfc_conv_intrinsic_loc(gfc_se * se, gfc_expr * expr)
gfc_conv_intrinsic_loc (gfc_se * se, gfc_expr * expr)
{
tree temp_var;
gfc_expr *arg_expr;
@ -3315,13 +3315,11 @@ gfc_conv_intrinsic_loc(gfc_se * se, gfc_expr * expr)
gfc_conv_expr_reference (se, arg_expr);
else
gfc_conv_array_parameter (se, arg_expr, ss, 1);
se->expr= convert (gfc_unsigned_type (long_integer_type_node),
se->expr);
se->expr= convert (gfc_get_int_type (gfc_index_integer_kind), se->expr);
/* Create a temporary variable for loc return value. Without this,
we get an error an ICE in gcc/expr.c(expand_expr_addr_expr_1). */
temp_var = gfc_create_var (gfc_unsigned_type (long_integer_type_node),
NULL);
temp_var = gfc_create_var (gfc_get_int_type (gfc_index_integer_kind), NULL);
gfc_add_modify_expr (&se->pre, temp_var, se->expr);
se->expr = temp_var;
}