public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/57798] [4.8/4.9 Regression] Incorrect handling of sum over first dimension of a product of automatic arrays
       [not found] <bug-57798-4@http.gcc.gnu.org/bugzilla/>
@ 2013-07-03 13:17 ` dominiq at lps dot ens.fr
  2013-08-16 15:40 ` jakub at gcc dot gnu.org
                   ` (7 subsequent siblings)
  8 siblings, 0 replies; 9+ messages in thread
From: dominiq at lps dot ens.fr @ 2013-07-03 13:17 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2013-07-03
            Summary|Incorrect handling of sum   |[4.8/4.9 Regression]
                   |over first dimension of a   |Incorrect handling of sum
                   |product of automatic arrays |over first dimension of a
                   |                            |product of automatic arrays
     Ever confirmed|0                           |1

--- Comment #1 from Dominique d'Humieres <dominiq at lps dot ens.fr> ---
Confirmed. It appeared between revision 190090 (2012-08-02: OK) and 190271
(2012-08-09: wrong bounds). Valgrind reports

==70092== Invalid write of size 4
==70092==    at 0x100000DD1: func.1887 (pr57798.f90:12)
==70092==    by 0x100000C32: sub.1867 (pr57798.f90:21)
==70092==    by 0x100000D2F: MAIN__ (pr57798.f90:4)
==70092==    by 0x100000E1A: main (pr57798.f90:4)
==70092==  Address 0x100440480 is 0 bytes inside a block of size 1 alloc'd
==70092==    at 0x100012679: malloc (vg_replace_malloc.c:266)
==70092==    by 0x100000C0B: sub.1867 (pr57798.f90:21)
==70092==    by 0x100000D2F: MAIN__ (pr57798.f90:4)
==70092==    by 0x100000E1A: main (pr57798.f90:4)


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

* [Bug fortran/57798] [4.8/4.9 Regression] Incorrect handling of sum over first dimension of a product of automatic arrays
       [not found] <bug-57798-4@http.gcc.gnu.org/bugzilla/>
  2013-07-03 13:17 ` [Bug fortran/57798] [4.8/4.9 Regression] Incorrect handling of sum over first dimension of a product of automatic arrays dominiq at lps dot ens.fr
@ 2013-08-16 15:40 ` jakub at gcc dot gnu.org
  2013-08-19 21:07 ` tkoenig at gcc dot gnu.org
                   ` (6 subsequent siblings)
  8 siblings, 0 replies; 9+ messages in thread
From: jakub at gcc dot gnu.org @ 2013-08-16 15:40 UTC (permalink / raw)
  To: gcc-bugs

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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P4
                 CC|                            |jakub at gcc dot gnu.org
   Target Milestone|---                         |4.8.2


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

* [Bug fortran/57798] [4.8/4.9 Regression] Incorrect handling of sum over first dimension of a product of automatic arrays
       [not found] <bug-57798-4@http.gcc.gnu.org/bugzilla/>
  2013-07-03 13:17 ` [Bug fortran/57798] [4.8/4.9 Regression] Incorrect handling of sum over first dimension of a product of automatic arrays dominiq at lps dot ens.fr
  2013-08-16 15:40 ` jakub at gcc dot gnu.org
@ 2013-08-19 21:07 ` tkoenig at gcc dot gnu.org
  2013-08-20  9:41 ` mikael at gcc dot gnu.org
                   ` (5 subsequent siblings)
  8 siblings, 0 replies; 9+ messages in thread
From: tkoenig at gcc dot gnu.org @ 2013-08-19 21:07 UTC (permalink / raw)
  To: gcc-bugs

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

Thomas Koenig <tkoenig at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |mikael at gcc dot gnu.org

--- Comment #2 from Thomas Koenig <tkoenig at gcc dot gnu.org> ---
Mikael,

this seems to be your area of expertise.  Do you have any idea?


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

* [Bug fortran/57798] [4.8/4.9 Regression] Incorrect handling of sum over first dimension of a product of automatic arrays
       [not found] <bug-57798-4@http.gcc.gnu.org/bugzilla/>
                   ` (2 preceding siblings ...)
  2013-08-19 21:07 ` tkoenig at gcc dot gnu.org
