This is the mail archive of the gcc-patches@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]

Re: [patch, fortran] PR66310 Problems with intrinsic repeat for large number of copies


> > 2016-07-11  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
> > 
> > 	PR fortran/66310
> > 	* simplify.c (gfc_simplify_repeat): Set max repeat to huge - 1 to allow
> > 	one byte for null terminating the resulting string constant.
>
> OK, thanks
Please hold on. I still see several problem with the patch applied. One is

   program p
      character :: z = 'z'
      print *, repeat(z, huge(1)-2**9)
   end

a.out(67209,0x7fff77e0b000) malloc: *** mach_vm_map(size=18446744071562067968) failed (error code=3)
*** error: can't allocate region
*** set a breakpoint in malloc_error_break to debug
Operating system error: Cannot allocate memory
Memory allocation failure in realloc

on x86_64-apple-darwin15.5 with/without the patch. print *, repeat(z, huge(1)-2**9-1) "works".

I’ll try to report the other problems in the PR later today.

Dominique



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