public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/87448] ICE at trans-expr:3417 in allocate statement with type signature using an associated variable
       [not found] <bug-87448-4@http.gcc.gnu.org/bugzilla/>
@ 2022-01-25  8:37 ` mscfd at gmx dot net
  2023-11-01 18:08 ` pault at gcc dot gnu.org
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 4+ messages in thread
From: mscfd at gmx dot net @ 2022-01-25  8:37 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from martin <mscfd at gmx dot net> ---
With gfortran-12, the ICE is gone, but the produced error message does not look
right.

mod.f90:12:25:

   12 |    associate(l => len(cs))
      |                         1
Error: Symbol ‘l’ at (1) has no IMPLICIT type

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

* [Bug fortran/87448] ICE at trans-expr:3417 in allocate statement with type signature using an associated variable
       [not found] <bug-87448-4@http.gcc.gnu.org/bugzilla/>
  2022-01-25  8:37 ` [Bug fortran/87448] ICE at trans-expr:3417 in allocate statement with type signature using an associated variable mscfd at gmx dot net
@ 2023-11-01 18:08 ` pault at gcc dot gnu.org
  2023-12-17 17:49 ` anlauf at gcc dot gnu.org
  2023-12-18  6:59 ` paul.richard.thomas at gmail dot com
  3 siblings, 0 replies; 4+ messages in thread
From: pault at gcc dot gnu.org @ 2023-11-01 18:08 UTC (permalink / raw)
  To: gcc-bugs

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

Paul Thomas <pault at gcc dot gnu.org> changed:

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

--- Comment #4 from Paul Thomas <pault at gcc dot gnu.org> ---
Created attachment 56484
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=56484&action=edit
Fix for this PR

Somehow this missed being a blocker for the ASSOCIATE meta-bug.

The patch is so unbelievably simple that I am going to think about it for 24
hours, even though it regtests just fine :-)

module mod

implicit none
public

contains

function fun(cs) result(rs)
   character(len=:), allocatable :: rs
   character(len=*), intent(in) :: cs

   associate(l => len(cs))
      allocate(character(len=1+l) :: rs)
      write (rs, '(i5)') l
   end associate
end function fun

end module mod

  use mod
  character(:), allocatable :: res
  res = fun("abcd")
  if (res /= '    4') stop 1
end

Gives the expected result.

Paul

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

* [Bug fortran/87448] ICE at trans-expr:3417 in allocate statement with type signature using an associated variable
       [not found] <bug-87448-4@http.gcc.gnu.org/bugzilla/>
  2022-01-25  8:37 ` [Bug fortran/87448] ICE at trans-expr:3417 in allocate statement with type signature using an associated variable mscfd at gmx dot net
  2023-11-01 18:08 ` pault at gcc dot gnu.org
@ 2023-12-17 17:49 ` anlauf at gcc dot gnu.org
  2023-12-18  6:59 ` paul.richard.thomas at gmail dot com
  3 siblings, 0 replies; 4+ messages in thread
From: anlauf at gcc dot gnu.org @ 2023-12-17 17:49 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from anlauf at gcc dot gnu.org ---
(In reply to Paul Thomas from comment #4)
> Created attachment 56484 [details]
> Fix for this PR
> 
> Somehow this missed being a blocker for the ASSOCIATE meta-bug.
> 
> The patch is so unbelievably simple that I am going to think about it for 24
> hours, even though it regtests just fine :-)

And it is so simple that you seem to have forgotten about it...

Are you going to pursue it?

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

* [Bug fortran/87448] ICE at trans-expr:3417 in allocate statement with type signature using an associated variable
       [not found] <bug-87448-4@http.gcc.gnu.org/bugzilla/>
                   ` (2 preceding siblings ...)
  2023-12-17 17:49 ` anlauf at gcc dot gnu.org
@ 2023-12-18  6:59 ` paul.richard.thomas at gmail dot com
  3 siblings, 0 replies; 4+ messages in thread
From: paul.richard.thomas at gmail dot com @ 2023-12-18  6:59 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #6 from paul.richard.thomas at gmail dot com <paul.richard.thomas at gmail dot com> ---
Hi Harald,

I had forgotten about this PR because the fix became incorporated in the
patch for PR89645. In consequence, pr87448.f90 disappeared from the pr87477
failures :-)

One of the last tasks before submitting the fix-up patch for PR89645 was to
remove this chunk because I couldn't understand why it was there.

Thanks for the reminder.

Paul


On Sun, 17 Dec 2023 at 17:49, anlauf at gcc dot gnu.org <
gcc-bugzilla@gcc.gnu.org> wrote:

> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87448
>
> --- Comment #5 from anlauf at gcc dot gnu.org ---
> (In reply to Paul Thomas from comment #4)
> > Created attachment 56484 [details]
> > Fix for this PR
> >
> > Somehow this missed being a blocker for the ASSOCIATE meta-bug.
> >
> > The patch is so unbelievably simple that I am going to think about it
> for 24
> > hours, even though it regtests just fine :-)
>
> And it is so simple that you seem to have forgotten about it...
>
> Are you going to pursue it?
>
> --
> You are receiving this mail because:
> You are on the CC list for the bug.

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

end of thread, other threads:[~2023-12-18  6:59 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-87448-4@http.gcc.gnu.org/bugzilla/>
2022-01-25  8:37 ` [Bug fortran/87448] ICE at trans-expr:3417 in allocate statement with type signature using an associated variable mscfd at gmx dot net
2023-11-01 18:08 ` pault at gcc dot gnu.org
2023-12-17 17:49 ` anlauf at gcc dot gnu.org
2023-12-18  6:59 ` paul.richard.thomas at gmail dot com

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).