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: Szabolcs Nagy <szabolcs dot nagy at arm dot com>
- To: "Andre Vieira (lists)" <Andre dot SimoesDiasVieira at arm dot com>, <gcc-patches at gcc dot gnu dot org>
- Cc: <nd at arm dot com>
- Date: Thu, 14 Jan 2016 15:39:21 +0000
- Subject: Re: [PATCH] Fix math transformation on targets without c99 math functions
- Authentication-results: sourceware.org; auth=none
- Nodisclaimer: True
- 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> <5697B87D dot 8030608 at arm dot com>
- Spamdiagnosticmetadata: NSPM
- Spamdiagnosticoutput: 1:23
On 14/01/16 15:02, Andre Vieira (lists) wrote:
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.
wscanf_s is not c99
(it is in the optional annex k of c11, which is
likely to be removed from the standard)
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)
that's ok to skip (complex become optional in c11)
- floating-point environment
- Functions for greatest-width integer types
these are not ok to skip from c99
- atomics (missing atomic_is_lock_free and atomic_fetch_key)
- Bounds-checking interfaces
these are optional c11 features
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!!
i think newlib should implement the missing c99 apis
otherwise don't expect any c99 optimizations
(and should be considered broken with -std=c99 or higher)