[gfortran, committed] Fix minor type issue, remove unnecessary code
Tobias Schlüter
tobias.schlueter@physik.uni-muenchen.de
Sun Jan 16 16:45:00 GMT 2005
After verifying with Paul off-list that I had correctly understood the code,
and that this fix is indeed correct, I committed this under the obviously
correct rule. Bubblestrapped and regtested.
- Tobi
Index: ChangeLog
===================================================================
RCS file: /cvs/gcc/gcc/gcc/fortran/ChangeLog,v
retrieving revision 1.298
diff -u -p -r1.298 ChangeLog
--- ChangeLog 16 Jan 2005 16:15:59 -0000 1.298
+++ ChangeLog 16 Jan 2005 16:42:07 -0000
@@ -19,7 +19,12 @@
gfc_conv_intrinsic_trim, gfc_conv_intrinsic_iargc): Use
'build_int_cst' instead of converting 'integer_zero_node' or
'integer_one_node' respectively.
-
+
+ * trans-intrinsic.c (gfc_conv_intrinsic_index,
+ gfc_conv_intrinsic_scan, gfc_conv_intrinsic_verify): Remove
+ 'gfc'-prefix from local variable, remove dead code, use correct
+ type when inserting argument.
+
2005-01-16 Steven G. Kargl <kargls@comcast.net>
PR 19168
Index: trans-intrinsic.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/fortran/trans-intrinsic.c,v
retrieving revision 1.40
diff -u -p -r1.40 trans-intrinsic.c
--- trans-intrinsic.c 16 Jan 2005 16:16:00 -0000 1.40
+++ trans-intrinsic.c 16 Jan 2005 16:42:07 -0000
@@ -1959,7 +1959,7 @@ gfc_conv_intrinsic_len_trim (gfc_se * se
static void
gfc_conv_intrinsic_index (gfc_se * se, gfc_expr * expr)
{
- tree gfc_logical4_type_node = gfc_get_logical_type (4);
+ tree logical4_type_node = gfc_get_logical_type (4);
tree args;
tree back;
tree type;
@@ -1970,14 +1970,14 @@ gfc_conv_intrinsic_index (gfc_se * se, g
tmp = gfc_advance_chain (args, 3);
if (TREE_CHAIN (tmp) == NULL_TREE)
{
- back = convert (gfc_logical4_type_node, integer_one_node);
- back = tree_cons (NULL_TREE, integer_zero_node, NULL_TREE);
+ back = tree_cons (NULL_TREE, build_int_cst (logical4_type_node, 0),
+ NULL_TREE);
TREE_CHAIN (tmp) = back;
}
else
{
back = TREE_CHAIN (tmp);
- TREE_VALUE (back) = convert (gfc_logical4_type_node, TREE_VALUE (back));
+ TREE_VALUE (back) = convert (logical4_type_node, TREE_VALUE (back));
}
se->expr = gfc_build_function_call (gfor_fndecl_string_index, args);
@@ -2276,7 +2276,7 @@ gfc_conv_associated (gfc_se *se, gfc_exp
static void
gfc_conv_intrinsic_scan (gfc_se * se, gfc_expr * expr)
{
- tree gfc_logical4_type_node = gfc_get_logical_type (4);
+ tree logical4_type_node = gfc_get_logical_type (4);
tree args;
tree back;
tree type;
@@ -2287,14 +2287,14 @@ gfc_conv_intrinsic_scan (gfc_se * se, gf
tmp = gfc_advance_chain (args, 3);
if (TREE_CHAIN (tmp) == NULL_TREE)
{
- back = convert (gfc_logical4_type_node, integer_one_node);
- back = tree_cons (NULL_TREE, integer_zero_node, NULL_TREE);
+ back = tree_cons (NULL_TREE, build_int_cst (logical4_type_node, 0),
+ NULL_TREE);
TREE_CHAIN (tmp) = back;
}
else
{
back = TREE_CHAIN (tmp);
- TREE_VALUE (back) = convert (gfc_logical4_type_node, TREE_VALUE (back));
+ TREE_VALUE (back) = convert (logical4_type_node, TREE_VALUE (back));
}
se->expr = gfc_build_function_call (gfor_fndecl_string_scan, args);
@@ -2309,7 +2309,7 @@ gfc_conv_intrinsic_scan (gfc_se * se, gf
static void
gfc_conv_intrinsic_verify (gfc_se * se, gfc_expr * expr)
{
- tree gfc_logical4_type_node = gfc_get_logical_type (4);
+ tree logical4_type_node = gfc_get_logical_type (4);
tree args;
tree back;
tree type;
@@ -2320,14 +2320,14 @@ gfc_conv_intrinsic_verify (gfc_se * se,
tmp = gfc_advance_chain (args, 3);
if (TREE_CHAIN (tmp) == NULL_TREE)
{
- back = convert (gfc_logical4_type_node, integer_one_node);
- back = tree_cons (NULL_TREE, integer_zero_node, NULL_TREE);
+ back = tree_cons (NULL_TREE, build_int_cst (logical4_type_node, 0),
+ NULL_TREE);
TREE_CHAIN (tmp) = back;
}
else
{
back = TREE_CHAIN (tmp);
- TREE_VALUE (back) = convert (gfc_logical4_type_node, TREE_VALUE (back));
+ TREE_VALUE (back) = convert (logical4_type_node, TREE_VALUE (back));
}
se->expr = gfc_build_function_call (gfor_fndecl_string_verify, args);
More information about the Fortran
mailing list