trans-array.c (gfc_conv_loop_setup): Test whether the loop stride is one...

* trans-array.c (gfc_conv_loop_setup):  Test whether the loop
	stride is one, to avoid fold_build2 introducing a useless
	NON_LVALUE_EXPR node.

From-SVN: r120500
This commit is contained in:
Roger Sayle 2007-01-05 21:22:05 +00:00 committed by Roger Sayle
parent afe1a916d7
commit c96111c00d
2 changed files with 10 additions and 2 deletions

View File

@ -1,3 +1,9 @@
2007-01-05 Roger Sayle <roger@eyesopen.com>
* trans-array.c (gfc_conv_loop_setup): Test whether the loop
stride is one, to avoid fold_build2 introducing a useless
NON_LVALUE_EXPR node.
2007-01-05 Tobias Burnus <burnus@net-b.de>
* symbol.c (check_conflict): Fix error message.

View File

@ -3141,8 +3141,10 @@ gfc_conv_loop_setup (gfc_loopinfo * loop)
{
/* Calculate the offset relative to the loop variable.
First multiply by the stride. */
tmp = fold_build2 (MULT_EXPR, gfc_array_index_type,
loop->from[n], info->stride[n]);
tmp = loop->from[n];
if (!integer_onep (info->stride[n]))
tmp = fold_build2 (MULT_EXPR, gfc_array_index_type,
tmp, info->stride[n]);
/* Then subtract this from our starting value. */
tmp = fold_build2 (MINUS_EXPR, gfc_array_index_type,