Commit a3788c44 by Michael Matz Committed by Michael Matz

re PR fortran/32131 (knowing that stride==1 when using allocated arrays and…

re PR fortran/32131 (knowing that stride==1 when using allocated arrays and escaping allocatable arrays)

fortran/
        PR fortran/32131
        * trans-array.c (gfc_conv_descriptor_stride_get): Return
        constant one for strides in the first dimension of ALLOCATABLE
        arrays.

testsuite/
        PR fortran/32131
        * gfortran.dg/pr32921.f: Adjust.

From-SVN: r149178
parent 3c1832c3
2009-07-02 Michael Matz <matz@suse.de>
PR fortran/32131
* trans-array.c (gfc_conv_descriptor_stride_get): Return
constant one for strides in the first dimension of ALLOCATABLE
arrays.
2009-06-30 Janus Weil <janus@gcc.gnu.org>
PR fortran/40594
......
......@@ -284,6 +284,12 @@ gfc_conv_descriptor_stride (tree desc, tree dim)
tree
gfc_conv_descriptor_stride_get (tree desc, tree dim)
{
tree type = TREE_TYPE (desc);
gcc_assert (GFC_DESCRIPTOR_TYPE_P (type));
if (integer_zerop (dim)
&& GFC_TYPE_ARRAY_AKIND (type) == GFC_ARRAY_ALLOCATABLE)
return gfc_index_one_node;
return gfc_conv_descriptor_stride (desc, dim);
}
......
2009-07-02 Michael Matz <matz@suse.de>
PR fortran/32131
* gfortran.dg/pr32921.f: Adjust.
2009-07-02 Jan Hubicka <jh@suse.cz>
* gcc.dg/tree-ssa/local-pure-const.c: New testcase.
......
......@@ -45,5 +45,5 @@
RETURN
END
! { dg-final { scan-tree-dump-times "stride" 6 "lim" } }
! { dg-final { scan-tree-dump-times "stride" 4 "lim" } }
! { dg-final { cleanup-tree-dump "lim" } }
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