This is the mail archive of the
mailing list for the GCC project.
Re: [patch, fortran] PR66310 Problems with intrinsic repeat for large number of copies
- From: Jerry DeLisle <jvdelisle at charter dot net>
- To: Dominique d'Humières <dominiq at lps dot ens dot fr>
- Cc: FX Coudert <fxcoudert at gmail dot com>, fortran at gcc dot gnu dot org, gcc-patches <gcc-patches at gcc dot gnu dot org>
- Date: Tue, 12 Jul 2016 11:34:28 -0700
- Subject: Re: [patch, fortran] PR66310 Problems with intrinsic repeat for large number of copies
- Authentication-results: sourceware.org; auth=none
- References: <050050EA-5726-4383-B256-A8C2B6F64730@lps.ens.fr>
On 07/12/2016 06:26 AM, Dominique d'Humières wrote:
>>> 2016-07-11 Jerry DeLisle <email@example.com>
>>> 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)
> 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.
I am holding. On my system I get:
Operating system error: Cannot allocate memory
Memory allocation failure in xrealloc
Which is what I expect. The error is in trying to allocate the buffer in
write_blockm which it simply can not do. If you think about it, the numbers are
Can you try ncopies = (huge(1)-1)/4 and see what you get?