public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/100110] New: Parameterized Derived Types, problems with global variable
@ 2021-04-16  5:37 xiao.liu@compiler-dev.com
  2021-04-19 10:41 ` [Bug fortran/100110] " pault at gcc dot gnu.org
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: xiao.liu@compiler-dev.com @ 2021-04-16  5:37 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 100110
           Summary: Parameterized Derived Types, problems with global
                    variable
           Product: gcc
           Version: 10.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: xiao.liu@compiler-dev.com
  Target Milestone: ---

the test case is,

program p
  implicit none
  type t(n)
    integer, len :: n
    integer :: arr(n, n)
  end type

  type(t(2)) :: obj
  print *, obj%n
  print *, shape(obj%arr)
  call test()
contains
  subroutine test()
    print *, obj%n
    print *, shape(obj%arr)
  end subroutine
end program

expected result is
           2
           2           2
           2
           2           2
but is
           0
           0           0
           0
           0           0

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

* [Bug fortran/100110] Parameterized Derived Types, problems with global variable
  2021-04-16  5:37 [Bug fortran/100110] New: Parameterized Derived Types, problems with global variable xiao.liu@compiler-dev.com
@ 2021-04-19 10:41 ` pault at gcc dot gnu.org
  2021-04-19 12:31 ` pault at gcc dot gnu.org
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: pault at gcc dot gnu.org @ 2021-04-19 10:41 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |pault at gcc dot gnu.org
           Assignee|unassigned at gcc dot gnu.org      |pault at gcc dot gnu.org
   Last reconfirmed|                            |2021-04-19
     Ever confirmed|0                           |1
             Status|UNCONFIRMED                 |NEW

--- Comment #1 from Paul Thomas <pault at gcc dot gnu.org> ---
Hi Xiao,

Thank you for this report. I admit that the implementation of PDTs in gfortran
is broken. I didn't realise quite how broken it is:-(

Making 'obj' allocatable and allocating it produces the expected result.

I had planned that once gcc-11 is released, I would turn my attention to PDTs.

This one, I suspect, is such a low hanging fruit, that I will give it attention
now.

Best regards

Paul

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

* [Bug fortran/100110] Parameterized Derived Types, problems with global variable
  2021-04-16  5:37 [Bug fortran/100110] New: Parameterized Derived Types, problems with global variable xiao.liu@compiler-dev.com
  2021-04-19 10:41 ` [Bug fortran/100110] " pault at gcc dot gnu.org
@ 2021-04-19 12:31 ` pault at gcc dot gnu.org
  2021-04-20  6:31 ` cvs-commit at gcc dot gnu.org
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: pault at gcc dot gnu.org @ 2021-04-19 12:31 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Paul Thomas <pault at gcc dot gnu.org> ---
Created attachment 50628
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=50628&action=edit
Fix for the PR

As I thought, the fix is trivial.

Paul

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

* [Bug fortran/100110] Parameterized Derived Types, problems with global variable
  2021-04-16  5:37 [Bug fortran/100110] New: Parameterized Derived Types, problems with global variable xiao.liu@compiler-dev.com
  2021-04-19 10:41 ` [Bug fortran/100110] " pault at gcc dot gnu.org
  2021-04-19 12:31 ` pault at gcc dot gnu.org
@ 2021-04-20  6:31 ` cvs-commit at gcc dot gnu.org
  2021-05-04 12:32 ` rguenth at gcc dot gnu.org
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-04-20  6:31 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Paul Thomas <pault@gcc.gnu.org>:

https://gcc.gnu.org/g:67378cd63d62bf0c69e966d1d202a1e586550a68

commit r11-8255-g67378cd63d62bf0c69e966d1d202a1e586550a68
Author: Paul Thomas <pault@gcc.gnu.org>
Date:   Tue Apr 20 07:30:07 2021 +0100

    Fortran: Fix host associated PDT entity initialization [PR99307].

    2021-04-20  Paul Thomas  <pault@gcc.gnu.org>

    gcc/fortran
            PR fortran/100110
            * trans-decl.c (gfc_get_symbol_decl): Replace test for host
            association with a check that the current and symbol namespaces
            are the same.

    gcc/testsuite/
            PR fortran/100110
            * gfortran.dg/pdt_31.f03: New test.
            * gfortran.dg/pdt_26.f03: Reduce 'builtin_malloc' count from 9
            to 8.

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

* [Bug fortran/100110] Parameterized Derived Types, problems with global variable
  2021-04-16  5:37 [Bug fortran/100110] New: Parameterized Derived Types, problems with global variable xiao.liu@compiler-dev.com
                   ` (2 preceding siblings ...)
  2021-04-20  6:31 ` cvs-commit at gcc dot gnu.org
@ 2021-05-04 12:32 ` rguenth at gcc dot gnu.org
  2021-09-10 19:40 ` cvs-commit at gcc dot gnu.org
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: rguenth at gcc dot gnu.org @ 2021-05-04 12:32 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Biener <rguenth at gcc dot gnu.org> changed:

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

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

