[patch, fortran] PR Detect same values in vector expression subscripts

Thomas Koenig tkoenig@netcologne.de
Sun Jul 28 12:58:00 GMT 2013


Hello world,

this patch yields an error for identical values in vector expression
subscripts.  The algorithm is O(n**2) because

a) It would be impossible to detect a([i,i]) otherwise
b) This is not likely to be a performance bottleneck because
    people don't use large vector indices.

(as noted by the different comments in the PR).

Regression-tested.  OK for trunk?

	Thomas

2013-07-28  Thomas Koenig  <tkoenig@gcc.gnu.org>

         PR fortran/58009
         * expr.c (gfc_check_vardef_context):  Check for same values in
         vector expression subscripts.

2013-07-28  Thomas Koenig  <tkoenig@gcc.gnu.org>

         PR fortran/58009
         * gfortran.dg/vector_subsript_7.f90:  New test.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: p1.diff
Type: text/x-patch
Size: 1777 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20130728/600f50ea/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: vector_subscript_7.f90
Type: text/x-fortran
Size: 587 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20130728/600f50ea/attachment-0001.bin>


More information about the Fortran mailing list