This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug fortran/85816] New: nested spread fails with "Integer overflow in xmallocarray"


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

            Bug ID: 85816
           Summary: nested spread fails with "Integer overflow in
                    xmallocarray"
           Product: gcc
           Version: 8.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: m.diehl at mpie dot de
  Target Milestone: ---

I'm having trouble with nested spread statements on GCC 8.1.0 (Linux
4.16.8-1-ARCH). The same code runs on GCC 7.3.0 (Linux 4.4.0-98-generic). A
seemingly unnecessary set of brackets cures the following error:

Operating system error: Cannot allocate memory
Integer overflow in xmallocarray

when running the following code


program test                                                                    
  implicit none                                                                 

  real(8), dimension(3,3) :: tensor = 4.0                                       
  integer, dimension(3)   :: grid= 16                                           

  write(6,*) spread(spread(tensor,3,grid(1)),4,grid(2)) ! ok                    
  write(6,*) spread((spread(spread(tensor,3,grid(1)),4,grid(2))),5,grid(3)) !
ok (note the brackets)

  write(6,*) spread(spread(spread(tensor,3,grid(1)),4,grid(2)),5,grid(3)) ! not
ok                  

end program

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]