diff options
author | Roger Sayle <sayle@gcc.gnu.org> | 2007-02-18 20:05:00 +0000 |
---|---|---|
committer | Roger Sayle <sayle@gcc.gnu.org> | 2007-02-18 20:05:00 +0000 |
commit | 61a04b5b59974a336e436f0aac7d0e4353007dc9 (patch) | |
tree | e0bd20d27931c0f092bc30265db72ff3f635d2eb /gcc/fortran/trans-intrinsic.c | |
parent | 9bffa1718a6f2edeeec1aec1f4afef0ff69584ce (diff) | |
download | gcc-61a04b5b59974a336e436f0aac7d0e4353007dc9.zip gcc-61a04b5b59974a336e436f0aac7d0e4353007dc9.tar.gz gcc-61a04b5b59974a336e436f0aac7d0e4353007dc9.tar.bz2 |
trans-array.c (gfc_build_constant_array_constructor): When the shape of the constructor is known...
* trans-array.c (gfc_build_constant_array_constructor): When the
shape of the constructor is known, use that to construct the
gfc_array_spec.
(gfc_trans_constant_array_constructor): Initialize the "info"
information for all of the dimensions of the array constructor.
(constant_array_constructor_loop_size): New function.
(gfc_trans_array_constructor): Use it to determine whether a
loop is suitable for "constant array constructor" optimization.
* trans-intrinsic.c (gfc_conv_intrinsic_anyall): Use fold_build2
instead of build2, to avoid conditions like "(a != b) != 0".
* gfortran.dg/array_constructor_15.f90: New test case.
From-SVN: r122103
Diffstat (limited to 'gcc/fortran/trans-intrinsic.c')
-rw-r--r-- | gcc/fortran/trans-intrinsic.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/gcc/fortran/trans-intrinsic.c b/gcc/fortran/trans-intrinsic.c index e6bc46f..c041b63 100644 --- a/gcc/fortran/trans-intrinsic.c +++ b/gcc/fortran/trans-intrinsic.c @@ -1604,8 +1604,8 @@ gfc_conv_intrinsic_anyall (gfc_se * se, gfc_expr * expr, int op) gfc_conv_expr_val (&arrayse, actual->expr); gfc_add_block_to_block (&body, &arrayse.pre); - tmp = build2 (op, boolean_type_node, arrayse.expr, - build_int_cst (TREE_TYPE (arrayse.expr), 0)); + tmp = fold_build2 (op, boolean_type_node, arrayse.expr, + build_int_cst (TREE_TYPE (arrayse.expr), 0)); tmp = build3_v (COND_EXPR, tmp, found, build_empty_stmt ()); gfc_add_expr_to_block (&body, tmp); gfc_add_block_to_block (&body, &arrayse.post); |