Patchwork [Fortran-dev,committed] Minor fixes

login
register
mail settings
Submitter Tobias Burnus
Date March 12, 2012, 12:50 p.m.
Message ID <4F5DF102.7000100@net-b.de>
Download mbox | patch
Permalink /patch/146095/
State New
Headers show

Comments

Tobias Burnus - March 12, 2012, 12:50 p.m.
I have committed a fix for one link issue (spurious 
GFC_DESCRIPTOR_STRIDE_BYTES which escaped the renaming to 
GFC_DESCRIPTOR_SM) - and changed "data" to "base_addr" for consistency. 
Rev. 185216.

Additionally, I modified some tree-dump patterns for the extent and for 
the base_addr change.

Result: 192 FAIL lines in 23 test-suite files of which 3 also exist on 
the trunk.


At some point, the extent calculation should be updated. Dumps like the 
following hurt, even if -O1 handles* them:
(((D.1871->dim[0].lower_bound + D.1871->dim[0].extent) + -1) - 
D.1871->dim[0].lower_bound) + 1.
[* maybe -fstrict-overflow and/or -fno-protect-parens is required in 
addition]


Regarding transpose_optimization_2.f90: Here,
     atmp.58.dim[0].lbound = 0;
     atmp.58.dim[0].ubound = 2;
is replaced by
     atmp.58.dim[0].lower_bound = 0;
     atmp.58.dim[0].extent = 3 - atmp.58.dim[0].lower_bound;
which increased the number of "atmp" by 2 (for two dims). Also something 
which could be solved in the front end as both lbound and ubound are 
known at compile time.

Tobias
Paul Richard Thomas - March 12, 2012, 1:36 p.m.
Dear Tobias,


> At some point, the extent calculation should be updated. Dumps like the
> following hurt, even if -O1 handles* them:
> (((D.1871->dim[0].lower_bound + D.1871->dim[0].extent) + -1) -
> D.1871->dim[0].lower_bound) + 1.
> [* maybe -fstrict-overflow and/or -fno-protect-parens is required in
> addition]

It was always the intention that the temporary API, which translates
the present representation to the new, should be replaced in places
where inefficient code is generated.

Well done - you are making good progress on the first stage of
changing the array descriptor.  The next stage should be to get rid of
the inefficiencies such as that above.  Then we can add all the new
fields out side of the dimension array.

Cheers

Paul

Patch

Index: ChangeLog.fortran-dev
===================================================================
--- ChangeLog.fortran-dev	(revision 185220)
+++ ChangeLog.fortran-dev	(working copy)
@@ -1,5 +1,15 @@ 
 2012-03-12  Tobias Burnus  <burnus@net-b.de>
 
+	* assumed_type_2.f90: Change "data" to "base_addr" in
+	scan-tree-dump.
+	* block_2.f08: Ditto.
+	* coarray_lib_token_2.f90: Ditto.
+	* coarray_lib_token_3.f90: Ditto.
+	* coarray_lib_token_4.f90: Ditto.
+	* pr43984.f90: Ditto.
+
+2012-03-12  Tobias Burnus  <burnus@net-b.de>
+
 	* gfortran.dg/coarray_12.f90: Update scan-tree-dump-times.
 	* gfortran.dg/contiguous_3.f90: Ditto.
 	* gfortran.dg/array_section_2.f90: Ditto.
Index: gfortran.dg/assumed_type_2.f90
===================================================================
--- gfortran.dg/assumed_type_2.f90	(revision 185197)
+++ gfortran.dg/assumed_type_2.f90	(working copy)
@@ -152,24 +152,24 @@ 
 ! { dg-final { scan-tree-dump-times "sub_scalar .&array_int.1.," 1 "original" } }
 ! { dg-final { scan-tree-dump-times "sub_scalar .&scalar_t1," 1 "original" } }
 
