[Patch] Remove arm-specific formats from asm_fprintf

David Wohlferd dw@LimeGreenSocks.com
Wed Jul 23 10:29:00 GMT 2014


I have a release on file with the FSF, but don't have SVN write access.

Problem description:
asm_fprintf allows platforms to add support for new format specifiers by 
using the ASM_FPRINTF_EXTENSIONS macro.  ARM uses this to add support 
for %@ and %r specifiers.

However, it isn't enough to add these two items to the case statement in 
asm_fprintf (which is what ASM_FPRINTF_EXTENSIONS does).  Over in 
c-format.c, there is compile-time checking that is done against calls to 
asm_fprintf to validate the format string.  %@ and %r have been added to 
this checking (see asm_fprintf_char_table), but NOT in a 
platform-specific way.

This means that using %r or %@ will successfully pass the format 
checking on all platforms, but will ICE if used on non-ARM platforms 
since without ASM_FPRINTF_EXTENSIONS, there are no case statements in 
asm_fprintf to support them.

ChangeLog:
2014-07-23  David Wohlferd <dw@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.

dw
-------------- next part --------------
A non-text attachment was scrubbed...
Name: arm.patch
Type: text/x-patch
Size: 5207 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20140723/43ed749d/attachment.bin>


More information about the Gcc-patches mailing list