public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/85877] [8/9/10/11 Regression] ICE in fold_convert_loc, at fold-const.c:2449
       [not found] <bug-85877-4@http.gcc.gnu.org/bugzilla/>
@ 2020-12-22 21:27 ` anlauf at gcc dot gnu.org
  2020-12-27 21:04 ` anlauf at gcc dot gnu.org
                   ` (10 subsequent siblings)
  11 siblings, 0 replies; 12+ messages in thread
From: anlauf at gcc dot gnu.org @ 2020-12-22 21:27 UTC (permalink / raw)
  To: gcc-bugs

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

anlauf at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |anlauf at gcc dot gnu.org
           Keywords|ice-on-valid-code           |ice-on-invalid-code

--- Comment #5 from anlauf at gcc dot gnu.org ---
I doubt that the testcase in comment#0 is actually valid.

In fact, it is empirically rejected by most compilers.  E.g. Intel v21:

pr85877.f90(2): error #8067: If any bind-entity in a bind-stmt is an
entity-name, the bind-stmt shall appear in the specification part of a module. 
 [F]
  bind(c) f
----------^
pr85877.f90(3): error #6410: This name has not been declared as an array or a
function.   [F]
  x = f()
------^


The F2018 standard has a few things here, e.g. on the BIND statement

! 8.6.4 BIND statement
! ...
! The BIND statement specifies the BIND attribute for a list of variables
! and common blocks.

! 18.3.6 Interoperability of procedures and procedure interfaces

! A Fortran procedure is interoperable if and only if it has the BIND
! attribute, that is, if its interface is specified with a
! proc-language-binding-spec.

Since there is no explicit interface, c.f.

! 15.4.2.2 Explicit interface

! Within the scope of a procedure identifier, the procedure shall have an
! explicit interface if it is not a statement function and
! ...
! (6) the procedure has the BIND attribute.


While I'm not sure that Intel has all the wording right, the reason is
almost right. ;-)  Thus changing to ice-on-invalid.

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

* [Bug fortran/85877] [8/9/10/11 Regression] ICE in fold_convert_loc, at fold-const.c:2449
       [not found] <bug-85877-4@http.gcc.gnu.org/bugzilla/>
  2020-12-22 21:27 ` [Bug fortran/85877] [8/9/10/11 Regression] ICE in fold_convert_loc, at fold-const.c:2449 anlauf at gcc dot gnu.org
@ 2020-12-27 21:04 ` anlauf at gcc dot gnu.org
  2021-05-14  9:50 ` [Bug fortran/85877] [9/10/11/12 " jakub at gcc dot gnu.org
                   ` (9 subsequent siblings)
  11 siblings, 0 replies; 12+ messages in thread
From: anlauf at gcc dot gnu.org @ 2020-12-27 21:04 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #6 from anlauf at gcc dot gnu.org ---
Digging some more, it appears that the logic in resolve.c is incomplete.
There is some inconsistency between what is dealt with in resolve_symbol
and in resolve_fl_procedure.

resolve_symbol:

15637     if (sym->attr.is_bind_c && sym->attr.use_assoc == 0
15638         && sym->attr.dummy == 0 && sym->attr.flavor != FL_PROCEDURE
15639         && sym->attr.flavor != FL_DERIVED)

Commenting out the second half of line 15638 (sym->attr.flavor != FL_PROCEDURE)
fixed the issue, but hell breaks loose in regtesting...

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

* [Bug fortran/85877] [9/10/11/12 Regression] ICE in fold_convert_loc,  at fold-const.c:2449
       [not found] <bug-85877-4@http.gcc.gnu.org/bugzilla/>
  2020-12-22 21:27 ` [Bug fortran/85877] [8/9/10/11 Regression] ICE in fold_convert_loc, at fold-const.c:2449 anlauf at gcc dot gnu.org
  2020-12-27 21:04 ` anlauf at gcc dot gnu.org
@ 2021-05-14  9:50 ` jakub at gcc dot gnu.org
  2021-06-01  8:11 ` rguenth at gcc dot gnu.org
                   ` (8 subsequent siblings)
  11 siblings, 0 replies; 12+ messages in thread
From: jakub at gcc dot gnu.org @ 2021-05-14  9:50 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|8.5                         |9.4

--- Comment #7 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
GCC 8 branch is being closed.

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

* [Bug fortran/85877] [9/10/11/12 Regression] ICE in fold_convert_loc,  at fold-const.c:2449
       [not found] <bug-85877-4@http.gcc.gnu.org/bugzilla/>
                   ` (2 preceding siblings ...)
  2021-05-14  9:50 ` [Bug fortran/85877] [9/10/11/12 " jakub at gcc dot gnu.org
@ 2021-06-01  8:11 ` rguenth at gcc dot gnu.org
  2022-05-27  9:39 ` [Bug fortran/85877] [10/11/12/13 " rguenth at gcc dot gnu.org
                   ` (7 subsequent siblings)
  11 siblings, 0 replies; 12+ messages in thread
From: rguenth at gcc dot gnu.org @ 2021-06-01  8:11 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

--- Comment #8 from Richard Biener <rguenth at gcc dot gnu.org> ---
GCC 9.4 is being released, retargeting bugs to GCC 9.5.

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

* [Bug fortran/85877] [10/11/12/13 Regression] ICE in fold_convert_loc, at fold-const.c:2449
       [not found] <bug-85877-4@http.gcc.gnu.org/bugzilla/>
                   ` (3 preceding siblings ...)
  2021-06-01  8:11 ` rguenth at gcc dot gnu.org
@ 2022-05-27  9:39 ` rguenth at gcc dot gnu.org
  2022-06-28 10:35 ` jakub at gcc dot gnu.org
                   ` (6 subsequent siblings)
  11 siblings, 0 replies; 12+ messages in thread
From: rguenth at gcc dot gnu.org @ 2022-05-27  9:39 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

--- Comment #9 from Richard Biener <rguenth at gcc dot gnu.org> ---
GCC 9 branch is being closed

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

* [Bug fortran/85877] [10/11/12/13 Regression] ICE in fold_convert_loc, at fold-const.c:2449
       [not found] <bug-85877-4@http.gcc.gnu.org/bugzilla/>
                   ` (4 preceding siblings ...)
  2022-05-27  9:39 ` [Bug fortran/85877] [10/11/12/13 " rguenth at gcc dot gnu.org
@ 2022-06-28 10:35 ` jakub at gcc dot gnu.org
  2023-03-17 21:37 ` anlauf at gcc dot gnu.org
                   ` (5 subsequent siblings)
  11 siblings, 0 replies; 12+ messages in thread
From: jakub at gcc dot gnu.org @ 2022-06-28 10:35 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|10.4                        |10.5

--- Comment #10 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
GCC 10.4 is being released, retargeting bugs to GCC 10.5.

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

* [Bug fortran/85877] [10/11/12/13 Regression] ICE in fold_convert_loc, at fold-const.c:2449
       [not found] <bug-85877-4@http.gcc.gnu.org/bugzilla/>
                   ` (5 preceding siblings ...)
  2022-06-28 10:35 ` jakub at gcc dot gnu.org
@ 2023-03-17 21:37 ` anlauf at gcc dot gnu.org
  2023-03-19 19:33 ` cvs-commit at gcc dot gnu.org
                   ` (4 subsequent siblings)
  11 siblings, 0 replies; 12+ messages in thread
From: anlauf at gcc dot gnu.org @ 2023-03-17 21:37 UTC (permalink / raw)
  To: gcc-bugs

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

anlauf at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
           Assignee|unassigned at gcc dot gnu.org      |anlauf at gcc dot gnu.org

--- Comment #11 from anlauf at gcc dot gnu.org ---
Submitted: https://gcc.gnu.org/pipermail/fortran/2023-March/059085.html

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

* [Bug fortran/85877] [10/11/12/13 Regression] ICE in fold_convert_loc, at fold-const.c:2449
       [not found] <bug-85877-4@http.gcc.gnu.org/bugzilla/>
                   ` (6 preceding siblings ...)
  2023-03-17 21:37 ` anlauf at gcc dot gnu.org
@ 2023-03-19 19:33 ` cvs-commit at gcc dot gnu.org
  2023-03-22 18:00 ` cvs-commit at gcc dot gnu.org
                   ` (3 subsequent siblings)
  11 siblings, 0 replies; 12+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2023-03-19 19:33 UTC (permalink / raw)
  To: gcc-bugs

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

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

https://gcc.gnu.org/g:5426ab34643d9e6502f3ee572891a03471fa33ed

commit r13-6756-g5426ab34643d9e6502f3ee572891a03471fa33ed
Author: Harald Anlauf <anlauf@gmx.de>
Date:   Fri Mar 17 22:24:49 2023 +0100

    Fortran: procedures with BIND(C) attribute require explicit interface
[PR85877]

    gcc/fortran/ChangeLog:

            PR fortran/85877
            * resolve.cc (resolve_fl_procedure): Check for an explicit
interface
            of procedures with the BIND(C) attribute (F2018:15.4.2.2).

    gcc/testsuite/ChangeLog:

            PR fortran/85877
            * gfortran.dg/pr85877.f90: New test.

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

* [Bug fortran/85877] [10/11/12/13 Regression] ICE in fold_convert_loc, at fold-const.c:2449
       [not found] <bug-85877-4@http.gcc.gnu.org/bugzilla/>
                   ` (7 preceding siblings ...)
  2023-03-19 19:33 ` cvs-commit at gcc dot gnu.org
@ 2023-03-22 18:00 ` cvs-commit at gcc dot gnu.org
  2023-03-24 18:41 ` cvs-commit at gcc dot gnu.org
                   ` (2 subsequent siblings)
  11 siblings, 0 replies; 12+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2023-03-22 18:00 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

commit r12-9309-gb6bef857c1e8bde9df2ba53a708ecffded316ec8
Author: Harald Anlauf <anlauf@gmx.de>
Date:   Fri Mar 17 22:24:49 2023 +0100

    Fortran: procedures with BIND(C) attribute require explicit interface
[PR85877]

    gcc/fortran/ChangeLog:

            PR fortran/85877
            * resolve.cc (resolve_fl_procedure): Check for an explicit
interface
            of procedures with the BIND(C) attribute (F2018:15.4.2.2).

    gcc/testsuite/ChangeLog:

            PR fortran/85877
            * gfortran.dg/pr85877.f90: New test.

    (cherry picked from commit 5426ab34643d9e6502f3ee572891a03471fa33ed)

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

* [Bug fortran/85877] [10/11/12/13 Regression] ICE in fold_convert_loc, at fold-const.c:2449
       [not found] <bug-85877-4@http.gcc.gnu.org/bugzilla/>
                   ` (8 preceding siblings ...)
  2023-03-22 18:00 ` cvs-commit at gcc dot gnu.org
@ 2023-03-24 18:41 ` cvs-commit at gcc dot gnu.org
  2023-03-24 18:44 ` cvs-commit at gcc dot gnu.org
  2023-03-24 18:45 ` anlauf at gcc dot gnu.org
  11 siblings, 0 replies; 12+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2023-03-24 18:41 UTC (permalink / raw)
  To: gcc-bugs

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

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

https://gcc.gnu.org/g:0257ba766443f11cf61c52db9b480337e44b48c8

commit r11-10594-g0257ba766443f11cf61c52db9b480337e44b48c8
Author: Harald Anlauf <anlauf@gmx.de>
Date:   Fri Mar 17 22:24:49 2023 +0100

    Fortran: procedures with BIND(C) attribute require explicit interface
[PR85877]

    gcc/fortran/ChangeLog:

            PR fortran/85877
            * resolve.c (resolve_fl_procedure): Check for an explicit interface
            of procedures with the BIND(C) attribute (F2018:15.4.2.2).

    gcc/testsuite/ChangeLog:

            PR fortran/85877
            * gfortran.dg/pr85877.f90: New test.

    (cherry picked from commit 5426ab34643d9e6502f3ee572891a03471fa33ed)

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

* [Bug fortran/85877] [10/11/12/13 Regression] ICE in fold_convert_loc, at fold-const.c:2449
       [not found] <bug-85877-4@http.gcc.gnu.org/bugzilla/>
                   ` (9 preceding siblings ...)
  2023-03-24 18:41 ` cvs-commit at gcc dot gnu.org
@ 2023-03-24 18:44 ` cvs-commit at gcc dot gnu.org
  2023-03-24 18:45 ` anlauf at gcc dot gnu.org
  11 siblings, 0 replies; 12+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2023-03-24 18:44 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #15 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:dca8e28c990547648543175de9b6e05356f77e8a

commit r10-11264-gdca8e28c990547648543175de9b6e05356f77e8a
Author: Harald Anlauf <anlauf@gmx.de>
Date:   Fri Mar 17 22:24:49 2023 +0100

    Fortran: procedures with BIND(C) attribute require explicit interface
[PR85877]

    gcc/fortran/ChangeLog:

            PR fortran/85877
            * resolve.c (resolve_fl_procedure): Check for an explicit interface
            of procedures with the BIND(C) attribute (F2018:15.4.2.2).

    gcc/testsuite/ChangeLog:

            PR fortran/85877
            * gfortran.dg/pr85877.f90: New test.

    (cherry picked from commit 5426ab34643d9e6502f3ee572891a03471fa33ed)

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

* [Bug fortran/85877] [10/11/12/13 Regression] ICE in fold_convert_loc, at fold-const.c:2449
       [not found] <bug-85877-4@http.gcc.gnu.org/bugzilla/>
                   ` (10 preceding siblings ...)
  2023-03-24 18:44 ` cvs-commit at gcc dot gnu.org
@ 2023-03-24 18:45 ` anlauf at gcc dot gnu.org
  11 siblings, 0 replies; 12+ messages in thread
From: anlauf at gcc dot gnu.org @ 2023-03-24 18:45 UTC (permalink / raw)
  To: gcc-bugs

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

anlauf at gcc dot gnu.org changed:

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

--- Comment #16 from anlauf at gcc dot gnu.org ---
Fixed on all affected branches.  Closing.

Thanks for the report!

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

end of thread, other threads:[~2023-03-24 18:45 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-85877-4@http.gcc.gnu.org/bugzilla/>
2020-12-22 21:27 ` [Bug fortran/85877] [8/9/10/11 Regression] ICE in fold_convert_loc, at fold-const.c:2449 anlauf at gcc dot gnu.org
2020-12-27 21:04 ` anlauf at gcc dot gnu.org
2021-05-14  9:50 ` [Bug fortran/85877] [9/10/11/12 " jakub at gcc dot gnu.org
2021-06-01  8:11 ` rguenth at gcc dot gnu.org
2022-05-27  9:39 ` [Bug fortran/85877] [10/11/12/13 " rguenth at gcc dot gnu.org
2022-06-28 10:35 ` jakub at gcc dot gnu.org
2023-03-17 21:37 ` anlauf at gcc dot gnu.org
2023-03-19 19:33 ` cvs-commit at gcc dot gnu.org
2023-03-22 18:00 ` cvs-commit at gcc dot gnu.org
2023-03-24 18:41 ` cvs-commit at gcc dot gnu.org
2023-03-24 18:44 ` cvs-commit at gcc dot gnu.org
2023-03-24 18:45 ` anlauf 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).