-! { dg-final { scan-tree-dump-times "sub_scalar .&\\(.\\(real.kind=4..0:. . restrict\\) array_real_alloc.data" 1 "original" } }
-! { dg-final { scan-tree-dump-times "sub_scalar .&\\(.\\(character.kind=1..0:..1:1. .\\) array_char_ptr.data" 1 "original" } }
-! { dg-final { scan-tree-dump-times "sub_scalar .&\\(.\\(struct t2.0:. . restrict\\) array_t2_alloc.data" 1 "original" } }
-! { dg-final { scan-tree-dump-times "sub_scalar .&\\(.\\(struct t3.0:. .\\) array_t3_ptr.data" 1 "original" } }
-! { dg-final { scan-tree-dump-times "sub_scalar .\\(struct t1 .\\) array_class_t1_alloc._data.data" 1 "original" } }
-! { dg-final { scan-tree-dump-times "sub_scalar .\\(struct t1 .\\) array_class_t1_ptr._data.dat" 1 "original" } }a
+! { dg-final { scan-tree-dump-times "sub_scalar .&\\(.\\(real.kind=4..0:. . restrict\\) array_real_alloc.base_addr" 1 "original" } }
+! { dg-final { scan-tree-dump-times "sub_scalar .&\\(.\\(character.kind=1..0:..1:1. .\\) array_char_ptr.base_addr" 1 "original" } }
+! { dg-final { scan-tree-dump-times "sub_scalar .&\\(.\\(struct t2.0:. . restrict\\) array_t2_alloc.base_addr" 1 "original" } }
+! { dg-final { scan-tree-dump-times "sub_scalar .&\\(.\\(struct t3.0:. .\\) array_t3_ptr.base_addr" 1 "original" } }
+! { dg-final { scan-tree-dump-times "sub_scalar .\\(struct t1 .\\) array_class_t1_alloc._data.base_addr" 1 "original" } }
+! { dg-final { scan-tree-dump-times "sub_scalar .\\(struct t1 .\\) array_class_t1_ptr._data.base_addr" 1 "original" } }a
 
 ! { dg-final { scan-tree-dump-times "sub_array_assumed \\(D" 2 "original" } }
 ! { dg-final { scan-tree-dump-times " = _gfortran_internal_pack \\(&parm" 1 "original" } }
 ! { dg-final { scan-tree-dump-times "sub_array_assumed \\(&array_int\\)" 1 "original" } }
-! { dg-final { scan-tree-dump-times "sub_array_assumed \\(\\(real\\(kind=4\\).0:. . restrict\\) array_real_alloc.data" 1 "original" } }
+! { dg-final { scan-tree-dump-times "sub_array_assumed \\(\\(real\\(kind=4\\).0:. . restrict\\) array_real_alloc.base_addr" 1 "original" } }
 ! { dg-final { scan-tree-dump-times " = _gfortran_internal_pack \\(&array_char_ptr\\);" 1 "original" } }
-! { dg-final { scan-tree-dump-times "\\.data = \\(void .\\) &array_t1.0.;" 1 "original" } }
+! { dg-final { scan-tree-dump-times "\\.base_addr = \\(void .\\) &array_t1.0.;" 1 "original" } }
 ! { dg-final { scan-tree-dump-times "sub_array_assumed \\(\\(struct t1.0:. .\\) parm" 1 "original" } }
-! { dg-final { scan-tree-dump-times "sub_array_assumed \\(\\(struct t2.0:. . restrict\\) array_t2_alloc.data\\);" 1 "original" } }
-! { dg-final { scan-tree-dump-times "sub_array_assumed \\(\\(struct t3.0:. .\\) array_t3_ptr.data\\);" 1 "original" } }
-! { dg-final { scan-tree-dump-times "sub_array_assumed \\(\\(struct t1.0:. . restrict\\) array_class_t1_alloc._data.data\\);" 1 "original" } }
-! { dg-final { scan-tree-dump-times "sub_array_assumed \\(\\(struct t1.0:. .\\) array_class_t1_ptr._data.data\\);" 1 "original" } }
+! { dg-final { scan-tree-dump-times "sub_array_assumed \\(\\(struct t2.0:. . restrict\\) array_t2_alloc.base_addr\\);" 1 "original" } }
+! { dg-final { scan-tree-dump-times "sub_array_assumed \\(\\(struct t3.0:. .\\) array_t3_ptr.base_addr\\);" 1 "original" } }
+! { dg-final { scan-tree-dump-times "sub_array_assumed \\(\\(struct t1.0:. . restrict\\) array_class_t1_alloc._data.base_addr\\);" 1 "original" } }
+! { dg-final { scan-tree-dump-times "sub_array_assumed \\(\\(struct t1.0:. .\\) array_class_t1_ptr._data.base_addr\\);" 1 "original" } }
 
 ! { dg-final { scan-tree-dump-times "sub_array_shape \\(&array_real_alloc," 1 "original" } }
 ! { dg-final { scan-tree-dump-times "sub_array_shape \\(&array_char_ptr," 1 "original" } }
Index: gfortran.dg/pr43984.f90
===================================================================
--- gfortran.dg/pr43984.f90	(revision 185197)
+++ gfortran.dg/pr43984.f90	(working copy)
@@ -50,8 +50,8 @@ 
 
 end
 
-! There should be three loads from iyz.data, not four.
+! There should be three loads from iyz.base_addr, not four.
 
