public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/93340] [8/9/10 Regression] ICE in check_constant_initializer, at fortran/trans-decl.c:5450
       [not found] <bug-93340-4@http.gcc.gnu.org/bugzilla/>
@ 2020-04-26 20:32 ` anlauf at gcc dot gnu.org
  2020-12-23 21:28 ` [Bug fortran/93340] [8/9/10/11 " anlauf at gcc dot gnu.org
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 8+ messages in thread
From: anlauf at gcc dot gnu.org @ 2020-04-26 20:32 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from anlauf at gcc dot gnu.org ---
AFAICS the code in comment#0 is non-standard:

% gfc-trunk foo.f90 -std=f2018
z1.f90:2:20:

    2 |    character c(2) /'a', 'b'(1:1)/
      |                    1
Error: GNU Extension: Old-style initialization at (1)
z1.f90:3:20:

    3 |    character d(2) /'a', 'bc'(1:1)/
      |                    1
Error: GNU Extension: Old-style initialization at (1)

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

* [Bug fortran/93340] [8/9/10/11 Regression] ICE in check_constant_initializer, at fortran/trans-decl.c:5450
       [not found] <bug-93340-4@http.gcc.gnu.org/bugzilla/>
  2020-04-26 20:32 ` [Bug fortran/93340] [8/9/10 Regression] ICE in check_constant_initializer, at fortran/trans-decl.c:5450 anlauf at gcc dot gnu.org
@ 2020-12-23 21:28 ` anlauf at gcc dot gnu.org
  2021-01-12 22:08 ` anlauf at gcc dot gnu.org
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 8+ messages in thread
From: anlauf at gcc dot gnu.org @ 2020-12-23 21:28 UTC (permalink / raw)
  To: gcc-bugs

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

anlauf at gcc dot gnu.org changed:

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

--- Comment #5 from anlauf at gcc dot gnu.org ---
There is also a related missed simplification of substrings.
The dump-tree of

subroutine p
  call foo ('abcd'(1:1))
end

is:

void p ()
{
  foo (&"abcd"[1]{lb: 1 sz: 1}, 1);
}


I'd expect:

void p ()
{
  foo (&"a"[1]{lb: 1 sz: 1}, 1);
}

which we get for

  call foo ('a'(1:1))

or

  call foo ('a')

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

* [Bug fortran/93340] [8/9/10/11 Regression] ICE in check_constant_initializer, at fortran/trans-decl.c:5450
       [not found] <bug-93340-4@http.gcc.gnu.org/bugzilla/>
  2020-04-26 20:32 ` [Bug fortran/93340] [8/9/10 Regression] ICE in check_constant_initializer, at fortran/trans-decl.c:5450 anlauf at gcc dot gnu.org
  2020-12-23 21:28 ` [Bug fortran/93340] [8/9/10/11 " anlauf at gcc dot gnu.org
@ 2021-01-12 22:08 ` anlauf at gcc dot gnu.org
  2021-01-14 19:26 ` cvs-commit at gcc dot gnu.org
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 8+ messages in thread
From: anlauf at gcc dot gnu.org @ 2021-01-12 22:08 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #6 from anlauf at gcc dot gnu.org ---
Tentative patch: https://gcc.gnu.org/pipermail/fortran/2021-January/055589.html

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

* [Bug fortran/93340] [8/9/10/11 Regression] ICE in check_constant_initializer, at fortran/trans-decl.c:5450
       [not found] <bug-93340-4@http.gcc.gnu.org/bugzilla/>
                   ` (2 preceding siblings ...)
  2021-01-12 22:08 ` anlauf at gcc dot gnu.org
@ 2021-01-14 19:26 ` cvs-commit at gcc dot gnu.org
  2021-01-14 19:29 ` anlauf at gcc dot gnu.org
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 8+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-01-14 19:26 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #7 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:bdd1b1f55529da00b867ef05a53a08fbfc3d1c2e

commit r11-6687-gbdd1b1f55529da00b867ef05a53a08fbfc3d1c2e
Author: Harald Anlauf <anlauf@gmx.de>
Date:   Thu Jan 14 20:25:33 2021 +0100

    PR fortran/93340 - fix missed substring simplifications

    Substrings were not reduced early enough for use in initializations,
    such as DATA statements.  Add an early simplification for substrings
    with constant starting and ending points.

    gcc/fortran/ChangeLog:

            * gfortran.h (gfc_resolve_substring): Add prototype.
            * primary.c (match_string_constant): Simplify substrings with
            constant starting and ending points.
            * resolve.c: Rename resolve_substring to gfc_resolve_substring.
            (gfc_resolve_ref): Use renamed function gfc_resolve_substring.

    gcc/testsuite/ChangeLog:

            * substr_10.f90: New test.
            * substr_9.f90: New test.

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

* [Bug fortran/93340] [8/9/10/11 Regression] ICE in check_constant_initializer, at fortran/trans-decl.c:5450
       [not found] <bug-93340-4@http.gcc.gnu.org/bugzilla/>
                   ` (3 preceding siblings ...)
  2021-01-14 19:26 ` cvs-commit at gcc dot gnu.org
@ 2021-01-14 19:29 ` anlauf at gcc dot gnu.org
  2021-02-26 18:45 ` cvs-commit at gcc dot gnu.org
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 8+ messages in thread
From: anlauf at gcc dot gnu.org @ 2021-01-14 19:29 UTC (permalink / raw)
  To: gcc-bugs

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

anlauf at gcc dot gnu.org changed:

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

--- Comment #8 from anlauf at gcc dot gnu.org ---
Should be fixed on master.

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

* [Bug fortran/93340] [8/9/10/11 Regression] ICE in check_constant_initializer, at fortran/trans-decl.c:5450
       [not found] <bug-93340-4@http.gcc.gnu.org/bugzilla/>
                   ` (4 preceding siblings ...)
  2021-01-14 19:29 ` anlauf at gcc dot gnu.org
@ 2021-02-26 18:45 ` cvs-commit at gcc dot gnu.org
  2021-02-26 19:04 ` cvs-commit at gcc dot gnu.org
  2021-02-28 21:56 ` [Bug fortran/93340] [8 " anlauf at gcc dot gnu.org
  7 siblings, 0 replies; 8+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-02-26 18:45 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #9 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:c5ba7770768ed0a7b5d61a3a2fa1625d98be351f

commit r10-9391-gc5ba7770768ed0a7b5d61a3a2fa1625d98be351f
Author: Harald Anlauf <anlauf@gmx.de>
Date:   Thu Jan 14 20:25:33 2021 +0100

    PR fortran/93340 - fix missed substring simplifications

    Substrings were not reduced early enough for use in initializations,
    such as DATA statements.  Add an early simplification for substrings
    with constant starting and ending points.

    gcc/fortran/ChangeLog:

            * gfortran.h (gfc_resolve_substring): Add prototype.
            * primary.c (match_string_constant): Simplify substrings with
            constant starting and ending points.
            * resolve.c: Rename resolve_substring to gfc_resolve_substring.
            (gfc_resolve_ref): Use renamed function gfc_resolve_substring.

    gcc/testsuite/ChangeLog:

            * substr_10.f90: New test.
            * substr_9.f90: New test.

    (cherry picked from commit bdd1b1f55529da00b867ef05a53a08fbfc3d1c2e)

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

* [Bug fortran/93340] [8/9/10/11 Regression] ICE in check_constant_initializer, at fortran/trans-decl.c:5450
       [not found] <bug-93340-4@http.gcc.gnu.org/bugzilla/>
                   ` (5 preceding siblings ...)
  2021-02-26 18:45 ` cvs-commit at gcc dot gnu.org
@ 2021-02-26 19:04 ` cvs-commit at gcc dot gnu.org
  2021-02-28 21:56 ` [Bug fortran/93340] [8 " anlauf at gcc dot gnu.org
  7 siblings, 0 replies; 8+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-02-26 19:04 UTC (permalink / raw)
  To: gcc-bugs

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

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

https://gcc.gnu.org/g:2259e712a6348bd23586dde06cc874a35fdc53c3

commit r9-9252-g2259e712a6348bd23586dde06cc874a35fdc53c3
Author: Harald Anlauf <anlauf@gmx.de>
Date:   Thu Jan 14 20:25:33 2021 +0100

    PR fortran/93340 - fix missed substring simplifications

    Substrings were not reduced early enough for use in initializations,
    such as DATA statements.  Add an early simplification for substrings
    with constant starting and ending points.

    gcc/fortran/ChangeLog:

            * gfortran.h (gfc_resolve_substring): Add prototype.
            * primary.c (match_string_constant): Simplify substrings with
            constant starting and ending points.
            * resolve.c: Rename resolve_substring to gfc_resolve_substring.
            (gfc_resolve_ref): Use renamed function gfc_resolve_substring.

    gcc/testsuite/ChangeLog:

            * substr_10.f90: New test.
            * substr_9.f90: New test.

    (cherry picked from commit bdd1b1f55529da00b867ef05a53a08fbfc3d1c2e)

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

* [Bug fortran/93340] [8 Regression] ICE in check_constant_initializer, at fortran/trans-decl.c:5450
       [not found] <bug-93340-4@http.gcc.gnu.org/bugzilla/>
                   ` (6 preceding siblings ...)
  2021-02-26 19:04 ` cvs-commit at gcc dot gnu.org
@ 2021-02-28 21:56 ` anlauf at gcc dot gnu.org
  7 siblings, 0 replies; 8+ messages in thread
From: anlauf at gcc dot gnu.org @ 2021-02-28 21:56 UTC (permalink / raw)
  To: gcc-bugs

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

anlauf at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |FIXED
             Status|ASSIGNED                    |RESOLVED
   Target Milestone|8.5                         |9.4
            Summary|[8/9/10/11 Regression] ICE  |[8 Regression] ICE in
                   |in                          |check_constant_initializer,
                   |check_constant_initializer, |at
                   |at                          |fortran/trans-decl.c:5450
                   |fortran/trans-decl.c:5450   |

--- Comment #11 from anlauf at gcc dot gnu.org ---
Backported to 10- and 9-branches without changes.

Since it does not apply cleanly to 8-branch, it may not be worth the effort
to adjust the fix and risk new regressions in the final 8-release.
Therefore closing.

Thanks for the report!

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

end of thread, other threads:[~2021-02-28 21:56 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-93340-4@http.gcc.gnu.org/bugzilla/>
2020-04-26 20:32 ` [Bug fortran/93340] [8/9/10 Regression] ICE in check_constant_initializer, at fortran/trans-decl.c:5450 anlauf at gcc dot gnu.org
2020-12-23 21:28 ` [Bug fortran/93340] [8/9/10/11 " anlauf at gcc dot gnu.org
2021-01-12 22:08 ` anlauf at gcc dot gnu.org
2021-01-14 19:26 ` cvs-commit at gcc dot gnu.org
2021-01-14 19:29 ` anlauf at gcc dot gnu.org
2021-02-26 18:45 ` cvs-commit at gcc dot gnu.org
2021-02-26 19:04 ` cvs-commit at gcc dot gnu.org
2021-02-28 21:56 ` [Bug fortran/93340] [8 " 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).