public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/114781] New: Error in ALLOCATE with MOLD=
@ 2024-04-19 11:35 dcesari69 at gmail dot com
  2024-04-19 19:21 ` [Bug fortran/114781] " anlauf at gcc dot gnu.org
  0 siblings, 1 reply; 2+ messages in thread
From: dcesari69 at gmail dot com @ 2024-04-19 11:35 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 114781
           Summary: Error in ALLOCATE with MOLD=
           Product: gcc
           Version: 13.2.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: dcesari69 at gmail dot com
  Target Milestone: ---

Created attachment 57990
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=57990&action=edit
Failing program

Allocation af an unlimited polymorphic array with MOLD= after a MOVE_ALLOC
fails with an unrealistic allocation size. With slight modifications to the
code the error disappears (see comments in the code itself). The code is
attached. The distribution is a Fedora 38.

# gfortran -g -o mold_test mold_test.f90 
# ./mold_test 
In file 'mold_test.f90', around line 13: Error allocating 1118068033978368
bytes: Cannot allocate memory

Error termination. Backtrace:
#0  0x7f1c5dc23872 in ???
#1  0x7f1c5dc24379 in ???
#2  0x7f1c5dc246bf in ???
#3  0x401669 in __mold_test_mo_MOD_aalloc
        at /home/dcesari@ARPA.EMR.NET/mold_test.f90:12
#4  0x40195b in mold_test
        at /home/dcesari@ARPA.EMR.NET/mold_test.f90:25
#5  0x401992 in main
        at /home/dcesari@ARPA.EMR.NET/mold_test.f90:23

# gfortran --version
GNU Fortran (GCC) 13.2.1 20240316 (Red Hat 13.2.1-7)
Copyright (C) 2023 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

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

* [Bug fortran/114781] Error in ALLOCATE with MOLD=
  2024-04-19 11:35 [Bug fortran/114781] New: Error in ALLOCATE with MOLD= dcesari69 at gmail dot com
@ 2024-04-19 19:21 ` anlauf at gcc dot gnu.org
  0 siblings, 0 replies; 2+ messages in thread
From: anlauf at gcc dot gnu.org @ 2024-04-19 19:21 UTC (permalink / raw)
  To: gcc-bugs

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

anlauf at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|                            |2024-04-19
                 CC|                            |anlauf at gcc dot gnu.org
     Ever confirmed|0                           |1
             Status|UNCONFIRMED                 |NEW

--- Comment #1 from anlauf at gcc dot gnu.org ---
Confirmed.

Interestingly, replacing the lines

    ALLOCATE(arr(1), mold=sample) ! with localsample here it works
    CALL MOVE_ALLOC(arr, tmparr)

by

    ALLOCATE(tmparr(1), mold=sample)

which should be equivalent - the code works fine.

The tree-dump for the MOVE_ALLOC part looks as if it misses a _len component
that is otherwise set by the ALLOCATE.

Not sure if that is relevant, but this is the first thing that caught my
attention.

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

end of thread, other threads:[~2024-04-19 19:21 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-04-19 11:35 [Bug fortran/114781] New: Error in ALLOCATE with MOLD= dcesari69 at gmail dot com
2024-04-19 19:21 ` [Bug fortran/114781] " 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).