-! { dg-final { scan-tree-dump-times "= iyz.data" 3 "pre" } }
+! { dg-final { scan-tree-dump-times "= iyz.base_addr" 3 "pre" } }
 ! { dg-final { cleanup-tree-dump "pre" } }
 ! { dg-final { cleanup-modules "test" } }
Index: gfortran.dg/coarray_lib_token_4.f90
===================================================================
--- gfortran.dg/coarray_lib_token_4.f90	(revision 185197)
+++ gfortran.dg/coarray_lib_token_4.f90	(working copy)
@@ -39,15 +39,15 @@ 
 !
 ! { dg-final { scan-tree-dump-times "foo \\(struct array2_integer\\(kind=4\\) & restrict x, struct array2_integer\\(kind=4\\) & restrict y, integer\\(kind=4\\) & restrict test, void . restrict caf_token.\[0-9\]+, integer\\(kind=.\\) caf_offset.\[0-9\]+, void . restrict caf_token.\[0-9\]+, integer\\(kind=.\\) caf_offset.\[0-9\]+\\)" 1 "original" } }
 !
-! { dg-final { scan-tree-dump-times "bar \\(&parm.\[0-9\]+, caf_token.\[0-9\]+, \\(\\(integer\\(kind=.\\)\\) parm.\[0-9\]+.data - \\(integer\\(kind=.\\)\\) x.\[0-9\]+\\) \\+ caf_offset.\[0-9\]+\\);" 1 "original" } }
-! { d_g-final { scan-tree-dump-times "bar \\(&parm.\[0-9\]+, caf_token.\[0-9\]+, \\(\\(integer\\(kind=.\\) parm.\[0-9\]+.data - \\(integer\\(kind=.\\)\\) x.\[0-9\]+\\) \\+ caf_offset.\[0-9\]+\\);" 1 "original" } }
+! { dg-final { scan-tree-dump-times "bar \\(&parm.\[0-9\]+, caf_token.\[0-9\]+, \\(\\(integer\\(kind=.\\)\\) parm.\[0-9\]+.base_addr - \\(integer\\(kind=.\\)\\) x.\[0-9\]+\\) \\+ caf_offset.\[0-9\]+\\);" 1 "original" } }
+! { d_g-final { scan-tree-dump-times "bar \\(&parm.\[0-9\]+, caf_token.\[0-9\]+, \\(\\(integer\\(kind=.\\) parm.\[0-9\]+.base_addr - \\(integer\\(kind=.\\)\\) x.\[0-9\]+\\) \\+ caf_offset.\[0-9\]+\\);" 1 "original" } }
 !
-! { dg-final { scan-tree-dump-times "expl \\(\\(integer\\(kind=4\\).0:. .\\) parm.\[0-9\]+.data, caf_token.\[0-9\]+, \\(\\(integer\\(kind=.\\)\\) parm.\[0-9\]+.data - \\(\\(integer\\(kind=.\\)\\) y.\[0-9\]+\\) \\+ caf_offset.\[0-9\]+\\);" 0 "original" } }
+! { dg-final { scan-tree-dump-times "expl \\(\\(integer\\(kind=4\\).0:. .\\) parm.\[0-9\]+.base_addr, caf_token.\[0-9\]+, \\(\\(integer\\(kind=.\\)\\) parm.\[0-9\]+.base_addr - \\(\\(integer\\(kind=.\\)\\) y.\[0-9\]+\\) \\+ caf_offset.\[0-9\]+\\);" 0 "original" } }
 !
 ! { dg-final { scan-tree-dump-times "foo \\(&a, &a, &C.\[0-9\]+, a.token, 0, a.token, 0\\);" 1 "original" } }
 !
-! { dg-final { scan-tree-dump-times "foo \\(&parm.\[0-9\]+, &parm.\[0-9\]+, &C.\[0-9\]+, a.token, \\(integer\\(kind=.\\)\\) parm.\[0-9\]+.data - \\(integer\\(kind=.\\)\\) a.data, caf_token.\[0-9\]+, \\(integer\\(kind=.\\)\\) parm.\[0-9\]+.data - \\(integer\\(kind=.\\)\\) b\\);" 1 "original" } }
+! { dg-final { scan-tree-dump-times "foo \\(&parm.\[0-9\]+, &parm.\[0-9\]+, &C.\[0-9\]+, a.token, \\(integer\\(kind=.\\)\\) parm.\[0-9\]+.base_addr - \\(integer\\(kind=.\\)\\) a.base_addr, caf_token.\[0-9\]+, \\(integer\\(kind=.\\)\\) parm.\[0-9\]+.base_addr - \\(integer\\(kind=.\\)\\) b\\);" 1 "original" } }
 !
