This is the mail archive of the
mailing list for the GCC project.
Re: Avoid calls to realloc for nvptx
- From: FX <fxcoudert at gmail dot com>
- To: Bernd Schmidt <bernds at codesourcery dot com>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>, gfortran <fortran at gcc dot gnu dot org>
- Date: Wed, 22 Oct 2014 09:45:29 +0200
- Subject: Re: Avoid calls to realloc for nvptx
- Authentication-results: sourceware.org; auth=none
- References: <5446D752 dot 9010405 at codesourcery dot com>
I’m afraid I don’t understand the reasoning here:
> Since malloc and free are magically provided by the ptx environment, but realloc is missing, it's nontrivial to provide an implementation for it. The Fortran frontend likes to generate calls to realloc, but in one case it seems like we can compute the old size, and call a function that does malloc/memcpy/free instead.
Does "nontrivial to provide” mean that you don’t provide a realloc() implementation in libc or libgcc? If so, I’m afraid the Fortran compiler will be terminally broken, and fixing just one of the use cases is not sufficient.