@ 2013-08-20  9:41 ` mikael at gcc dot gnu.org
  2013-08-20 10:12 ` mikael at gcc dot gnu.org
                   ` (4 subsequent siblings)
  8 siblings, 0 replies; 9+ messages in thread
From: mikael at gcc dot gnu.org @ 2013-08-20  9:41 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Mikael Morin <mikael at gcc dot gnu.org> ---
(In reply to Thomas Koenig from comment #2)
> Mikael,
> 
> this seems to be your area of expertise.  Do you have any idea?

Hmm, in the dump, D.1917 is initialized to late, just before the inner loop
inside the outer loop, but the first use comes before the outer loop.  I'm
having a look.


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

* [Bug fortran/57798] [4.8/4.9 Regression] Incorrect handling of sum over first dimension of a product of automatic arrays
       [not found] <bug-57798-4@http.gcc.gnu.org/bugzilla/>
                   ` (3 preceding siblings ...)
  2013-08-20  9:41 ` mikael at gcc dot gnu.org
@ 2013-08-20 10:12 ` mikael at gcc dot gnu.org
  2013-08-21 13:56 ` mikael at gcc dot gnu.org
                   ` (3 subsequent siblings)
  8 siblings, 0 replies; 9+ messages in thread
From: mikael at gcc dot gnu.org @ 2013-08-20 10:12 UTC (permalink / raw)
  To: gcc-bugs

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

Mikael Morin <mikael at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
           Assignee|unassigned at gcc dot gnu.org      |mikael at gcc dot gnu.org

--- Comment #4 from Mikael Morin <mikael at gcc dot gnu.org> ---
Created attachment 30677
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=30677&action=edit
Patch moving the preliminary code before the outermost loop.

