This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Reintroduce repeat field for ctors (PR fortran/49540)


On 06/29/2011 11:35 PM, Jakub Jelinek wrote:
Bootstrapped/regtested on x86_64-linux and i686-linux.  Ok for trunk
and after a while for 4.6 too?

OK - thanks for the quick patch!


@@ -4608,29 +4608,56 @@ gfc_conv_array_initializer (tree type, g
              index = gfc_conv_mpz_to_tree (c->offset, gfc_index_integer_kind);
            else
              index = NULL_TREE;
+	  if (mpz_cmp_si (c->repeat, 1)>  0)

Minute nit: The indenting of the 4 lines _before_ your added line are wrong (space vs. tab), additionally, I find it more readable with an empty line before "if".


Tobias

PS: Unrelated to the patch - and thus not preventing its committal, nor do you need to fix them all: The following issues were found when looking at the patch and the PR.

- ME: The patch uses RANGE_EXPR, which shows up in the dump as "static integer(kind=4) a[40] = {0};" to avoid confusion with "DATA A(1)/0/", it should use, e.g., "= {[0...39] = 0}".

- ME: "= { }" (e.g. "integer, save :: A(3) = 0") and RANGE_EXPR "= {0}" (e.g. "integer :: A(3); data a/3*0/" - using this patch): The two forms are identically and thus could be normalized. (Don't know whether it makes a difference to the ME itself, it probably doesn't.)

- FE: For assignments of a scalar to a (static) array, one should use RANGE_EXPR. Advantage: It cleans up the tree dump and reduces the memory consumption. Currently, only 0 initialization is handled (which is arguably most important as .bss and memset exist).

- FE: Several compilers - including gfortran - accept double initialization. Expected:
* A warning is always printed (as some other compilers do) - or at least with -Wall. Currently, only -std=f2008 produces an error and -pedantic a warning
* The order of double initialization should be changed to match gfortran 4.1, other compilers, and the naive expectation. (The order of 4.6-4.7 differs from both 4.1 and from 4.3-4.5.) Cf. PR fortran/49586


- FE: DATA initialization to an array vector section does not work (ICE: Not yet implemented). Cf. PR fortran/49588


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]