-! { dg-final { scan-tree-dump-times "foo \\(&parm.\[0-9\]+, &a, &C.\[0-9\]+, caf_token.\[0-9\]+, \\(integer\\(kind=.\\)\\) parm.\[0-9\]+.data - \\(integer\\(kind=.\\)\\) b, a.token, 0\\);" 1 "original" } }
+! { dg-final { scan-tree-dump-times "foo \\(&parm.\[0-9\]+, &a, &C.\[0-9\]+, caf_token.\[0-9\]+, \\(integer\\(kind=.\\)\\) parm.\[0-9\]+.base_addr - \\(integer\\(kind=.\\)\\) b, a.token, 0\\);" 1 "original" } }
 !
 ! { dg-final { cleanup-tree-dump "original" } }
Index: gfortran.dg/block_2.f08
===================================================================
--- gfortran.dg/block_2.f08	(revision 185197)
+++ gfortran.dg/block_2.f08	(working copy)
@@ -35,5 +35,5 @@ 
     IF (str /= "12345") CALL abort ()
   END BLOCK
 END PROGRAM main
-! { dg-final { scan-tree-dump-times "free \\(\\(void \\*\\) alloc_arr\\.data" 1 "original" } }
+! { dg-final { scan-tree-dump-times "free \\(\\(void \\*\\) alloc_arr\\.base_addr" 1 "original" } }
 ! { dg-final { cleanup-tree-dump "original" } }
Index: gfortran.dg/coarray_lib_token_3.f90
===================================================================
--- gfortran.dg/coarray_lib_token_3.f90	(revision 185197)
+++ gfortran.dg/coarray_lib_token_3.f90	(working copy)
@@ -8,6 +8,6 @@ 
 allocate(CAF_SCALAR[*])
 end
 
-! { dg-final { scan-tree-dump-times "caf.data = \\(void . restrict\\) _gfortran_caf_register \\(4, 1, &caf.token, 0B, 0B, 0\\);" 1 "original" } }
-! { dg-final { scan-tree-dump-times "caf_scalar.data = \\(void . restrict\\) _gfortran_caf_register \\(4, 1, &caf_scalar.token, 0B, 0B, 0\\);" 1 "original" } }
+! { dg-final { scan-tree-dump-times "caf.base_addr = \\(void . restrict\\) _gfortran_caf_register \\(4, 1, &caf.token, 0B, 0B, 0\\);" 1 "original" } }
+! { dg-final { scan-tree-dump-times "caf_scalar.base_addr = \\(void . restrict\\) _gfortran_caf_register \\(4, 1, &caf_scalar.token, 0B, 0B, 0\\);" 1 "original" } }
 ! { dg-final { cleanup-tree-dump "original" } }
Index: gfortran.dg/coarray_lib_token_2.f90
===================================================================
--- gfortran.dg/coarray_lib_token_2.f90	(revision 185197)
+++ gfortran.dg/coarray_lib_token_2.f90	(working copy)
@@ -93,10 +93,10 @@ 
 !
 ! CALL 1
 !
-!  sub ((integer(kind=4) *) caf.data, &((struct t * restrict) caf_dt.data)->b,
+!  sub ((integer(kind=4) *) caf.base_addr, &((struct t * restrict) caf_dt.base_addr)->b,
 !       caf.token, 0, caf_dt.token, 4);
 !
-! { dg-final { scan-tree-dump-times "sub \\(\[^,\]*caf.data, &\[^,\]*caf_dt.data.->b, caf.token, 0, caf_dt.token, 4\\)" 1 "original" } }
+! { dg-final { scan-tree-dump-times "sub \\(\[^,\]*caf.base_addr, &\[^,\]*caf_dt.base_addr.->b, caf.token, 0, caf_dt.token, 4\\)" 1 "original" } }
 !
 !  sub2 ((integer(kind=4) *) x1, (integer(kind=4) *) x2,
 !        caf_token.4, NON_LVALUE_EXPR <caf_offset.5>,
@@ -110,7 +110,7 @@ 
 !
 ! CALL 4
 !
-! { dg-final { scan-tree-dump-times "sub_opt \\(.integer.kind=4. .. caf.data, caf.token, 0\\)" 1 "original" } }
+! { dg-final { scan-tree-dump-times "sub_opt \\(.integer.kind=4. .. caf.base_addr, caf.token, 0\\)" 1 "original" } }
 !
 ! { dg-final { cleanup-tree-dump "original" } }
 ! { dg-final { cleanup-modules "matrix_data" } }