From ca86ddcc240fe3ff90d570a385429dad8eedf846 Mon Sep 17 00:00:00 2001 From: Francois-Xavier Coudert Date: Thu, 6 Jul 2006 19:12:25 +0200 Subject: [PATCH] re PR fortran/27874 (Bad interaction between bounds checking, forall and derived types) PR fortran/27874 * trans-stmt.c (compute_inner_temp_size): Don't perform bounds checking when calculating the bounds of scalarization. From-SVN: r115224 --- gcc/fortran/ChangeLog | 6 ++++++ gcc/fortran/trans-stmt.c | 4 ++++ 2 files changed, 10 insertions(+) diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index e67b9bbc3dcf..38be155b6d10 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,9 @@ +2006-07-06 Francois-Xavier Coudert + + PR fortran/27874 + * trans-stmt.c (compute_inner_temp_size): Don't perform bounds + checking when calculating the bounds of scalarization. + 2006-07-05 Francois-Xavier Coudert PR fortran/20892 diff --git a/gcc/fortran/trans-stmt.c b/gcc/fortran/trans-stmt.c index 4e2f0fdfe2d0..a12316688cb9 100644 --- a/gcc/fortran/trans-stmt.c +++ b/gcc/fortran/trans-stmt.c @@ -1957,6 +1957,7 @@ compute_inner_temp_size (gfc_expr *expr1, gfc_expr *expr2, gfc_loopinfo loop; tree size; int i; + int save_flag; tree tmp; *lss = gfc_walk_expr (expr1); @@ -1989,7 +1990,10 @@ compute_inner_temp_size (gfc_expr *expr1, gfc_expr *expr2, loop.array_parameter = 1; /* Calculate the bounds of the scalarization. */ + save_flag = flag_bounds_check; + flag_bounds_check = 0; gfc_conv_ss_startstride (&loop); + flag_bounds_check = save_flag; gfc_conv_loop_setup (&loop); /* Figure out how many elements we need. */