* [Bug fortran/100110] Parameterized Derived Types, problems with global variable
  2021-04-16  5:37 [Bug fortran/100110] New: Parameterized Derived Types, problems with global variable xiao.liu@compiler-dev.com
                   ` (3 preceding siblings ...)
  2021-05-04 12:32 ` rguenth at gcc dot gnu.org
@ 2021-09-10 19:40 ` cvs-commit at gcc dot gnu.org
  2021-09-10 19:44 ` cvs-commit at gcc dot gnu.org
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-09-10 19:40 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-10 branch has been updated by Harald Anlauf
<anlauf@gcc.gnu.org>:

https://gcc.gnu.org/g:714b85f6fce0448b9d4d5e5d21152a3478b27422

commit r10-10106-g714b85f6fce0448b9d4d5e5d21152a3478b27422
Author: Paul Thomas <pault@gcc.gnu.org>
Date:   Tue Apr 20 07:30:07 2021 +0100

    Fortran: Fix host associated PDT entity initialization

    2021-04-20  Paul Thomas  <pault@gcc.gnu.org>

    gcc/fortran
            PR fortran/100110
            * trans-decl.c (gfc_get_symbol_decl): Replace test for host
            association with a check that the current and symbol namespaces
            are the same.

    gcc/testsuite/
            PR fortran/100110
            * gfortran.dg/pdt_31.f03: New test.
            * gfortran.dg/pdt_26.f03: Reduce 'builtin_malloc' count from 9
            to 8.

    (cherry picked from commit 67378cd63d62bf0c69e966d1d202a1e586550a68)

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

* [Bug fortran/100110] Parameterized Derived Types, problems with global variable
  2021-04-16  5:37 [Bug fortran/100110] New: Parameterized Derived Types, problems with global variable xiao.liu@compiler-dev.com
                   ` (4 preceding siblings ...)
  2021-09-10 19:40 ` cvs-commit at gcc dot gnu.org
@ 2021-09-10 19:44 ` cvs-commit at gcc dot gnu.org
  2021-09-10 19:46 ` anlauf at gcc dot gnu.org
  2021-09-11  6:42 ` pinskia at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-09-10 19:44 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-9 branch has been updated by Harald Anlauf
<anlauf@gcc.gnu.org>:

https://gcc.gnu.org/g:f692856517393d60f745f20306173919e18fc71a

commit r9-9718-gf692856517393d60f745f20306173919e18fc71a
Author: Paul Thomas <pault@gcc.gnu.org>
Date:   Tue Apr 20 07:30:07 2021 +0100

    Fortran: Fix host associated PDT entity initialization

    2021-04-20  Paul Thomas  <pault@gcc.gnu.org>

    gcc/fortran
            PR fortran/100110
            * trans-decl.c (gfc_get_symbol_decl): Replace test for host
            association with a check that the current and symbol namespaces
            are the same.

    gcc/testsuite/
            PR fortran/100110
            * gfortran.dg/pdt_31.f03: New test.
            * gfortran.dg/pdt_26.f03: Reduce 'builtin_malloc' count from 9
            to 8.

    (cherry picked from commit 67378cd63d62bf0c69e966d1d202a1e586550a68)

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

* [Bug fortran/100110] Parameterized Derived Types, problems with global variable
  2021-04-16  5:37 [Bug fortran/100110] New: Parameterized Derived Types, problems with global variable xiao.liu@compiler-dev.com
                   ` (5 preceding siblings ...)
  2021-09-10 19:44 ` cvs-commit at gcc dot gnu.org
@ 2021-09-10 19:46 ` anlauf at gcc dot gnu.org
  2021-09-11  6:42 ` pinskia at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: anlauf at gcc dot gnu.org @ 2021-09-10 19:46 UTC (permalink / raw)
  To: gcc-bugs

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

anlauf at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |anlauf at gcc dot gnu.org
         Resolution|---                         |FIXED
             Status|ASSIGNED                    |RESOLVED

--- Comment #6 from anlauf at gcc dot gnu.org ---
Backported Paul's fix to remaining open branches.  Closing.

Thanks to everybody!

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

* [Bug fortran/100110] Parameterized Derived Types, problems with global variable
  2021-04-16  5:37 [Bug fortran/100110] New: Parameterized Derived Types, problems with global variable xiao.liu@compiler-dev.com
                   ` (6 preceding siblings ...)
  2021-09-10 19:46 ` anlauf at gcc dot gnu.org
@ 2021-09-11  6:42 ` pinskia at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-09-11  6:42 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |9.5

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

end of thread, other threads:[~2021-09-11  6:42 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-16  5:37 [Bug fortran/100110] New: Parameterized Derived Types, problems with global variable xiao.liu@compiler-dev.com
2021-04-19 10:41 ` [Bug fortran/100110] " pault at gcc dot gnu.org
2021-04-19 12:31 ` pault at gcc dot gnu.org
2021-04-20  6:31 ` cvs-commit at gcc dot gnu.org
2021-05-04 12:32 ` rguenth at gcc dot gnu.org
2021-09-10 19:40 ` cvs-commit at gcc dot gnu.org
2021-09-10 19:44 ` cvs-commit at gcc dot gnu.org
2021-09-10 19:46 ` anlauf at gcc dot gnu.org
2021-09-11  6:42 ` pinskia 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).