This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC 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]

[patch,fortran] PRs 29630 & 29679: Vector subscripts and shapes in initialization expressions


:ADDPATCH fortran:

Here's a patch for PRs 29630 & 29679.

PR 29679 was pretty simple: in expr.c (find_array_section) we added sizes
for all dimensions to the shape array, which is wrong; when dimen_type[d]
== DIMEN_ELEMENT, the rank of the expression becomes reduced, and no size
should be added to the shape array.

For PR 29630 I added code to handle vector subscripts as special cases in
the loops over the rank of the expression in expr.c (find_array_section).

Since the testcases with this patch almost by necessity also checks for PR
29393, I decided to replace initialization_2.f90 rather than add a
separate one.

(Is there, BTW, some way to tell the testing framework that it's enough to
compile the testcase with -O0, rather than going through all optimization
settings?  I tried { dg-options "-O0" }, but it didn't seem to have any
effect.  In initialization_2.f90, all the interesting things happen at
compile time in the frontend.  Testing at several different optimization
settings is just a waste of time.)

Bootstrapped and tested on Linux/x86, on trunk, 4.2 and 4.1.  Ok?


        Erik


2006-11-04  Erik Edelmann  <eedelman@gcc.gnu.org>

        PR fortran/29630
        PR fortran/29679
        * expr.c (find_array_section): Support vector subscripts.  Don't
          add sizes for dimen_type == DIMEN_ELEMENT to the shape array.


2006-11-04  Erik Edelmann  <eedelman@gcc.gnu.org>

        PR fortran/29630
        PR fortran/29679
        * gfortran.dg/initialization_2.f90: Test PRs 29630 and 29679 too.
        * gfortran.dg/initialization_3.f90: New.


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