On Wed, 23 Jul 2014, David Wohlferd wrote:

> 2014-07-23  David Wohlferd <d...@limegreensocks.com>
> 
>         * doc/c-family/c-format.c: Add support for target macro
>           ASM_FPRINTF_TABLE, remove arm-specific formats.
>         * gcc/config/arm/arm.h: Use ASM_FPRINTF_TABLE for %@ and %r.
>         * gcc/doc/tm.texi: Document new target macro.
>         * gcc/doc/tm.texi.in: Ditto.
>         * gcc/testsuite/gcc.dg/format/asm_fprintf-1.c: Make tests
>           for %@ and %r arm-specific.

This patch would have the effect that only compilers for ARM target 
support the formats in asm_fprintf format checking.  That is, when 
building GCC, they would only be accepted when building GCC for ARM 
*host*.  But of course what you want is for them to be accepted when 
building GCC for ARM *target* but any host.  I.e., the support always 
needs to be compiled into c-format.c, and the decision whether to enable 
those formats needs to be taken by GCC when it is run, based on whether it 
is compiling a copy of GCC for ARM target (as opposed to GCC for some 
other target, or some other program altogether).

Existing configuration based on the GCC being compiled is in 
init_dynamic_asm_fprintf_info and other such functions.  I suppose you 
could have a __gcc_asm_fprintf_arm_formats__ identifier declared in some 
GCC header when building a compiler for ARM target (I'm supposing these 
formats are unlikely to be used in files from which tm.h includes could be 
removed any time soon).

-- 
Joseph S. Myers
jos...@codesourcery.com

Reply via email to