This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [patch, libfortran] Fix PR 80687l build failure on nvptx
- From: Janne Blomqvist <blomqvist dot janne at gmail dot com>
- To: Thomas Koenig <tkoenig at netcologne dot de>
- Cc: "fortran at gcc dot gnu dot org" <fortran at gcc dot gnu dot org>, gcc-patches <gcc-patches at gcc dot gnu dot org>, tschwinge at gcc dot gnu dot org
- Date: Tue, 9 May 2017 21:03:43 +0300
- Subject: Re: [patch, libfortran] Fix PR 80687l build failure on nvptx
- Authentication-results: sourceware.org; auth=none
- References: <d3bcfd98-9cb9-3f17-eb99-3383e486e2dc@netcologne.de>
On Tue, May 9, 2017 at 8:35 PM, Thomas Koenig <tkoenig@netcologne.de> wrote:
> Hello world,
>
> the attached patch hopefully fixes the build failure on nvptx introduced
> by my recent matmul library patch. It uses malloc/free if VLAs do not
> work.
>
> Thomas S., does this fix the problem?
>
> Tested on x86_64 to make sure that the matmul tests still pass;
> full regression test still in progress.
>
> OK for trunk if the nvptx problem is fixed and regression-tests pass?
I'd prefer to get rid of VLA's altogether. Which is why I added
-Werror=vla in https://gcc.gnu.org/ml/fortran/2014-11/msg00052.html .
In that message I also helpfully point out that avoiding VLA's can
help limited targets like nvptx that lack VLA's.. :)
VLA's don't come for free. Functions using VLA's require an extra
register for the frame pointer, and AFAIK can't be inlined. Also,
calculating variable offsets might not be possible at compile time as
the offset from the stack/frame pointer might not be known statically.
--
Janne Blomqvist