This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Fix math transformation on targets without c99 math functions
- From: "Andre Vieira (lists)" <Andre dot SimoesDiasVieira at arm dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Thu, 14 Jan 2016 15:02:21 +0000
- Subject: Re: [PATCH] Fix math transformation on targets without c99 math functions
- Authentication-results: sourceware.org; auth=none
- References: <DF2450C6-D371-4A2C-B679-9961E2021431 at bell dot net> <alpine dot DEB dot 2 dot 10 dot 1512302346060 dot 23923 at digraph dot polyomino dot org dot uk> <02962534-F59F-4084-AD8C-28F99A07938A at bell dot net> <20160109164856 dot GQ18720 at tucnak dot redhat dot com> <CAKdteOYSHF=fnZRyGOm8HMTOfFD8d7XJhUXE6ZFrwThjv6DeXg at mail dot gmail dot com> <20160111132413 dot GW18720 at tucnak dot redhat dot com> <5693D0AC dot 50307 at bell dot net> <CAKdteObY3ne8imSyKGN+WmoDUhCgCcmjbWbidQ5AF2dYoFuijw at mail dot gmail dot com> <20160111163953 dot GY18720 at tucnak dot redhat dot com>
On 11/01/16 16:39, Jakub Jelinek wrote:
On Mon, Jan 11, 2016 at 05:11:21PM +0100, Christophe Lyon wrote:
I tested a similar version on my side. It just makes the test become
UNSUPPORTED for arm/aarch64 + newlib. They used to pass, though.
Is anything bad on that? The test tests functions that newlib does not
implement, so it is not wrong not to optimize those.
Jakub
Unfortunately c99_functions is a very wide net. For instance, newlib
supports the ceill, but doesn't support wscanf_s nor any bounds checking
function I think.
I extracted all function names from the C99 standard and did a quick nm
and grep to look into whether newlib defined these for arm-none-eabi.
The functions I found missing fall into the following sections:
- Complex Arithmetic (which fall under the function_c99_math_complex class)
- floating-point environment
- Functions for greatest-width integer types
- atomics (missing atomic_is_lock_free and atomic_fetch_key)
- Bounds-checking interfaces
So arm-none-eabi used to be able to "legally" perform the transformation
that we are speaking of. Though since that optimization is now guarded
with the function_c99_misc class it is no longer performed, since we can
not claim newlib supports all functions that are caught by
function_c99_misc.
I don't quite know how to proceed. I suspect a new function class for
C99 math functions (excluding complex) would help here and probably more
places too. Though, I don't know how much work it would be to split
function_c99_misc in that manner.
Opinions welcome!!
Cheers,
Andre