public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/95882] New: [9/10/11 Regression] ICE in gfc_get_derived_type, at fortran/trans-types.c:2729
@ 2020-06-24 18:57 gscfq@t-online.de
  2020-06-24 18:57 ` [Bug fortran/95882] " gscfq@t-online.de
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: gscfq@t-online.de @ 2020-06-24 18:57 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 95882
           Summary: [9/10/11 Regression] ICE in gfc_get_derived_type, at
                    fortran/trans-types.c:2729
           Product: gcc
           Version: 11.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: gscfq@t-online.de
  Target Milestone: ---

Changed between 20200517 and 20200524 :


$ cat z1.f90
module m
   type t
      character(((0)/0)) :: c
   end type
end


$ gfortran-11-20200517 -c z1.f90
z1.f90:3:22:

    3 |       character(((0)/0)) :: c
      |                      1
Error: Division by zero at (1)


$ gfortran-11-20200621 -c z1.f90
f951: internal compiler error: in gfc_get_derived_type, at
fortran/trans-types.c:2729
0x784843 gfc_get_derived_type(gfc_symbol*, int)
        ../../gcc/fortran/trans-types.c:2729
0x784b68 gfc_typenode_for_spec(gfc_typespec*, int)
        ../../gcc/fortran/trans-types.c:1166
0x784dbe gfc_sym_type(gfc_symbol*)
        ../../gcc/fortran/trans-types.c:2247
0x729616 gfc_get_symbol_decl(gfc_symbol*)
        ../../gcc/fortran/trans-decl.c:1769
0x72c888 gfc_create_module_variable
        ../../gcc/fortran/trans-decl.c:5302
0x6ebde2 do_traverse_symtree
        ../../gcc/fortran/symbol.c:4162
0x72d08b gfc_generate_module_vars(gfc_namespace*)
        ../../gcc/fortran/trans-decl.c:5801
0x707ca4 gfc_generate_module_code(gfc_namespace*)
        ../../gcc/fortran/trans.c:2238
0x6b4b01 translate_all_program_units
        ../../gcc/fortran/parse.c:6294
0x6b4b01 gfc_parse_file()
        ../../gcc/fortran/parse.c:6546
0x70098f gfc_be_parse_file
        ../../gcc/fortran/f95-lang.c:212

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

* [Bug fortran/95882] [9/10/11 Regression] ICE in gfc_get_derived_type, at fortran/trans-types.c:2729
  2020-06-24 18:57 [Bug fortran/95882] New: [9/10/11 Regression] ICE in gfc_get_derived_type, at fortran/trans-types.c:2729 gscfq@t-online.de
@ 2020-06-24 18:57 ` gscfq@t-online.de
  2020-06-25  7:07 ` marxin at gcc dot gnu.org
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: gscfq@t-online.de @ 2020-06-24 18:57 UTC (permalink / raw)
  To: gcc-bugs

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

G. Steinmetz <gscfq@t-online.de> changed:

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

--- Comment #1 from G. Steinmetz <gscfq@t-online.de> ---

Related, with different backtraces :


$ cat z2.f90
module m
   character(((0)/0)) :: c = '123456789'
end


$ cat z3.f90
subroutine s(c)
   character(((0)/0)) :: c
end


$ cat z4.f90
program p
   character(((0)/0)) :: c
   common /x/ c
end


$ cat z5.f90
program p
   character(((0)/0)) :: c = '123456789'
   common c
end

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

* [Bug fortran/95882] [9/10/11 Regression] ICE in gfc_get_derived_type, at fortran/trans-types.c:2729
  2020-06-24 18:57 [Bug fortran/95882] New: [9/10/11 Regression] ICE in gfc_get_derived_type, at fortran/trans-types.c:2729 gscfq@t-online.de
  2020-06-24 18:57 ` [Bug fortran/95882] " gscfq@t-online.de
@ 2020-06-25  7:07 ` marxin at gcc dot gnu.org
  2020-06-25  7:36 ` rguenth at gcc dot gnu.org
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: marxin at gcc dot gnu.org @ 2020-06-25  7:07 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever confirmed|0                           |1
   Last reconfirmed|                            |2020-06-25
                 CC|                            |anlauf at gcc dot gnu.org,
                   |                            |marxin at gcc dot gnu.org

--- Comment #2 from Martin Liška <marxin at gcc dot gnu.org> ---
Started with r11-461-ge5abd1cb91606197.

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

