public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/101281] New: [11/12 Regression] ICE with -std=f2003/f2008 and assumed-rank array
@ 2021-07-01  9:51 burnus at gcc dot gnu.org
  2021-07-01 10:04 ` [Bug fortran/101281] " burnus at gcc dot gnu.org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: burnus at gcc dot gnu.org @ 2021-07-01  9:51 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 101281
           Summary: [11/12 Regression] ICE with -std=f2003/f2008 and
                    assumed-rank array
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Keywords: error-recovery, ice-on-invalid-code
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: burnus at gcc dot gnu.org
  Target Milestone: ---

Created attachment 51094
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=51094&action=edit
Compile with -std=f2003 or -std=f2008

Found when working on a BIND(C) character testcase. Can probably be reduced.

The problem seems to be related to assumed-rank arrays and it only occurs (at
least in this testcase) for -std=f2003 and -std=f2008, i.e. it works with
-std=-f2008.

I did see it with GCC 11 and GCC 12 - but GCC 10 also showed:
(null):0: confused by earlier errors, bailing out

For some reasons, it does sometimes not crash with 'f951' in the debugger,
unless I pass '-quiet'

It looks as if some error recovery is failing. In any case:

0x00000000008e6ca6 in gfc_resolve_expr (e=0x270a9f0) at
../../repos/gcc/gcc/fortran/resolve.c:7085
7085      else if (e->symtree != NULL
(gdb) p e->symtree
$1 = (gfc_symtree *) 0x270a9b0
(gdb) p e->symtree->n.sym
$2 = (gfc_symbol *) 0x0

The proc being processed is:

(gdb) p gfc_current_ns->proc_name->name
$9 = 0x7ffff716f258 "a3ar"


Depending how the code is reduced, the ICE is gone. However, I did not try very
hard to reduce the code.


Stacktrace is:

(gdb) p *e
$6 = {expr_type = EXPR_VARIABLE, ts = {type = BT_UNKNOWN,
and all values are 0 except for 'where' and 'symtree'.


ICEs in

0xeb368f crash_signal
        ../../repos/gcc/gcc/toplev.c:328
0x8e6ca6 gfc_resolve_expr(gfc_expr*)
        ../../repos/gcc/gcc/fortran/resolve.c:7086
0x8ea58a gfc_resolve_expr(gfc_expr*)
        ../../repos/gcc/gcc/fortran/resolve.c:7071
0x8ea58a resolve_index_expr
        ../../repos/gcc/gcc/fortran/resolve.c:12444
0x8ea58a resolve_charlen
        ../../repos/gcc/gcc/fortran/resolve.c:12497
0x8ee550 resolve_charlen
        ../../repos/gcc/gcc/fortran/resolve.c:12465
0x8ee550 resolve_types
        ../../repos/gcc/gcc/fortran/resolve.c:17343

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

* [Bug fortran/101281] [11/12 Regression] ICE with -std=f2003/f2008 and assumed-rank array
  2021-07-01  9:51 [Bug fortran/101281] New: [11/12 Regression] ICE with -std=f2003/f2008 and assumed-rank array burnus at gcc dot gnu.org
@ 2021-07-01 10:04 ` burnus at gcc dot gnu.org
  2021-07-01 10:29 ` rguenth at gcc dot gnu.org
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: burnus at gcc dot gnu.org @ 2021-07-01 10:04 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from Tobias Burnus <burnus at gcc dot gnu.org> ---
The main culprit is:

subroutine ar3 (xn) bind(C)
  character(len=n) :: xn(:,:,:)
end

and I forgot to mention that 'n' is only implicitly defined - otherwise, there
is not ICE.

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

* [Bug fortran/101281] [11/12 Regression] ICE with -std=f2003/f2008 and assumed-rank array
  2021-07-01  9:51 [Bug fortran/101281] New: [11/12 Regression] ICE with -std=f2003/f2008 and assumed-rank array burnus at gcc dot gnu.org
  2021-07-01 10:04 ` [Bug fortran/101281] " burnus at gcc dot gnu.org
@ 2021-07-01 10:29 ` rguenth at gcc dot gnu.org
  2021-07-28  7:07 ` rguenth at gcc dot gnu.org
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: rguenth at gcc dot gnu.org @ 2021-07-01 10:29 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

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

* [Bug fortran/101281] [11/12 Regression] ICE with -std=f2003/f2008 and assumed-rank array
  2021-07-01  9:51 [Bug fortran/101281] New: [11/12 Regression] ICE with -std=f2003/f2008 and assumed-rank array burnus at gcc dot gnu.org
  2021-07-01 10:04 ` [Bug fortran/101281] " burnus at gcc dot gnu.org
  2021-07-01 10:29 ` rguenth at gcc dot gnu.org
@ 2021-07-28  7:07 ` rguenth at gcc dot gnu.org
  2022-04-21  7:49 ` rguenth at gcc dot gnu.org
  2023-05-29 10:05 ` [Bug fortran/101281] [11/12/13/14 " jakub at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: rguenth at gcc dot gnu.org @ 2021-07-28  7:07 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|11.2                        |11.3

--- Comment #2 from Richard Biener <rguenth at gcc dot gnu.org> ---
GCC 11.2 is being released, retargeting bugs to GCC 11.3

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

* [Bug fortran/101281] [11/12 Regression] ICE with -std=f2003/f2008 and assumed-rank array
  2021-07-01  9:51 [Bug fortran/101281] New: [11/12 Regression] ICE with -std=f2003/f2008 and assumed-rank array burnus at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2021-07-28  7:07 ` rguenth at gcc dot gnu.org
@ 2022-04-21  7:49 ` rguenth at gcc dot gnu.org
  2023-05-29 10:05 ` [Bug fortran/101281] [11/12/13/14 " jakub at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: rguenth at gcc dot gnu.org @ 2022-04-21  7:49 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|11.3                        |11.4

--- Comment #3 from Richard Biener <rguenth at gcc dot gnu.org> ---
GCC 11.3 is being released, retargeting bugs to GCC 11.4.

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

* [Bug fortran/101281] [11/12/13/14 Regression] ICE with -std=f2003/f2008 and assumed-rank array
  2021-07-01  9:51 [Bug fortran/101281] New: [11/12 Regression] ICE with -std=f2003/f2008 and assumed-rank array burnus at gcc dot gnu.org
                   ` (3 preceding siblings ...)
  2022-04-21  7:49 ` rguenth at gcc dot gnu.org
@ 2023-05-29 10:05 ` jakub at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: jakub at gcc dot gnu.org @ 2023-05-29 10:05 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|11.4                        |11.5

--- Comment #4 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
GCC 11.4 is being released, retargeting bugs to GCC 11.5.

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

end of thread, other threads:[~2023-05-29 10:05 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-01  9:51 [Bug fortran/101281] New: [11/12 Regression] ICE with -std=f2003/f2008 and assumed-rank array burnus at gcc dot gnu.org
2021-07-01 10:04 ` [Bug fortran/101281] " burnus at gcc dot gnu.org
2021-07-01 10:29 ` rguenth at gcc dot gnu.org
2021-07-28  7:07 ` rguenth at gcc dot gnu.org
2022-04-21  7:49 ` rguenth at gcc dot gnu.org
2023-05-29 10:05 ` [Bug fortran/101281] [11/12/13/14 " jakub 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).