I suppose the regression appeared at r190097.
I'm the author, but I think the bug was just latent before.
However, as I'm the one who introduced nested loops with sum, I'm the culprit
in any case. :-(

The patch above (against 4.9-20130715) fixes the problem here.


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

* [Bug fortran/57798] [4.8/4.9 Regression] Incorrect handling of sum over first dimension of a product of automatic arrays
       [not found] <bug-57798-4@http.gcc.gnu.org/bugzilla/>
                   ` (4 preceding siblings ...)
  2013-08-20 10:12 ` mikael at gcc dot gnu.org
@ 2013-08-21 13:56 ` mikael at gcc dot gnu.org
  2013-08-23 17:51 ` [Bug fortran/57798] [4.8 " mikael at gcc dot gnu.org
                   ` (2 subsequent siblings)
  8 siblings, 0 replies; 9+ messages in thread
From: mikael at gcc dot gnu.org @ 2013-08-21 13:56 UTC (permalink / raw)
  To: gcc-bugs

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

Mikael Morin <mikael at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                URL|                            |http://gcc.gnu.org/ml/fortr
                   |                            |an/2013-08/msg00059.html

--- Comment #5 from Mikael Morin <mikael at gcc dot gnu.org> ---
Patch submitted:
http://gcc.gnu.org/ml/fortran/2013-08/msg00059.html


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

* [Bug fortran/57798] [4.8 Regression] Incorrect handling of sum over first dimension of a product of automatic arrays
       [not found] <bug-57798-4@http.gcc.gnu.org/bugzilla/>
                   ` (5 preceding siblings ...)
  2013-08-21 13:56 ` mikael at gcc dot gnu.org
@ 2013-08-23 17:51 ` mikael at gcc dot gnu.org
  2013-08-24 12:49 ` [Bug fortran/57798] " mikael at gcc dot gnu.org
  2013-08-24 12:50 ` [Bug fortran/57798] [4.8/4.9 regression] " mikael at gcc dot gnu.org
  8 siblings, 0 replies; 9+ messages in thread
From: mikael at gcc dot gnu.org @ 2013-08-23 17:51 UTC (permalink / raw)
  To: gcc-bugs

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

Mikael Morin <mikael at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|[4.8/4.9 Regression]        |[4.8 Regression] Incorrect
                   |Incorrect handling of sum   |handling of sum over first
                   |over first dimension of a   |dimension of a product of
                   |product of automatic arrays |automatic arrays

--- Comment #6 from Mikael Morin <mikael at gcc dot gnu.org> ---
Author: mikael
Date: Fri Aug 23 17:49:39 2013
New Revision: 201947

URL: http://gcc.gnu.org/viewcvs?rev=201947&root=gcc&view=rev
Log:
fortran/
    PR fortran/57798
    * trans-array.c (gfc_conv_ss_startstride, set_loop_bounds,
    gfc_set_delta): Generate preliminary code before the outermost loop.

testsuite/
    PR fortran/57798
    * gfortran.dg/inline_sum_5.f90: New.


Added:
    trunk/gcc/testsuite/gfortran.dg/inline_sum_5.f90
Modified:
    trunk/gcc/fortran/ChangeLog
    trunk/gcc/fortran/trans-array.c
    trunk/gcc/testsuite/ChangeLog


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

* [Bug fortran/57798] Incorrect handling of sum over first dimension of a product of automatic arrays
       [not found] <bug-57798-4@http.gcc.gnu.org/bugzilla/>
                   ` (6 preceding siblings ...)
  2013-08-23 17:51 ` [Bug fortran/57798] [4.8 " mikael at gcc dot gnu.org
@ 2013-08-24 12:49 ` mikael at gcc dot gnu.org
  2013-08-24 12:50 ` [Bug fortran/57798] [4.8/4.9 regression] " mikael at gcc dot gnu.org
  8 siblings, 0 replies; 9+ messages in thread
From: mikael at gcc dot gnu.org @ 2013-08-24 12:49 UTC (permalink / raw)
  To: gcc-bugs

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

Mikael Morin <mikael at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|[4.8 Regression] Incorrect  |Incorrect handling of sum
                   |handling of sum over first  |over first dimension of a
                   |dimension of a product of   |product of automatic arrays
                   |automatic arrays            |

--- Comment #7 from Mikael Morin <mikael at gcc dot gnu.org> ---
Author: mikael
Date: Sat Aug 24 12:46:17 2013
New Revision: 201966

URL: http://gcc.gnu.org/viewcvs?rev=201966&root=gcc&view=rev
Log:
fortran/
    PR fortran/57798
    * trans-array.c (gfc_conv_ss_startstride, set_loop_bounds,
    gfc_set_delta): Generate preliminary code before the outermost loop.

testsuite/
    PR fortran/57798
    * gfortran.dg/inline_sum_5.f90: New.


Added:
    branches/gcc-4_8-branch/gcc/testsuite/gfortran.dg/inline_sum_5.f90
Modified:
    branches/gcc-4_8-branch/gcc/fortran/ChangeLog
    branches/gcc-4_8-branch/gcc/fortran/trans-array.c
    branches/gcc-4_8-branch/gcc/testsuite/ChangeLog


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

* [Bug fortran/57798] [4.8/4.9 regression] Incorrect handling of sum over first dimension of a product of automatic arrays
       [not found] <bug-57798-4@http.gcc.gnu.org/bugzilla/>
                   ` (7 preceding siblings ...)
  2013-08-24 12:49 ` [Bug fortran/57798] " mikael at gcc dot gnu.org
@ 2013-08-24 12:50 ` mikael at gcc dot gnu.org
  8 siblings, 0 replies; 9+ messages in thread
From: mikael at gcc dot gnu.org @ 2013-08-24 12:50 UTC (permalink / raw)
  To: gcc-bugs

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

Mikael Morin <mikael at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|---                         |FIXED
            Summary|Incorrect handling of sum   |[4.8/4.9 regression]
                   |over first dimension of a   |Incorrect handling of sum
                   |product of automatic arrays |over first dimension of a
                   |                            |product of automatic arrays

--- Comment #8 from Mikael Morin <mikael at gcc dot gnu.org> ---
Fixed for 4.8.2 and 4.9.0


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

end of thread, other threads:[~2013-08-24 12:50 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-57798-4@http.gcc.gnu.org/bugzilla/>
2013-07-03 13:17 ` [Bug fortran/57798] [4.8/4.9 Regression] Incorrect handling of sum over first dimension of a product of automatic arrays dominiq at lps dot ens.fr
2013-08-16 15:40 ` jakub at gcc dot gnu.org
2013-08-19 21:07 ` tkoenig at gcc dot gnu.org
2013-08-20  9:41 ` mikael at gcc dot gnu.org
2013-08-20 10:12 ` mikael at gcc dot gnu.org
2013-08-21 13:56 ` mikael at gcc dot gnu.org
2013-08-23 17:51 ` [Bug fortran/57798] [4.8 " mikael at gcc dot gnu.org
2013-08-24 12:49 ` [Bug fortran/57798] " mikael at gcc dot gnu.org
2013-08-24 12:50 ` [Bug fortran/57798] [4.8/4.9 regression] " mikael 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).