public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/56939] New: [4.8/4.9 Regression] [OOP] Derived type is being used before it is defined
@ 2013-04-12 19:08 janus at gcc dot gnu.org
  2013-04-12 19:40 ` [Bug fortran/56939] " janus at gcc dot gnu.org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: janus at gcc dot gnu.org @ 2013-04-12 19:08 UTC (permalink / raw)
  To: gcc-bugs


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

             Bug #: 56939
           Summary: [4.8/4.9 Regression] [OOP] Derived type is being used
                    before it is defined
    Classification: Unclassified
           Product: gcc
           Version: 4.9.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: janus@gcc.gnu.org


The following is a reduction of PR 55959 comment 0, which is valid code AFAICS:


module pdfs
  type, abstract :: pdf
    integer dims
  contains
    procedure(getx), deferred :: getx
  end type

  abstract interface
    function getx(this)
      import pdf
      class(pdf), intent(in) :: this
      real getx(this%dims)
    end function
  end interface

  type point
    real x, y
  end type

  type, extends(pdf) :: pdf_point
    type(point) p
  contains
    procedure :: getx => pdf_point_getx
  end type

contains

  function pdf_point_getx(this)
    class(pdf_point), intent(in) :: this
    real pdf_point_getx(this%dims)
  end function

end module pdfs


program abstract
  use pdfs
end program


With 4.8 and trunk it gives the nonsensical error message:

  use pdfs
      1
Error: Derived type 'pdf' at (1) is being used before it is defined

(while 4.7 accepts it without a problem.)


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

* [Bug fortran/56939] [4.8/4.9 Regression] [OOP] Derived type is being used before it is defined
  2013-04-12 19:08 [Bug fortran/56939] New: [4.8/4.9 Regression] [OOP] Derived type is being used before it is defined janus at gcc dot gnu.org
@ 2013-04-12 19:40 ` janus at gcc dot gnu.org
  2013-05-15 13:27 ` rguenth at gcc dot gnu.org
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: janus at gcc dot gnu.org @ 2013-04-12 19:40 UTC (permalink / raw)
  To: gcc-bugs


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

--- Comment #1 from janus at gcc dot gnu.org 2013-04-12 19:40:32 UTC ---
Seems to be a module-loading problem. Backtrace for the error message:

#0  gfc_use_derived (sym=0x1a1dc60) at
/home/janus/gcc49/trunk/gcc/fortran/symbol.c:1988
#1  0x0000000000614cab in gfc_find_component (sym=0x1a1dc60,
name=0x7fffffffd310 "dims", noaccess=true, silent=true) at
/home/janus/gcc49/trunk/gcc/fortran/symbol.c:2007
#2  0x0000000000614e1a in gfc_find_component (sym=0x1a1dde0,
name=0x7fffffffd310 "dims", noaccess=true, silent=true) at
/home/janus/gcc49/trunk/gcc/fortran/symbol.c:2036
#3  0x00000000005be94d in mio_component_ref (cp=0x1a23e48, sym=0x1a1dde0) at
/home/janus/gcc49/trunk/gcc/fortran/module.c:2552
#4  0x00000000005bf1e5 in mio_ref (rp=0x7fffffffd3b8) at
/home/janus/gcc49/trunk/gcc/fortran/module.c:2919
#5  0x00000000005bf2e2 in mio_ref_list (rp=0x1a23d98) at
/home/janus/gcc49/trunk/gcc/fortran/module.c:2959
#6  0x00000000005bfb36 in mio_expr (ep=0x1a23c18) at
/home/janus/gcc49/trunk/gcc/fortran/module.c:3322
#7  0x00000000005be5b1 in mio_array_spec (asp=0x1a23b00) at
/home/janus/gcc49/trunk/gcc/fortran/module.c:2405
#8  0x00000000005bea43 in mio_component (c=0x1a23ab0, vtype=1) at
/home/janus/gcc49/trunk/gcc/fortran/module.c:2595
#9  0x00000000005bebb7 in mio_component_list (cp=0x1a1ea88, vtype=1) at
/home/janus/gcc49/trunk/gcc/fortran/module.c:2636
#10 0x00000000005c0983 in mio_symbol (sym=0x1a1e9e0) at
/home/janus/gcc49/trunk/gcc/fortran/module.c:3815
#11 0x00000000005c1991 in load_needed (p=0x1a1d1a0) at
/home/janus/gcc49/trunk/gcc/fortran/module.c:4379
#12 0x00000000005c17ed in load_needed (p=0x1a1d7c0) at
/home/janus/gcc49/trunk/gcc/fortran/module.c:4337
#13 0x00000000005c17ed in load_needed (p=0x1a1d360) at
/home/janus/gcc49/trunk/gcc/fortran/module.c:4337
#14 0x00000000005c1800 in load_needed (p=0x1a1cc60) at
/home/janus/gcc49/trunk/gcc/fortran/module.c:4338
#15 0x00000000005c1800 in load_needed (p=0x1a1ab80) at
/home/janus/gcc49/trunk/gcc/fortran/module.c:4338
#16 0x00000000005c24ec in read_module () at
/home/janus/gcc49/trunk/gcc/fortran/module.c:4764
#17 0x00000000005c6a68 in gfc_use_module (module=0x1a1a9e0) at
/home/janus/gcc49/trunk/gcc/fortran/module.c:6352
#18 0x00000000005c6f3a in gfc_use_modules () at
/home/janus/gcc49/trunk/gcc/fortran/module.c:6476


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

* [Bug fortran/56939] [4.8/4.9 Regression] [OOP] Derived type is being used before it is defined
  2013-04-12 19:08 [Bug fortran/56939] New: [4.8/4.9 Regression] [OOP] Derived type is being used before it is defined janus at gcc dot gnu.org
  2013-04-12 19:40 ` [Bug fortran/56939] " janus at gcc dot gnu.org
