public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/64692] New: Incorrect result for sourced allocate of class(*) array
@ 2015-01-20 15:54 antony at cosmologist dot info
  2015-01-24 11:21 ` [Bug fortran/64692] " dominiq at lps dot ens.fr
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: antony at cosmologist dot info @ 2015-01-20 15:54 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64692

            Bug ID: 64692
           Summary: Incorrect result for sourced allocate of class(*)
                    array
           Product: gcc
           Version: 5.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: antony at cosmologist dot info

The following code gives incorrect output in trunk ('array 1' and 'array 2'
should be the same):

module Y
contains

    subroutine AddArray(P)
    class(*), target, intent(in) :: P(:)
    class(*), pointer :: Pt(:)

        allocate(Pt(1:SIZE(P)), source= P)

    select type (P)
    type is (double precision)
      print *,'array 1',P
    end select

    select type (Pt )
    type is (double precision)
      print *,'array 2',Pt
    end select

   end subroutine

end module Y

program test
use Y
double precision P(2,2)

P(1:2,1)=[1.d0,2.d0]
P(1:2,2) = [3.d0,4.d0]
call AddArray(P(1:2,2))

end program test


The select types are just there to show the output, they aren't needed for the
bug.


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

* [Bug fortran/64692] Incorrect result for sourced allocate of class(*) array
  2015-01-20 15:54 [Bug fortran/64692] New: Incorrect result for sourced allocate of class(*) array antony at cosmologist dot info
@ 2015-01-24 11:21 ` dominiq at lps dot ens.fr
  2015-01-24 11:52 ` antony at cosmologist dot info
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: dominiq at lps dot ens.fr @ 2015-01-24 11:21 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64692

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2015-01-24
     Ever confirmed|0                           |1

--- Comment #1 from Dominique d'Humieres <dominiq at lps dot ens.fr> ---
Confirmed for 4.9 and 5.0 (r220065):

 array 1   3.0000000000000000        4.0000000000000000     
 array 2   4.0000000000000000        6.9532175754940950E-310

I suspect an off-by-one problem. Note that with 4.8.4 I get

 array 1   3.0000000000000000        4.0000000000000000     
 array 2   1.0000000000000000        2.0000000000000000


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

* [Bug fortran/64692] Incorrect result for sourced allocate of class(*) array
  2015-01-20 15:54 [Bug fortran/64692] New: Incorrect result for sourced allocate of class(*) array antony at cosmologist dot info
  2015-01-24 11:21 ` [Bug fortran/64692] " dominiq at lps dot ens.fr
@ 2015-01-24 11:52 ` antony at cosmologist dot info
  2015-01-25 15:52 ` vehre at gcc dot gnu.org
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: antony at cosmologist dot info @ 2015-01-24 11:52 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64692

--- Comment #2 from Antony Lewis <antony at cosmologist dot info> ---
May be same/related to http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60322 ?


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

* [Bug fortran/64692] Incorrect result for sourced allocate of class(*) array
  2015-01-20 15:54 [Bug fortran/64692] New: Incorrect result for sourced allocate of class(*) array antony at cosmologist dot info
  2015-01-24 11:21 ` [Bug fortran/64692] " dominiq at lps dot ens.fr
  2015-01-24 11:52 ` antony at cosmologist dot info
@ 2015-01-25 15:52 ` vehre at gcc dot gnu.org
  2015-02-11 17:00 ` vehre at gcc dot gnu.org
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: vehre at gcc dot gnu.org @ 2015-01-25 15:52 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64692

vehre at gcc dot gnu.org changed:

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

--- Comment #3 from vehre at gcc dot gnu.org ---
IMHO, this is not only related to 60322, but the same bug. The major difference
in the output is due to the bug being applied multiple times consecutively.


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

* [Bug fortran/64692] Incorrect result for sourced allocate of class(*) array
  2015-01-20 15:54 [Bug fortran/64692] New: Incorrect result for sourced allocate of class(*) array antony at cosmologist dot info
                   ` (2 preceding siblings ...)
  2015-01-25 15:52 ` vehre at gcc dot gnu.org
@ 2015-02-11 17:00 ` vehre at gcc dot gnu.org
  2015-02-11 17:17 ` dominiq at lps dot ens.fr
  2015-07-03  8:21 ` vehre at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: vehre at gcc dot gnu.org @ 2015-02-11 17:00 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64692

vehre at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED

--- Comment #4 from vehre at gcc dot gnu.org ---
Just for the stupid me, we are expecting to see:

 array 1   3.0000000000000000        4.0000000000000000     
 array 2   3.0000000000000000        4.0000000000000000

right?


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

* [Bug fortran/64692] Incorrect result for sourced allocate of class(*) array
  2015-01-20 15:54 [Bug fortran/64692] New: Incorrect result for sourced allocate of class(*) array antony at cosmologist dot info
                   ` (3 preceding siblings ...)
  2015-02-11 17:00 ` vehre at gcc dot gnu.org
@ 2015-02-11 17:17 ` dominiq at lps dot ens.fr
  2015-07-03  8:21 ` vehre at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: dominiq at lps dot ens.fr @ 2015-02-11 17:17 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64692

--- Comment #5 from Dominique d'Humieres <dominiq at lps dot ens.fr> ---
> ... we are expecting to see:
>
>  array 1   3.0000000000000000        4.0000000000000000     
>  array 2   3.0000000000000000        4.0000000000000000
>
> right?

Yes.


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

* [Bug fortran/64692] Incorrect result for sourced allocate of class(*) array
  2015-01-20 15:54 [Bug fortran/64692] New: Incorrect result for sourced allocate of class(*) array antony at cosmologist dot info
                   ` (4 preceding siblings ...)
  2015-02-11 17:17 ` dominiq at lps dot ens.fr
@ 2015-07-03  8:21 ` vehre at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: vehre at gcc dot gnu.org @ 2015-07-03  8:21 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64692

vehre at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|---                         |FIXED

--- Comment #6 from vehre at gcc dot gnu.org ---
The error does not occur anymore. So presumably fixed with pr60322. Closing.


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

end of thread, other threads:[~2015-07-03  8:21 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-01-20 15:54 [Bug fortran/64692] New: Incorrect result for sourced allocate of class(*) array antony at cosmologist dot info
2015-01-24 11:21 ` [Bug fortran/64692] " dominiq at lps dot ens.fr
2015-01-24 11:52 ` antony at cosmologist dot info
2015-01-25 15:52 ` vehre at gcc dot gnu.org
2015-02-11 17:00 ` vehre at gcc dot gnu.org
2015-02-11 17:17 ` dominiq at lps dot ens.fr
2015-07-03  8:21 ` vehre 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).