[patch, fortran] PR66310 Problems with intrinsic repeat for large number of copies
Jerry DeLisle
jvdelisle@charter.net
Tue Jul 19 16:43:00 GMT 2016
On 07/19/2016 02:56 AM, Dominique d'Humières wrote:
>
>> Le 18 juil. 2016 à 02:02, Jerry DeLisle <jvdelisle@charter.net> a écrit :
>>
>> Please test this revised patch. See my comments in the PR.
>>
>> I think we should commit this one.
>>
>> Jerry
>
> Jerry,
>
See latest patch attached. Fixes a few things and documents a TODO
Jerry
> As said on IRC I think the limit should be documented and a TODO comment added to gcc/fortran/gfortran.h.
>
> While trying to bootstrap with the patch I got
>
> /opt/gcc/build_w/./prev-gcc/xg++ -B/opt/gcc/build_w/./prev-gcc/ -B/opt/gcc/gcc7w/x86_64-apple-darwin15.5.0/bin/ -nostdinc++ -B/opt/gcc/build_w/prev-x86_64-apple-darwin15.5.0/libstdc++-v3/src/.libs -B/opt/gcc/build_w/prev-x86_64-apple-darwin15.5.0/libstdc++-v3/libsupc++/.libs -I/opt/gcc/build_w/prev-x86_64-apple-darwin15.5.0/libstdc++-v3/include/x86_64-apple-darwin15.5.0 -I/opt/gcc/build_w/prev-x86_64-apple-darwin15.5.0/libstdc++-v3/include -I/opt/gcc/work/libstdc++-v3/libsupc++ -L/opt/gcc/build_w/prev-x86_64-apple-darwin15.5.0/libstdc++-v3/src/.libs -L/opt/gcc/build_w/prev-x86_64-apple-darwin15.5.0/libstdc++-v3/libsupc++/.libs -fno-PIE -c -DIN_GCC_FRONTEND -g -O2 -gtoggle -DIN_GCC -fno-exceptions -fno-rtti -fasynchronous-unwind-tables -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wmissing-format-attribute -Woverloaded-virtual -pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings -Werror -fno-common -DHAVE_CONFIG_H -I. -Ifortran -I../../work/gcc -I../../work/gcc/fortran -I../../work/gcc/../include -I./../intl -I../../work/gcc/../libcpp/include -I/opt/mp-new/include -I../../work/gcc/../libdecnumber -I../../work/gcc/../libdecnumber/dpd -I../libdecnumber -I../../work/gcc/../libbacktrace -I/opt/mp-new/include -o fortran/simplify.o -MT fortran/simplify.o -MMD -MP -MF fortran/.deps/simplify.TPo ../../work/gcc/fortran/simplify.c
> ../../work/gcc/fortran/simplify.c: In function 'gfc_expr* gfc_simplify_repeat(gfc_expr*, gfc_expr*)':
> ../../work/gcc/fortran/simplify.c:5089:11: error: variable 'i' set but not used [-Werror=unused-but-set-variable]
> int i;
> ^
> cc1plus: all warnings being treated as errors
>
> i.e., the lines
>
> int i;
>
> and
>
> i = gfc_validate_kind (BT_INTEGER, gfc_charlen_int_kind, false);
>
> must be deleted. also the comment
>
> /* Compute the maximum value allowed for NCOPIES:
> huge(cl) - 1 / len. */
>
> should be updated.
>
> Last point I have found, the limit does not seem to take into account CHARACTER(KIND=4):
>
> [Book15] f90/bug% cat pr66310_par_4.f90
> program p
> character(len=2,kind=4), parameter :: z = 'yz'
> print *, repeat(z, 2**25)
> end
> [Book15] f90/bug% gfc pr66310_par_4.f90
> f951(3881,0x7fff74e38000) malloc: *** mach_vm_map(size=18446744073441116160) failed (error code=3)
> *** error: can't allocate region
> *** set a breakpoint in malloc_error_break to debug
>
> f951: out of memory allocating 18446744073441116160 bytes after a total of 0 bytes
>
> Thanks for working on this PR.
>
> Dominique
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pr66310-b.diff
Type: text/x-patch
Size: 3374 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20160719/dd515aad/attachment.bin>
More information about the Fortran
mailing list