@ 2013-05-15 13:27 ` rguenth at gcc dot gnu.org
  2013-05-31 11:00 ` jakub at gcc dot gnu.org
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: rguenth at gcc dot gnu.org @ 2013-05-15 13:27 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P4
   Target Milestone|---                         |4.8.1


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

* [Bug fortran/56939] [4.8/4.9 Regression] [OOP] Derived type is being used before it is defined
  2013-04-12 19:08 [Bug fortran/56939] New: [4.8/4.9 Regression] [OOP] Derived type is being used before it is defined janus at gcc dot gnu.org
  2013-04-12 19:40 ` [Bug fortran/56939] " janus at gcc dot gnu.org
  2013-05-15 13:27 ` rguenth at gcc dot gnu.org
@ 2013-05-31 11:00 ` jakub at gcc dot gnu.org
  2013-06-11 17:18 ` mikael at gcc dot gnu.org
  2013-06-11 18:04 ` dominiq at lps dot ens.fr
  4 siblings, 0 replies; 6+ messages in thread
From: jakub at gcc dot gnu.org @ 2013-05-31 11:00 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|4.8.1                       |4.8.2

--- Comment #2 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
GCC 4.8.1 has been released.


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

* [Bug fortran/56939] [4.8/4.9 Regression] [OOP] Derived type is being used before it is defined
  2013-04-12 19:08 [Bug fortran/56939] New: [4.8/4.9 Regression] [OOP] Derived type is being used before it is defined janus at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2013-05-31 11:00 ` jakub at gcc dot gnu.org
@ 2013-06-11 17:18 ` mikael at gcc dot gnu.org
  2013-06-11 18:04 ` dominiq at lps dot ens.fr
  4 siblings, 0 replies; 6+ messages in thread
From: mikael at gcc dot gnu.org @ 2013-06-11 17:18 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

--- Comment #3 from Mikael Morin <mikael at gcc dot gnu.org> ---
Seems to be accepted now.


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

* [Bug fortran/56939] [4.8/4.9 Regression] [OOP] Derived type is being used before it is defined
  2013-04-12 19:08 [Bug fortran/56939] New: [4.8/4.9 Regression] [OOP] Derived type is being used before it is defined janus at gcc dot gnu.org
                   ` (3 preceding siblings ...)
  2013-06-11 17:18 ` mikael at gcc dot gnu.org
@ 2013-06-11 18:04 ` dominiq at lps dot ens.fr
  4 siblings, 0 replies; 6+ messages in thread
From: dominiq at lps dot ens.fr @ 2013-06-11 18:04 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

--- Comment #4 from Dominique d'Humieres <dominiq at lps dot ens.fr> ---
It seems to have been fixed between revisions 197943 and 197969.
The candidates are revisions 197950 or 197961.
Closing as fixed.


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

end of thread, other threads:[~2013-06-11 18:04 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-04-12 19:08 [Bug fortran/56939] New: [4.8/4.9 Regression] [OOP] Derived type is being used before it is defined janus at gcc dot gnu.org
2013-04-12 19:40 ` [Bug fortran/56939] " janus at gcc dot gnu.org
2013-05-15 13:27 ` rguenth at gcc dot gnu.org
2013-05-31 11:00 ` jakub at gcc dot gnu.org
2013-06-11 17:18 ` mikael at gcc dot gnu.org
2013-06-11 18:04 ` 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).