* [Bug fortran/95882] [9/10/11 Regression] ICE in gfc_get_derived_type, at fortran/trans-types.c:2729
  2020-06-24 18:57 [Bug fortran/95882] New: [9/10/11 Regression] ICE in gfc_get_derived_type, at fortran/trans-types.c:2729 gscfq@t-online.de
  2020-06-24 18:57 ` [Bug fortran/95882] " gscfq@t-online.de
  2020-06-25  7:07 ` marxin at gcc dot gnu.org
@ 2020-06-25  7:36 ` rguenth at gcc dot gnu.org
  2020-08-27 14:12 ` cvs-commit at gcc dot gnu.org
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: rguenth at gcc dot gnu.org @ 2020-06-25  7:36 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

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

* [Bug fortran/95882] [9/10/11 Regression] ICE in gfc_get_derived_type, at fortran/trans-types.c:2729
  2020-06-24 18:57 [Bug fortran/95882] New: [9/10/11 Regression] ICE in gfc_get_derived_type, at fortran/trans-types.c:2729 gscfq@t-online.de
                   ` (2 preceding siblings ...)
  2020-06-25  7:36 ` rguenth at gcc dot gnu.org
@ 2020-08-27 14:12 ` cvs-commit at gcc dot gnu.org
  2020-08-27 16:03 ` cvs-commit at gcc dot gnu.org
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2020-08-27 14:12 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Mark Eggleston
<markeggleston@gcc.gnu.org>:

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

commit r11-2907-gc336eda750d4e7a0827fedf995da955d6d88d5ca
Author: Mark Eggleston <markeggleston@gcc.gnu.org>
Date:   Fri Aug 21 06:39:30 2020 +0100

    Fortran  : ICE for division by zero in declaration PR95882

    A length expression containing a divide by zero in a character
    declaration will result in an ICE if the constant is anymore
    complicated that a contant divided by a constant.

    The cause was that char_len_param_value can return MATCH_YES
    even if a divide by zero was seen.  Prior to returning check
    whether a divide by zero was seen and if so set it to MATCH_ERROR.

    2020-08-27  Mark Eggleston  <markeggleston@gcc.gnu.org>

    gcc/fortran

            PR fortran/95882
            * decl.c (char_len_param_value): Check gfc_seen_div0 and
            if it is set return MATCH_ERROR.

    2020-08-27  Mark Eggleston  <markeggleston@gcc.gnu.org>

    gcc/testsuite/

            PR fortran/95882
            * gfortran.dg/pr95882_1.f90: New test.
            * gfortran.dg/pr95882_2.f90: New test.
            * gfortran.dg/pr95882_3.f90: New test.
            * gfortran.dg/pr95882_4.f90: New test.
            * gfortran.dg/pr95882_5.f90: New test.

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

* [Bug fortran/95882] [9/10/11 Regression] ICE in gfc_get_derived_type, at fortran/trans-types.c:2729
  2020-06-24 18:57 [Bug fortran/95882] New: [9/10/11 Regression] ICE in gfc_get_derived_type, at fortran/trans-types.c:2729 gscfq@t-online.de
                   ` (3 preceding siblings ...)
  2020-08-27 14:12 ` cvs-commit at gcc dot gnu.org
