Commit 6e1b67b3 by Richard Guenther Committed by Richard Biener

trans-array.c (gfc_conv_array_parameter): Use correct types in building COND_EXPRs.

2008-09-04  Richard Guenther  <rguenther@suse.de>

	* trans-array.c (gfc_conv_array_parameter): Use correct types
	in building COND_EXPRs.
	* trans-expr.c (gfc_conv_missing_dummy): Likewise.
	* trans-intrinsics.c (gfc_conv_intrinsic_merge): Likewise.

	* gfortran.dg/internal_pack_4.f90: Adjust pattern.

From-SVN: r140001
parent a524985e
2008-09-04 Richard Guenther <rguenther@suse.de>
* trans-array.c (gfc_conv_array_parameter): Use correct types
in building COND_EXPRs.
* trans-expr.c (gfc_conv_missing_dummy): Likewise.
* trans-intrinsics.c (gfc_conv_intrinsic_merge): Likewise.
2008-09-04 Daniel Kraft <d@domob.eu>
* PR fortran/37099
......
......@@ -5250,8 +5250,9 @@ gfc_conv_array_parameter (gfc_se * se, gfc_expr * expr, gfc_ss * ss, int g77,
if (fsym && fsym->attr.optional && sym && sym->attr.optional)
{
tmp = gfc_conv_expr_present (sym);
ptr = build3 (COND_EXPR, TREE_TYPE (se->expr), tmp, ptr,
null_pointer_node);
ptr = build3 (COND_EXPR, TREE_TYPE (se->expr), tmp,
fold_convert (TREE_TYPE (se->expr), ptr),
fold_convert (TREE_TYPE (se->expr), null_pointer_node));
}
ptr = gfc_evaluate_now (ptr, &se->pre);
......
......@@ -161,7 +161,8 @@ gfc_conv_missing_dummy (gfc_se * se, gfc_expr * arg, gfc_typespec ts, int kind)
tmp = fold_convert (tmp, build_fold_indirect_ref (se->expr));
/* Test for a NULL value. */
tmp = build3 (COND_EXPR, TREE_TYPE (tmp), present, tmp, integer_one_node);
tmp = build3 (COND_EXPR, TREE_TYPE (tmp), present, tmp,
fold_convert (TREE_TYPE (tmp), integer_one_node));
tmp = gfc_evaluate_now (tmp, &se->pre);
se->expr = build_fold_addr_expr (tmp);
}
......
......@@ -2918,7 +2918,8 @@ gfc_conv_intrinsic_merge (gfc_se * se, gfc_expr * expr)
se->string_length = len;
}
type = TREE_TYPE (tsource);
se->expr = fold_build3 (COND_EXPR, type, mask, tsource, fsource);
se->expr = fold_build3 (COND_EXPR, type, mask, tsource,
fold_convert (type, fsource));
}
......
2008-09-04 Richard Guenther <rguenther@suse.de>
* gfortran.dg/internal_pack_4.f90: Adjust pattern.
2008-09-04 Daniel Kraft <d@domob.eu>
PR fortran/37099
......
......@@ -26,6 +26,6 @@ USE M1
CALL S2()
END
! { dg-final { scan-tree-dump-times "a != 0B \\? _gfortran_internal_pack" 1 "original" } }
! { dg-final { scan-tree-dump-times "a != 0B \\? \\\(.*\\\) _gfortran_internal_pack" 1 "original" } }
! { dg-final { scan-tree-dump-times "if \\(a != 0B &&" 1 "original" } }
! { dg-final { cleanup-tree-dump "original" } }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment