public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/96073] New: [11.0 regression] regression in gfc_format_decoder
@ 2020-07-06  9:42 juergen.reuter at desy dot de
  2020-07-06 12:23 ` [Bug fortran/96073] " juergen.reuter at desy dot de
                   ` (10 more replies)
  0 siblings, 11 replies; 12+ messages in thread
From: juergen.reuter at desy dot de @ 2020-07-06  9:42 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 96073
           Summary: [11.0 regression] regression in gfc_format_decoder
           Product: gcc
           Version: 11.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: juergen.reuter at desy dot de
  Target Milestone: ---

Probably a commit within the last 2-3 days introduced a regression in
gfc_format_decoder:
n gfc_format_decoder, at fortran/error.c:970
I will provide the exact reproducer soon.

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

* [Bug fortran/96073] [11.0 regression] regression in gfc_format_decoder
  2020-07-06  9:42 [Bug fortran/96073] New: [11.0 regression] regression in gfc_format_decoder juergen.reuter at desy dot de
@ 2020-07-06 12:23 ` juergen.reuter at desy dot de
  2020-07-06 15:32 ` [Bug fortran/96073] [11 Regression] " rguenth at gcc dot gnu.org
                   ` (9 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: juergen.reuter at desy dot de @ 2020-07-06 12:23 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from Jürgen Reuter <juergen.reuter at desy dot de> ---
Next step, full error message: 
ibtool: compile:  gfortran -I../basics -I../utilities -I../testing -I../system
-I../combinatorics -I../rng -I../physics -I../fastjet -I../qft -I../types
-I../particles -I../../circe1/src -I../../circe2/src -I../pdf_builtin
-I../lhapdf -I../qed_pdf -I../variables -I../expr_base -I../parsing -g -O2 -c
sf_lhapdf.f90  -fPIC -o .libs/sf_lhapdf.o

in gfc_format_decoder, at fortran/error.c:970
0x5f46ce gfc_format_decoder
        ../../gcc/fortran/error.c:970
0x18b722c pp_format(pretty_printer*, text_info*)
        ../../gcc/pretty-print.c:1475
0x189c41e diagnostic_report_diagnostic(diagnostic_context*, diagnostic_info*)
        ../../gcc/diagnostic.c:1159
0x807a05 gfc_report_diagnostic
        ../../gcc/fortran/error.c:782
0x807a05 gfc_warning
        ../../gcc/fortran/error.c:815
0x808016 gfc_warning(int, char const*, ...)
        ../../gcc/fortran/error.c:846
0x9572bf check_against_globals
        ../../gcc/fortran/frontend-passes.c:5528
0x8a8b02 do_traverse_symtree
        ../../gcc/fortran/symbol.c:4170
0x95f5d1 gfc_check_externals(gfc_namespace*)
        ../../gcc/fortran/frontend-passes.c:5563
0x86e554 gfc_parse_file()
        ../../gcc/fortran/parse.c:6499
0x8bf9bf gfc_be_parse_file
        ../../gcc/fortran/f95-lang.c:212
Please submit a full bug report,


Code will follow in a minute.

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

* [Bug fortran/96073] [11 Regression] regression in gfc_format_decoder
  2020-07-06  9:42 [Bug fortran/96073] New: [11.0 regression] regression in gfc_format_decoder juergen.reuter at desy dot de
  2020-07-06 12:23 ` [Bug fortran/96073] " juergen.reuter at desy dot de
@ 2020-07-06 15:32 ` rguenth at gcc dot gnu.org
  2020-07-06 16:03 ` [Bug fortran/96073] [11.0 regression] " juergen.reuter at desy dot de
                   ` (8 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: rguenth at gcc dot gnu.org @ 2020-07-06 15:32 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P4
   Target Milestone|---                         |11.0
            Summary|[11.0 regression]           |[11 Regression] regression
                   |regression in               |in gfc_format_decoder
                   |gfc_format_decoder          |

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

* [Bug fortran/96073] [11.0 regression] regression in gfc_format_decoder
  2020-07-06  9:42 [Bug fortran/96073] New: [11.0 regression] regression in gfc_format_decoder juergen.reuter at desy dot de
  2020-07-06 12:23 ` [Bug fortran/96073] " juergen.reuter at desy dot de
  2020-07-06 15:32 ` [Bug fortran/96073] [11 Regression] " rguenth at gcc dot gnu.org
@ 2020-07-06 16:03 ` juergen.reuter at desy dot de
  2020-07-06 17:51 ` tkoenig at gcc dot gnu.org
                   ` (7 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: juergen.reuter at desy dot de @ 2020-07-06 16:03 UTC (permalink / raw)
  To: gcc-bugs

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

Jürgen Reuter <juergen.reuter at desy dot de> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|[11 Regression] regression  |[11.0 regression]
                   |in gfc_format_decoder       |regression in
                   |                            |gfc_format_decoder

--- Comment #2 from Jürgen Reuter <juergen.reuter at desy dot de> ---
Ok, this is triggered by a stupid thing in our own code, but I think the
compiler should not stumble over it. The error appears when there is a routine
that is defined as external, but there is also an explicit interface for it:
module m
  implicit none
  private

  interface
     subroutine GetXminM (set, xmin)
       integer, intent(in) :: set
       real, intent(out) :: xmin
     end subroutine GetXminM
  end interface

contains

  subroutine s ()
    real :: xmin
    integer :: set
    external :: GetXminM
    call GetXminM (set, xmin)
  end subroutine s

end module m

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

* [Bug fortran/96073] [11.0 regression] regression in gfc_format_decoder
  2020-07-06  9:42 [Bug fortran/96073] New: [11.0 regression] regression in gfc_format_decoder juergen.reuter at desy dot de
                   ` (2 preceding siblings ...)
  2020-07-06 16:03 ` [Bug fortran/96073] [11.0 regression] " juergen.reuter at desy dot de
@ 2020-07-06 17:51 ` tkoenig at gcc dot gnu.org
  2020-07-07  8:56 ` marxin at gcc dot gnu.org
                   ` (6 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: tkoenig at gcc dot gnu.org @ 2020-07-06 17:51 UTC (permalink / raw)
  To: gcc-bugs

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

Thomas Koenig <tkoenig at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Assignee|unassigned at gcc dot gnu.org      |tkoenig at gcc dot gnu.org
                 CC|                            |tkoenig at gcc dot gnu.org
             Status|UNCONFIRMED                 |ASSIGNED
     Ever confirmed|0                           |1
   Last reconfirmed|                            |2020-07-06

--- Comment #3 from Thomas Koenig <tkoenig at gcc dot gnu.org> ---
>From the backtrace, that was very probably me with
https://gcc.gnu.org/git/gitweb.cgi?p=gcc.git;h=cc9a9229285a26ac12bc8de53237ce9c4d42f867
.

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

* [Bug fortran/96073] [11.0 regression] regression in gfc_format_decoder
  2020-07-06  9:42 [Bug fortran/96073] New: [11.0 regression] regression in gfc_format_decoder juergen.reuter at desy dot de
                   ` (3 preceding siblings ...)
  2020-07-06 17:51 ` tkoenig at gcc dot gnu.org
@ 2020-07-07  8:56 ` marxin at gcc dot gnu.org
  2020-07-11  9:42 ` tkoenig at gcc dot gnu.org
                   ` (5 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: marxin at gcc dot gnu.org @ 2020-07-07  8:56 UTC (permalink / raw)
  To: gcc-bugs

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

Martin Liška <marxin at gcc dot gnu.org> changed:

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

--- Comment #4 from Martin Liška <marxin at gcc dot gnu.org> ---
(In reply to Thomas Koenig from comment #3)
> From the backtrace, that was very probably me with
> https://gcc.gnu.org/git/gitweb.cgi?p=gcc.git;
> h=cc9a9229285a26ac12bc8de53237ce9c4d42f867 .

Yes, it started with this revision.

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

* [Bug fortran/96073] [11.0 regression] regression in gfc_format_decoder
  2020-07-06  9:42 [Bug fortran/96073] New: [11.0 regression] regression in gfc_format_decoder juergen.reuter at desy dot de
                   ` (4 preceding siblings ...)
  2020-07-07  8:56 ` marxin at gcc dot gnu.org
@ 2020-07-11  9:42 ` tkoenig at gcc dot gnu.org
  2020-07-11  9:57 ` tkoenig at gcc dot gnu.org
                   ` (4 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: tkoenig at gcc dot gnu.org @ 2020-07-11  9:42 UTC (permalink / raw)
  To: gcc-bugs

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

Thomas Koenig <tkoenig at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |ice-on-valid-code

--- Comment #5 from Thomas Koenig <tkoenig at gcc dot gnu.org> ---
I see nothing in the standard which prohibits this, so ice-on-valid.

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

* [Bug fortran/96073] [11.0 regression] regression in gfc_format_decoder
  2020-07-06  9:42 [Bug fortran/96073] New: [11.0 regression] regression in gfc_format_decoder juergen.reuter at desy dot de
                   ` (5 preceding siblings ...)
  2020-07-11  9:42 ` tkoenig at gcc dot gnu.org
@ 2020-07-11  9:57 ` tkoenig at gcc dot gnu.org
  2020-07-11 13:11 ` tkoenig at gcc dot gnu.org
                   ` (3 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: tkoenig at gcc dot gnu.org @ 2020-07-11  9:57 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #6 from Thomas Koenig <tkoenig at gcc dot gnu.org> ---
What we have here is, in gfc_check_externals0,

(gdb) call debug(def_sym->formal) 

|| symbol: '_formal_0'    
  type spec : (INTEGER 4)
  attributes: (VARIABLE  ARTIFICIAL DUMMY)
|| symbol: '_formal_1'    
  type spec : (REAL 4)
  attributes: (VARIABLE  ARTIFICIAL DUMMY)
(gdb) call debug(sym->formal)

|| symbol: 'set'          
  type spec : (INTEGER 4)
  attributes: (VARIABLE  DUMMY(IN))
|| symbol: 'xmin'         
  type spec : (REAL 4)
  attributes: (VARIABLE  DUMMY(OUT))

so the inferred argument list from the call does not match the
interface.  And, since the location is not set, we get an ICE
on top of it.

I think resolution should have found the interface in addition
to the EXTERNAL statement.

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

* [Bug fortran/96073] [11.0 regression] regression in gfc_format_decoder
  2020-07-06  9:42 [Bug fortran/96073] New: [11.0 regression] regression in gfc_format_decoder juergen.reuter at desy dot de
                   ` (6 preceding siblings ...)
  2020-07-11  9:57 ` tkoenig at gcc dot gnu.org
@ 2020-07-11 13:11 ` tkoenig at gcc dot gnu.org
  2020-07-11 17:19 ` cvs-commit at gcc dot gnu.org
                   ` (2 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: tkoenig at gcc dot gnu.org @ 2020-07-11 13:11 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #7 from Thomas Koenig <tkoenig at gcc dot gnu.org> ---
Two things:  We should not warn about INTENT mismatches when
we artificially generate the prototypes, and we should set a
valid gfc_locus.

Both done with the attached patch.

diff --git a/gcc/fortran/frontend-passes.c b/gcc/fortran/frontend-passes.c
index 69f9ca64c97..7768fdc25ca 100644
--- a/gcc/fortran/frontend-passes.c
+++ b/gcc/fortran/frontend-passes.c
@@ -5441,6 +5441,7 @@ check_externals_procedure (gfc_symbol *sym, locus *loc,
   gfc_current_ns = gsym->ns;

   gfc_get_formal_from_actual_arglist (new_sym, actual);
+  new_sym->declared_at = *loc;
   gfc_current_ns = save_ns;

   return 0;
diff --git a/gcc/fortran/interface.c b/gcc/fortran/interface.c
index 0cc504f4e04..e51820918b8 100644
--- a/gcc/fortran/interface.c
+++ b/gcc/fortran/interface.c
@@ -1343,7 +1343,8 @@ gfc_check_dummy_characteristics (gfc_symbol *s1,
gfc_symbol *s2,
     }

   /* Check INTENT.  */
-  if (s1->attr.intent != s2->attr.intent)
+  if (s1->attr.intent != s2->attr.intent && !s1->attr.artificial
+      && !s2->attr.artificial)
     {
       snprintf (errmsg, err_len, "INTENT mismatch in argument '%s'",
                s1->name);

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

* [Bug fortran/96073] [11.0 regression] regression in gfc_format_decoder
  2020-07-06  9:42 [Bug fortran/96073] New: [11.0 regression] regression in gfc_format_decoder juergen.reuter at desy dot de
                   ` (7 preceding siblings ...)
  2020-07-11 13:11 ` tkoenig at gcc dot gnu.org
@ 2020-07-11 17:19 ` cvs-commit at gcc dot gnu.org
  2020-07-11 17:25 ` tkoenig at gcc dot gnu.org
  2020-07-11 17:25 ` tkoenig at gcc dot gnu.org
  10 siblings, 0 replies; 12+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2020-07-11 17:19 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #8 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Thomas Kथà¤nig <tkoenig@gcc.gnu.org>:

https://gcc.gnu.org/g:90efb2512d40f0a59b063aa0416a6d28849ee424

commit r11-2036-g90efb2512d40f0a59b063aa0416a6d28849ee424
Author: Thomas Koenig <tkoenig@gcc.gnu.org>
Date:   Sat Jul 11 19:16:16 2020 +0200

    Fix ICE on warning with new interface check.

    In the test case, there was a warning about INTENT where an EXTERNAL
    masked an interface in an outer scope, when the location of the
    symbol was not set, leading to an ICE.

    Two problems, two-part solution: It makes no sense to warn about
    INTENT for artificially generated formal argument lists, and the
    location should be set.

    gcc/fortran/ChangeLog:

            PR fortran/96073
            * frontend-passes.c (check_externals_procedure):  Add locus
            information for new_sym.
            * interface.c (gfc_check_dummy_characteristics): Do not warn
            about INTENT for artificially generated variables.

    gcc/testsuite/ChangeLog:

            PR fortran/96073
            * gfortran.dg/interface_48.f90: New test.

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

* [Bug fortran/96073] [11.0 regression] regression in gfc_format_decoder
  2020-07-06  9:42 [Bug fortran/96073] New: [11.0 regression] regression in gfc_format_decoder juergen.reuter at desy dot de
                   ` (8 preceding siblings ...)
  2020-07-11 17:19 ` cvs-commit at gcc dot gnu.org
@ 2020-07-11 17:25 ` tkoenig at gcc dot gnu.org
  2020-07-11 17:25 ` tkoenig at gcc dot gnu.org
  10 siblings, 0 replies; 12+ messages in thread
From: tkoenig at gcc dot gnu.org @ 2020-07-11 17:25 UTC (permalink / raw)
  To: gcc-bugs

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

Thomas Koenig <tkoenig at gcc dot gnu.org> changed:

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

--- Comment #9 from Thomas Koenig <tkoenig at gcc dot gnu.org> ---
Fixed on master, closing.

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

* [Bug fortran/96073] [11.0 regression] regression in gfc_format_decoder
  2020-07-06  9:42 [Bug fortran/96073] New: [11.0 regression] regression in gfc_format_decoder juergen.reuter at desy dot de
                   ` (9 preceding siblings ...)
  2020-07-11 17:25 ` tkoenig at gcc dot gnu.org
@ 2020-07-11 17:25 ` tkoenig at gcc dot gnu.org
  10 siblings, 0 replies; 12+ messages in thread
From: tkoenig at gcc dot gnu.org @ 2020-07-11 17:25 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #10 from Thomas Koenig <tkoenig at gcc dot gnu.org> ---
... and thanks for the timely bug report!

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

end of thread, other threads:[~2020-07-11 17:25 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-06  9:42 [Bug fortran/96073] New: [11.0 regression] regression in gfc_format_decoder juergen.reuter at desy dot de
2020-07-06 12:23 ` [Bug fortran/96073] " juergen.reuter at desy dot de
2020-07-06 15:32 ` [Bug fortran/96073] [11 Regression] " rguenth at gcc dot gnu.org
2020-07-06 16:03 ` [Bug fortran/96073] [11.0 regression] " juergen.reuter at desy dot de
2020-07-06 17:51 ` tkoenig at gcc dot gnu.org
2020-07-07  8:56 ` marxin at gcc dot gnu.org
2020-07-11  9:42 ` tkoenig at gcc dot gnu.org
2020-07-11  9:57 ` tkoenig at gcc dot gnu.org
2020-07-11 13:11 ` tkoenig at gcc dot gnu.org
2020-07-11 17:19 ` cvs-commit at gcc dot gnu.org
2020-07-11 17:25 ` tkoenig at gcc dot gnu.org
2020-07-11 17:25 ` tkoenig 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).