public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/58644] New: [OOP] Missing .data ref in passing a CLASS array as actual argument to a TYPE.
@ 2013-10-06 19:21 burnus at gcc dot gnu.org
  2014-03-22 15:11 ` [Bug fortran/58644] " dominiq at lps dot ens.fr
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: burnus at gcc dot gnu.org @ 2013-10-06 19:21 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 58644
           Summary: [OOP] Missing .data ref in passing a CLASS array as
                    actual argument to a TYPE.
           Product: gcc
           Version: 4.9.0
            Status: UNCONFIRMED
          Keywords: wrong-code
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: burnus at gcc dot gnu.org

Found while looking at the dump. The code seems to work at run time on all
targets.


Looking at gfortran.dg/class_to_type_2.f90, one has:

  function g () result(res)
    class(foo), allocatable :: res(:)
    allocate (res(3))
    res(:)%i = 55
  end function g

  subroutine subpr2_array (x)
    type(foo) :: x(:)
    if (any(x(:)%i /= 55)) call abort ()
  end subroutine

  call subpr2_array (g ())



For that one gets the dump:
          struct __class_mod_subpr_Foo_1_0a D.2108;
          D.2108 = g ();
          subpr2_array (&D.2108);

I believe that should be instead:
          subpr2_array (&D.2108.data);

As D.2108 is not a pointer and .data is the first field, it seems to work,
though.


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

* [Bug fortran/58644] [OOP] Missing .data ref in passing a CLASS array as actual argument to a TYPE.
  2013-10-06 19:21 [Bug fortran/58644] New: [OOP] Missing .data ref in passing a CLASS array as actual argument to a TYPE burnus at gcc dot gnu.org
@ 2014-03-22 15:11 ` dominiq at lps dot ens.fr
  2014-10-27 13:20 ` pault at gcc dot gnu.org
  2015-09-29 17:22 ` dominiq at lps dot ens.fr
  2 siblings, 0 replies; 4+ messages in thread
From: dominiq at lps dot ens.fr @ 2014-03-22 15:11 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |WAITING
   Last reconfirmed|                            |2014-03-22
     Ever confirmed|0                           |1

--- Comment #1 from Dominique d'Humieres <dominiq at lps dot ens.fr> ---
I don't understand this PR. The test succeeds even when compiled with
-fsanitize=address.


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

* [Bug fortran/58644] [OOP] Missing .data ref in passing a CLASS array as actual argument to a TYPE.
  2013-10-06 19:21 [Bug fortran/58644] New: [OOP] Missing .data ref in passing a CLASS array as actual argument to a TYPE burnus at gcc dot gnu.org
  2014-03-22 15:11 ` [Bug fortran/58644] " dominiq at lps dot ens.fr
@ 2014-10-27 13:20 ` pault at gcc dot gnu.org
  2015-09-29 17:22 ` dominiq at lps dot ens.fr
  2 siblings, 0 replies; 4+ messages in thread
From: pault at gcc dot gnu.org @ 2014-10-27 13:20 UTC (permalink / raw)
  To: gcc-bugs

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

Paul Thomas <pault at gcc dot gnu.org> changed:

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

--- Comment #2 from Paul Thomas <pault at gcc dot gnu.org> ---
(In reply to Dominique d'Humieres from comment #1)
> I don't understand this PR. The test succeeds even when compiled with
> -fsanitize=address.

I think that the PR is justified. The actual argument should be as Tobias says.
Both &D.2108 and &D.2108.data are valid address.  Not only this, they are the
same address.  However, should we ever change the class ABI to put the vptr
first, for example, then this will no longer work.

I believe that my imminent fix for PR63205 will correct this issue and so
eliminate this PR.

Paul


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

* [Bug fortran/58644] [OOP] Missing .data ref in passing a CLASS array as actual argument to a TYPE.
  2013-10-06 19:21 [Bug fortran/58644] New: [OOP] Missing .data ref in passing a CLASS array as actual argument to a TYPE burnus at gcc dot gnu.org
  2014-03-22 15:11 ` [Bug fortran/58644] " dominiq at lps dot ens.fr
  2014-10-27 13:20 ` pault at gcc dot gnu.org
@ 2015-09-29 17:22 ` dominiq at lps dot ens.fr
  2 siblings, 0 replies; 4+ messages in thread
From: dominiq at lps dot ens.fr @ 2015-09-29 17:22 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Dominique d'Humieres <dominiq at lps dot ens.fr> ---
> I believe that my imminent fix for PR63205 will correct this issue
> and so eliminate this PR.

Does it? If yes, this PR should be closed as FIXED. If no, what is missing?


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

end of thread, other threads:[~2015-09-29 17:22 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-10-06 19:21 [Bug fortran/58644] New: [OOP] Missing .data ref in passing a CLASS array as actual argument to a TYPE burnus at gcc dot gnu.org
2014-03-22 15:11 ` [Bug fortran/58644] " dominiq at lps dot ens.fr
2014-10-27 13:20 ` pault at gcc dot gnu.org
2015-09-29 17:22 ` dominiq at lps dot ens.fr

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).