Comments

This fixes two compilation warnings in the ARM backend that result in
a bootstrap failure with current trunk on ARM (PR bootstrap/45444).
The first set of warnings:
/home/mikpe/gcc-4.6-20100828/gcc/config/arm/arm.c: In function 'locate_neon_builtin_icode':
/home/mikpe/gcc-4.6-20100828/gcc/config/arm/arm.c:18913:22: error: uninitialized const member in 'neon_builtin_datum' is invalid in C++ [-Werror=c++-compat]
/home/mikpe/gcc-4.6-20100828/gcc/config/arm/arm.c:17969:20: note: 'itype' should be initialized
/home/mikpe/gcc-4.6-20100828/gcc/config/arm/arm.c:18913:22: error: uninitialized const member in 'neon_builtin_datum' is invalid in C++ [-Werror=c++-compat]
/home/mikpe/gcc-4.6-20100828/gcc/config/arm/arm.c:17970:13: note: 'bits' should be initialized
/home/mikpe/gcc-4.6-20100828/gcc/config/arm/arm.c:18913:22: error: uninitialized const member in 'neon_builtin_datum' is invalid in C++ [-Werror=c++-compat]
/home/mikpe/gcc-4.6-20100828/gcc/config/arm/arm.c:17971:24: note: 'codes' should be initialized
/home/mikpe/gcc-4.6-20100828/gcc/config/arm/arm.c:18913:22: error: uninitialized const member in 'neon_builtin_datum' is invalid in C++ [-Werror=c++-compat]
/home/mikpe/gcc-4.6-20100828/gcc/config/arm/arm.c:17972:22: note: 'num_vars' should be initialized
arise because a search key is wrapped in a larger struct before being
passed to bsearch and a comparison function, and that struct has a
number of const fields that remain initialized in this case. The
wrapping is unnecessary, and removing it fixes the warnings.
The second warning:
/home/mikpe/gcc-4.6-20100828/gcc/config/arm/arm.c: In function 'arm_output_asm_insn':
/home/mikpe/gcc-4.6-20100828/gcc/config/arm/arm.c:22649:3: error: function might be possible candidate for 'gnu_printf' format attribute [-Werror=missing-format-attribute]
arises because arm_output_asm_insn calls va_start and vsprintf, so
gcc deduces that it should have a printf format attribute. Adding
ATTRIBUTE_PRINTF_4 to the declation fixes the warning.
Tested natively on arm-linux-gnueabi, as well as in an i686->arm cross
built with -Wc++-compat -Wmissing-format-attribute in CFLAGS. The native
build now proceeds to the end of stage3 where it dies due to unrelated
bootstrap comparison failures.
Ok for trunk? (I don't have svn write access.)
gcc/
2010-09-01 Mikael Pettersson <mikpe@it.uu.se>
PR bootstrap/45444
* config/arm/arm.c (locate_neon_builtin_icode): Pass &fcode
to neon_builtin_compare via bsearch. Remove variable key.
(neon_builtin_compare): Adjust.
(arm_output_asm_insn): Declare with ATTRIBUTE_PRINTF_4.

On Wed, 2010-09-01 at 16:27 +0200, Mikael Pettersson wrote:
> This fixes two compilation warnings in the ARM backend that result in> a bootstrap failure with current trunk on ARM (PR bootstrap/45444).> > The first set of warnings:> > /home/mikpe/gcc-4.6-20100828/gcc/config/arm/arm.c: In function 'locate_neon_builtin_icode':> /home/mikpe/gcc-4.6-20100828/gcc/config/arm/arm.c:18913:22: error: uninitialized const member in 'neon_builtin_datum' is invalid in C++ [-Werror=c++-compat]> /home/mikpe/gcc-4.6-20100828/gcc/config/arm/arm.c:17969:20: note: 'itype' should be initialized> /home/mikpe/gcc-4.6-20100828/gcc/config/arm/arm.c:18913:22: error: uninitialized const member in 'neon_builtin_datum' is invalid in C++ [-Werror=c++-compat]> /home/mikpe/gcc-4.6-20100828/gcc/config/arm/arm.c:17970:13: note: 'bits' should be initialized> /home/mikpe/gcc-4.6-20100828/gcc/config/arm/arm.c:18913:22: error: uninitialized const member in 'neon_builtin_datum' is invalid in C++ [-Werror=c++-compat]> /home/mikpe/gcc-4.6-20100828/gcc/config/arm/arm.c:17971:24: note: 'codes' should be initialized> /home/mikpe/gcc-4.6-20100828/gcc/config/arm/arm.c:18913:22: error: uninitialized const member in 'neon_builtin_datum' is invalid in C++ [-Werror=c++-compat]> /home/mikpe/gcc-4.6-20100828/gcc/config/arm/arm.c:17972:22: note: 'num_vars' should be initialized> > arise because a search key is wrapped in a larger struct before being> passed to bsearch and a comparison function, and that struct has a> number of const fields that remain initialized in this case. The> wrapping is unnecessary, and removing it fixes the warnings.> > The second warning:> > /home/mikpe/gcc-4.6-20100828/gcc/config/arm/arm.c: In function 'arm_output_asm_insn':> /home/mikpe/gcc-4.6-20100828/gcc/config/arm/arm.c:22649:3: error: function might be possible candidate for 'gnu_printf' format attribute [-Werror=missing-format-attribute]> > arises because arm_output_asm_insn calls va_start and vsprintf, so> gcc deduces that it should have a printf format attribute. Adding> ATTRIBUTE_PRINTF_4 to the declation fixes the warning.> > Tested natively on arm-linux-gnueabi, as well as in an i686->arm cross> built with -Wc++-compat -Wmissing-format-attribute in CFLAGS. The native> build now proceeds to the end of stage3 where it dies due to unrelated> bootstrap comparison failures.> > Ok for trunk? (I don't have svn write access.)> > gcc/> > 2010-09-01 Mikael Pettersson <mikpe@it.uu.se>> > PR bootstrap/45444> * config/arm/arm.c (locate_neon_builtin_icode): Pass &fcode> to neon_builtin_compare via bsearch. Remove variable key.> (neon_builtin_compare): Adjust.> (arm_output_asm_insn): Declare with ATTRIBUTE_PRINTF_4.
This is OK, but do you have that copyright assignment sorted out yet?
R.

Richard Earnshaw writes:
> > gcc/ > > > > 2010-09-01 Mikael Pettersson <mikpe@it.uu.se> > > > > PR bootstrap/45444 > > * config/arm/arm.c (locate_neon_builtin_icode): Pass &fcode > > to neon_builtin_compare via bsearch. Remove variable key. > > (neon_builtin_compare): Adjust. > > (arm_output_asm_insn): Declare with ATTRIBUTE_PRINTF_4. > > This is OK, but do you have that copyright assignment sorted out yet?
I started that process, but I'm now almost certainly switching
employers, so thought it best to wait for that to be finalised
and then get an OK from the new employer.
The last I heard was that things should be finalised by mid-September.
/Mikael