public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/58085] New: Wrong indexing of an array in ASSOCIATE
@ 2013-08-05 11:27 vladimir.fuka at gmail dot com
  2013-08-08 17:20 ` [Bug fortran/58085] " dominiq at lps dot ens.fr
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: vladimir.fuka at gmail dot com @ 2013-08-05 11:27 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58085

            Bug ID: 58085
           Summary: Wrong indexing of an array in ASSOCIATE
           Product: gcc
           Version: 4.8.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: vladimir.fuka at gmail dot com

Program:

     real c(3,3)
     associate (x=>shape(c))
       print *,lbound(x)
       print *,ubound(x)
       print *,x(1),x(2)
     end associate
    end

Expected result:
    1
    2
    3 3

Actual result:
     >gfortran-4.7 indresult.f90 
     > ./a.out 
           1
           2
           3   990059265
     >gfortran-4.8 indresult.f90 
     > ./a.out 
           1
           2
           3           0

,but:

     print *,x(0),x(1) ! bound checks off

    -->

     3 3


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug fortran/58085] Wrong indexing of an array in ASSOCIATE
  2013-08-05 11:27 [Bug fortran/58085] New: Wrong indexing of an array in ASSOCIATE vladimir.fuka at gmail dot com
@ 2013-08-08 17:20 ` dominiq at lps dot ens.fr
  2014-04-13 11:56 ` pault at gcc dot gnu.org
  2014-04-13 11:59 ` pault at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: dominiq at lps dot ens.fr @ 2013-08-08 17:20 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58085

Dominique d'Humieres <dominiq at lps dot ens.fr> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2013-08-08
     Ever confirmed|0                           |1

--- Comment #1 from Dominique d'Humieres <dominiq at lps dot ens.fr> ---
Confirmed.


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug fortran/58085] Wrong indexing of an array in ASSOCIATE
  2013-08-05 11:27 [Bug fortran/58085] New: Wrong indexing of an array in ASSOCIATE vladimir.fuka at gmail dot com
  2013-08-08 17:20 ` [Bug fortran/58085] " dominiq at lps dot ens.fr
@ 2014-04-13 11:56 ` pault at gcc dot gnu.org
  2014-04-13 11:59 ` pault at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: pault at gcc dot gnu.org @ 2014-04-13 11:56 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58085

--- Comment #2 from Paul Thomas <pault at gcc dot gnu.org> ---
Author: pault
Date: Sun Apr 13 11:55:49 2014
New Revision: 209346

URL: http://gcc.gnu.org/viewcvs?rev=209346&root=gcc&view=rev
Log:
2014-04-13  Paul Thomas  <pault@gcc.gnu.org>

    PR fortran/58085
    PR fortran/60717
    * trans.h: Add 'use_offset' bitfield to gfc_se.
    * trans-array.c (gfc_conv_expr_descriptor): Use 'use_offset'
    as a trigger to unconditionally recalculate the offset for
    array slices and constant arrays.
    trans-expr.c (gfc_conv_intrinsic_to_class): Use it.
    trans-stmt.c (trans_associate_var): Ditto.
    (gfc_conv_procedure_call): Ditto.

2014-04-13  Paul Thomas  <pault@gcc.gnu.org>

    PR fortran/60717
    * gfortran.dg/unlimited_polymorphic_17.f90: New test.

    PR fortran/58085
    * gfortran.dg/associate_15.f90: New test.

Added:
    branches/gcc-4_9-branch/gcc/testsuite/gfortran.dg/associate_15.f90
   
branches/gcc-4_9-branch/gcc/testsuite/gfortran.dg/unlimited_polymorphic_17.f90
Modified:
    branches/gcc-4_9-branch/gcc/fortran/ChangeLog
    branches/gcc-4_9-branch/gcc/fortran/trans-array.c
    branches/gcc-4_9-branch/gcc/fortran/trans-expr.c
    branches/gcc-4_9-branch/gcc/fortran/trans-stmt.c
    branches/gcc-4_9-branch/gcc/fortran/trans.h
    branches/gcc-4_9-branch/gcc/testsuite/ChangeLog


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug fortran/58085] Wrong indexing of an array in ASSOCIATE
  2013-08-05 11:27 [Bug fortran/58085] New: Wrong indexing of an array in ASSOCIATE vladimir.fuka at gmail dot com
  2013-08-08 17:20 ` [Bug fortran/58085] " dominiq at lps dot ens.fr
  2014-04-13 11:56 ` pault at gcc dot gnu.org
@ 2014-04-13 11:59 ` pault at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: pault at gcc dot gnu.org @ 2014-04-13 11:59 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58085

--- Comment #3 from Paul Thomas <pault at gcc dot gnu.org> ---
Author: pault
Date: Sun Apr 13 11:58:55 2014
New Revision: 209347

URL: http://gcc.gnu.org/viewcvs?rev=209347&root=gcc&view=rev
Log:
2014-04-13  Paul Thomas  <pault@gcc.gnu.org>

    PR fortran/58085
    PR fortran/60717
    * trans.h: Add 'use_offset' bitfield to gfc_se.
    * trans-array.c (gfc_conv_expr_descriptor): Use 'use_offset'
    as a trigger to unconditionally recalculate the offset for
    array slices and constant arrays.
    trans-expr.c (gfc_conv_intrinsic_to_class): Use it.
    trans-stmt.c (trans_associate_var): Ditto.
    (gfc_conv_procedure_call): Ditto.

2014-04-13  Paul Thomas  <pault@gcc.gnu.org>

    PR fortran/60717
    * gfortran.dg/unlimited_polymorphic_17.f90: New test.

    PR fortran/58085
    * gfortran.dg/associate_15.f90: New test.

Added:
    trunk/gcc/testsuite/gfortran.dg/associate_15.f90
    trunk/gcc/testsuite/gfortran.dg/unlimited_polymorphic_17.f90
Modified:
    trunk/gcc/fortran/ChangeLog
    trunk/gcc/fortran/trans-array.c
    trunk/gcc/fortran/trans-expr.c
    trunk/gcc/fortran/trans-stmt.c
    trunk/gcc/fortran/trans.h
    trunk/gcc/testsuite/ChangeLog


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2014-04-13 11:59 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-08-05 11:27 [Bug fortran/58085] New: Wrong indexing of an array in ASSOCIATE vladimir.fuka at gmail dot com
2013-08-08 17:20 ` [Bug fortran/58085] " dominiq at lps dot ens.fr
2014-04-13 11:56 ` pault at gcc dot gnu.org
2014-04-13 11:59 ` pault at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).