@ 2020-08-27 16:03 ` cvs-commit at gcc dot gnu.org
  2020-08-27 17:26 ` cvs-commit at gcc dot gnu.org
  2020-08-27 17:27 ` markeggleston at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2020-08-27 16:03 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-10 branch has been updated by Mark Eggleston
<markeggleston@gcc.gnu.org>:

https://gcc.gnu.org/g:8323d09e82345a1ca39f6630cdd22ccf4ef38a84

commit r10-8679-g8323d09e82345a1ca39f6630cdd22ccf4ef38a84
Author: Mark Eggleston <markeggleston@gcc.gnu.org>
Date:   Fri Aug 21 06:39:30 2020 +0100

    Fortran  : ICE for division by zero in declaration PR95882

    A length expression containing a divide by zero in a character
    declaration will result in an ICE if the constant is anymore
    complicated that a contant divided by a constant.

    The cause was that char_len_param_value can return MATCH_YES
    even if a divide by zero was seen.  Prior to returning check
    whether a divide by zero was seen and if so set it to MATCH_ERROR.

    2020-08-27  Mark Eggleston  <markeggleston@gcc.gnu.org>

    gcc/fortran

            PR fortran/95882
            * decl.c (char_len_param_value): Check gfc_seen_div0 and
            if it is set return MATCH_ERROR.

    2020-08-27  Mark Eggleston  <markeggleston@gcc.gnu.org>

    gcc/testsuite/

            PR fortran/95882
            * gfortran.dg/pr95882_1.f90: New test.
            * gfortran.dg/pr95882_2.f90: New test.
            * gfortran.dg/pr95882_3.f90: New test.
            * gfortran.dg/pr95882_4.f90: New test.
            * gfortran.dg/pr95882_5.f90: New test.

    (cherry picked from commit c336eda750d4e7a0827fedf995da955d6d88d5ca)

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

* [Bug fortran/95882] [9/10/11 Regression] ICE in gfc_get_derived_type, at fortran/trans-types.c:2729
  2020-06-24 18:57 [Bug fortran/95882] New: [9/10/11 Regression] ICE in gfc_get_derived_type, at fortran/trans-types.c:2729 gscfq@t-online.de
                   ` (4 preceding siblings ...)
  2020-08-27 16:03 ` cvs-commit at gcc dot gnu.org
@ 2020-08-27 17:26 ` cvs-commit at gcc dot gnu.org
  2020-08-27 17:27 ` markeggleston at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2020-08-27 17:26 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-9 branch has been updated by Mark Eggleston
<markeggleston@gcc.gnu.org>:

https://gcc.gnu.org/g:042c58a4b8ba48fdf26c9003154e9d3b83d4c568

commit r9-8836-g042c58a4b8ba48fdf26c9003154e9d3b83d4c568
Author: Mark Eggleston <markeggleston@gcc.gnu.org>
Date:   Fri Aug 21 06:39:30 2020 +0100

    Fortran  : ICE for division by zero in declaration PR95882

    A length expression containing a divide by zero in a character
    declaration will result in an ICE if the constant is anymore
    complicated that a contant divided by a constant.

    The cause was that char_len_param_value can return MATCH_YES
    even if a divide by zero was seen.  Prior to returning check
    whether a divide by zero was seen and if so set it to MATCH_ERROR.

    2020-08-27  Mark Eggleston  <markeggleston@gcc.gnu.org>

    gcc/fortran

            PR fortran/95882
            * decl.c (char_len_param_value): Check gfc_seen_div0 and
            if it is set return MATCH_ERROR.

    2020-08-27  Mark Eggleston  <markeggleston@gcc.gnu.org>

    gcc/testsuite/

            PR fortran/95882
            * gfortran.dg/pr95882_1.f90: New test.
            * gfortran.dg/pr95882_2.f90: New test.
            * gfortran.dg/pr95882_3.f90: New test.
            * gfortran.dg/pr95882_4.f90: New test.
            * gfortran.dg/pr95882_5.f90: New test.

    (cherry picked from commit c336eda750d4e7a0827fedf995da955d6d88d5ca)

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

* [Bug fortran/95882] [9/10/11 Regression] ICE in gfc_get_derived_type, at fortran/trans-types.c:2729
  2020-06-24 18:57 [Bug fortran/95882] New: [9/10/11 Regression] ICE in gfc_get_derived_type, at fortran/trans-types.c:2729 gscfq@t-online.de
                   ` (5 preceding siblings ...)
  2020-08-27 17:26 ` cvs-commit at gcc dot gnu.org
@ 2020-08-27 17:27 ` markeggleston at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: markeggleston at gcc dot gnu.org @ 2020-08-27 17:27 UTC (permalink / raw)
  To: gcc-bugs

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

markeggleston at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |markeggleston at gcc dot gnu.org
         Resolution|---                         |FIXED

--- Comment #6 from markeggleston at gcc dot gnu.org ---
committed and backported.

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

end of thread, other threads:[~2020-08-27 17:27 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-24 18:57 [Bug fortran/95882] New: [9/10/11 Regression] ICE in gfc_get_derived_type, at fortran/trans-types.c:2729 gscfq@t-online.de
2020-06-24 18:57 ` [Bug fortran/95882] " gscfq@t-online.de
2020-06-25  7:07 ` marxin at gcc dot gnu.org
2020-06-25  7:36 ` rguenth at gcc dot gnu.org
2020-08-27 14:12 ` cvs-commit at gcc dot gnu.org
2020-08-27 16:03 ` cvs-commit at gcc dot gnu.org
2020-08-27 17:26 ` cvs-commit at gcc dot gnu.org
2020-08-27 17:27 ` markeggleston 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).