public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/64943] New: No error on ultimate allocatable components in IO list
@ 2015-02-05  8:16 pault at gcc dot gnu.org
  2015-02-05 12:14 ` [Bug fortran/64943] " dominiq at lps dot ens.fr
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: pault at gcc dot gnu.org @ 2015-02-05  8:16 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 64943
           Summary: No error on ultimate allocatable components in IO list
           Product: gcc
           Version: 5.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: pault at gcc dot gnu.org

With this wrong code (other brand: Variables containing ultimate allocatable
array components are forbidden from appearing directly in input/output lists.
print *, TestReference([Test(99), Test(199)])):

  type :: Test
    integer :: i
  end type

  type :: TestReference
     class(Test), allocatable :: test(:)
  end type
print *, TestReference([Test(99), Test(199)])
end

5.0 gives:

f951: internal compiler error: Bad IO basetype (7)
0x62a1fb gfc_internal_error(char const*, ...)
    ../../trunk/gcc/fortran/error.c:1486
0x71738b transfer_expr
    ../../trunk/gcc/fortran/trans-io.c:2265
0x71724a transfer_expr
    ../../trunk/gcc/fortran/trans-io.c:2259
0x71ad25 gfc_trans_transfer(gfc_code*)
    ../../trunk/gcc/fortran/trans-io.c:2395
0x6ba7e7 trans_code
    ../../trunk/gcc/fortran/trans.c:1853
0x718790 build_dt
    ../../trunk/gcc/fortran/trans-io.c:1921
0x6ba807 trans_code
    ../../trunk/gcc/fortran/trans.c:1825
0x6e6008 gfc_generate_function_code(gfc_namespace*)
    ../../trunk/gcc/fortran/trans-decl.c:5842
0x6778c0 translate_all_program_units
    ../../trunk/gcc/fortran/parse.c:5341
0x6778c0 gfc_parse_file()
    ../../trunk/gcc/fortran/parse.c:5538
0x6b7675 gfc_be_parse_file
    ../../trunk/gcc/fortran/f95-lang.c:228


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

* [Bug fortran/64943] No error on ultimate allocatable components in IO list
  2015-02-05  8:16 [Bug fortran/64943] New: No error on ultimate allocatable components in IO list pault at gcc dot gnu.org
@ 2015-02-05 12:14 ` dominiq at lps dot ens.fr
  2015-02-05 12:36 ` burnus at gcc dot gnu.org
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: dominiq at lps dot ens.fr @ 2015-02-05 12:14 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |ice-on-invalid-code
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2015-02-05
     Ever confirmed|0                           |1
      Known to fail|                            |5.0

--- Comment #1 from Dominique d'Humieres <dominiq at lps dot ens.fr> ---
Confirmed.


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

* [Bug fortran/64943] No error on ultimate allocatable components in IO list
  2015-02-05  8:16 [Bug fortran/64943] New: No error on ultimate allocatable components in IO list pault at gcc dot gnu.org
  2015-02-05 12:14 ` [Bug fortran/64943] " dominiq at lps dot ens.fr
@ 2015-02-05 12:36 ` burnus at gcc dot gnu.org
  2015-02-05 12:39 ` burnus at gcc dot gnu.org
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: burnus at gcc dot gnu.org @ 2015-02-05 12:36 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Tobias Burnus <burnus at gcc dot gnu.org> ---
In principle, we do have a similar check in resolve.c's resolve_transfer. The
question is why it doesn't trigger.

  if (ts->type == BT_CLASS)
    {
      /* FIXME: Test for defined input/output.  */
      gfc_error ("Data transfer element at %L cannot be polymorphic unless "
                "it is processed by a defined input/output procedure",
                &code->loc);
      return;
...
      if (ts->u.derived->attr.alloc_comp)
        {
          gfc_error ("Data transfer element at %L cannot have ALLOCATABLE "
                     "components unless it is processed by a defined "
                     "input/output procedure", &code->loc);
          return;


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

* [Bug fortran/64943] No error on ultimate allocatable components in IO list
  2015-02-05  8:16 [Bug fortran/64943] New: No error on ultimate allocatable components in IO list pault at gcc dot gnu.org
  2015-02-05 12:14 ` [Bug fortran/64943] " dominiq at lps dot ens.fr
  2015-02-05 12:36 ` burnus at gcc dot gnu.org
@ 2015-02-05 12:39 ` burnus at gcc dot gnu.org
  2015-02-05 21:59 ` burnus at gcc dot gnu.org
  2015-02-05 22:00 ` burnus at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: burnus at gcc dot gnu.org @ 2015-02-05 12:39 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Tobias Burnus <burnus at gcc dot gnu.org> ---
(In reply to Tobias Burnus from comment #2)
> In principle, we do have a similar check in resolve.c's resolve_transfer.
> The question is why it doesn't trigger.

Answer: Only functions and variables are handled, but we have a
EXPR_STRUCTURE...


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

* [Bug fortran/64943] No error on ultimate allocatable components in IO list
  2015-02-05  8:16 [Bug fortran/64943] New: No error on ultimate allocatable components in IO list pault at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2015-02-05 12:39 ` burnus at gcc dot gnu.org
@ 2015-02-05 21:59 ` burnus at gcc dot gnu.org
  2015-02-05 22:00 ` burnus at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: burnus at gcc dot gnu.org @ 2015-02-05 21:59 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from Tobias Burnus <burnus at gcc dot gnu.org> ---
Author: burnus
Date: Thu Feb  5 21:58:38 2015
New Revision: 220462

URL: https://gcc.gnu.org/viewcvs?rev=220462&root=gcc&view=rev
Log:
2015-02-05  Tobias Burnus  <burnus@net-b.de>

        PR fortran/64943
        * resolve.c (resolve_transfer): Also check structure
        constructors.

2015-02-05  Tobias Burnus  <burnus@net-b.de>

        PR fortran/64943
        * gfortran.dg/structure_constructor_12.f90: New.


Added:
    trunk/gcc/testsuite/gfortran.dg/structure_constructor_12.f90
Modified:
    trunk/gcc/fortran/ChangeLog
    trunk/gcc/fortran/resolve.c
    trunk/gcc/testsuite/ChangeLog


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

* [Bug fortran/64943] No error on ultimate allocatable components in IO list
  2015-02-05  8:16 [Bug fortran/64943] New: No error on ultimate allocatable components in IO list pault at gcc dot gnu.org
                   ` (3 preceding siblings ...)
  2015-02-05 21:59 ` burnus at gcc dot gnu.org
@ 2015-02-05 22:00 ` burnus at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: burnus at gcc dot gnu.org @ 2015-02-05 22:00 UTC (permalink / raw)
  To: gcc-bugs

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

Tobias Burnus <burnus at gcc dot gnu.org> changed:

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

--- Comment #5 from Tobias Burnus <burnus at gcc dot gnu.org> ---
FIXED on the GCC 5 trunk.


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

end of thread, other threads:[~2015-02-05 22:00 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-02-05  8:16 [Bug fortran/64943] New: No error on ultimate allocatable components in IO list pault at gcc dot gnu.org
2015-02-05 12:14 ` [Bug fortran/64943] " dominiq at lps dot ens.fr
2015-02-05 12:36 ` burnus at gcc dot gnu.org
2015-02-05 12:39 ` burnus at gcc dot gnu.org
2015-02-05 21:59 ` burnus at gcc dot gnu.org
2015-02-05 22:00 ` burnus 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).