This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[RFC] Avoid warnings during bootstrap on arm-linux


Hi,

I've tried "make bootstrap" on armv5tejl-unknown-linux-gnu
configured with

../LOCAL/trunk/configure --prefix=/usr/local --enable-threads --disable-libmudflap --disable-libssp --disable-libgomp --disable-libstdcxx-pch --with-gnu-as
--with-gnu-ld --enable-languages=c,c++ --enable-shared --enable-symvers=gnu --enable-__cxa_atexit --disable-nls

and got the following warnings which cause the bootstrap
failure:

/home/kkojima/arm-gcc/./prev-gcc/xgcc -B/home/kkojima/arm-gcc/./prev-gcc/ -B/usr/local/armv5tejl-unknown-linux-gnu/bin/ -c   -g -O2 -DIN_GCC   -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -Wmissing-format-attribute -pedantic -Wno-long-long -Wno-variadic-macros     -Wno-overlength-strings -Werror -fno-common   -DHAVE_CONFIG_H -I. -I. -I../../LOCAL/trunk/gcc -I../../LOCAL/trunk/gcc/. -I../../LOCAL/trunk/gcc/../include -I../../LOCAL/trunk/gcc/../libcpp/include  -I../../LOCAL/trunk/gcc/../libdecnumber -I../../LOCAL/trunk/gcc/../libdecnumber/dpd -I../libdecnumber    insn-opinit.c -o insn-opinit.o
cc1: warnings being treated as errors
insn-opinit.c: In function 'init_all_optabs':
insn-opinit.c:443: error: implicit declaration of function 'arm_vector_mode_supported_p'

/home/kkojima/arm-gcc/./prev-gcc/xgcc -B/home/kkojima/arm-gcc/./prev-gcc/ -B/usr/local/armv5tejl-unknown-linux-gnu/bin/ -c   -g -O2 -DIN_GCC   -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -Wmissing-format-attribute -pedantic -Wno-long-long -Wno-variadic-macros     -Wno-overlength-strings -Werror -fno-common   -DHAVE_CONFIG_H -I. -I. -I../../LOCAL/trunk/gcc -I../../LOCAL/trunk/gcc/. -I../../LOCAL/trunk/gcc/../include -I../../LOCAL/trunk/gcc/../libcpp/include  -I../../LOCAL/trunk/gcc/../libdecnumber -I../../LOCAL/trunk/gcc/../libdecnumber/dpd -I../libdecnumber    insn-output.c -o insn-output.o
cc1: warnings being treated as errors
../../LOCAL/trunk/gcc/config/arm/neon.md: In function 'output_713':
../../LOCAL/trunk/gcc/config/arm/neon.md:754: error: passing argument 1 of 'ffs' makes integer from pointer without a cast
../../LOCAL/trunk/gcc/config/arm/neon.md: In function 'output_714':
../../LOCAL/trunk/gcc/config/arm/neon.md:754: error: passing argument 1 of 'ffs' makes integer from pointer without a cast
../../LOCAL/trunk/gcc/config/arm/neon.md: In function 'output_715':
../../LOCAL/trunk/gcc/config/arm/neon.md:754: error: passing argument 1 of 'ffs' makes integer from pointer without a cast
../../LOCAL/trunk/gcc/config/arm/neon.md: In function 'output_716':
../../LOCAL/trunk/gcc/config/arm/neon.md:754: error: passing argument 1 of 'ffs' makes integer from pointer without a cast
../../LOCAL/trunk/gcc/config/arm/neon.md: In function 'output_717':
../../LOCAL/trunk/gcc/config/arm/neon.md:778: error: passing argument 1 of 'ffs' makes integer from pointer without a cast
../../LOCAL/trunk/gcc/config/arm/neon.md: In function 'output_2603':
../../LOCAL/trunk/gcc/config/arm/neon.md:754: error: passing argument 1 of 'ffs' makes integer from pointer without a cast
../../LOCAL/trunk/gcc/config/arm/neon.md: In function 'output_2604':
../../LOCAL/trunk/gcc/config/arm/neon.md:754: error: passing argument 1 of 'ffs' makes integer from pointer without a cast
../../LOCAL/trunk/gcc/config/arm/neon.md: In function 'output_2605':
../../LOCAL/trunk/gcc/config/arm/neon.md:754: error: passing argument 1 of 'ffs' makes integer from pointer without a cast
../../LOCAL/trunk/gcc/config/arm/neon.md: In function 'output_2606':
../../LOCAL/trunk/gcc/config/arm/neon.md:754: error: passing argument 1 of 'ffs' makes integer from pointer without a cast
../../LOCAL/trunk/gcc/config/arm/neon.md: In function 'output_2607':
../../LOCAL/trunk/gcc/config/arm/neon.md:778: error: passing argument 1 of 'ffs' makes integer from pointer without a cast

/home/kkojima/arm-gcc/./prev-gcc/xgcc -B/home/kkojima/arm-gcc/./prev-gcc/ -B/usr/local/armv5tejl-unknown-linux-gnu/bin/ -c   -g -O2 -DIN_GCC   -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -Wmissing-format-attribute -pedantic -Wno-long-long -Wno-variadic-macros     -Wno-overlength-strings -Werror -fno-common   -DHAVE_CONFIG_H -I. -I. -I../../LOCAL/trunk/gcc -I../../LOCAL/trunk/gcc/. -I../../LOCAL/trunk/gcc/../include -I../../LOCAL/trunk/gcc/../libcpp/include  -I../../LOCAL/trunk/gcc/../libdecnumber -I../../LOCAL/trunk/gcc/../libdecnumber/dpd -I../libdecnumber    \
                ../../LOCAL/trunk/gcc/config/arm/arm.c -o arm.o
cc1: warnings being treated as errors
../../LOCAL/trunk/gcc/config/arm/arm.c: In function 'thumb1_compute_save_reg_mask':
../../LOCAL/trunk/gcc/config/arm/arm.c:10885: error: comparison between signed and unsigned
../../LOCAL/trunk/gcc/config/arm/arm.c: In function 'arm_init_neon_builtins':
../../LOCAL/trunk/gcc/config/arm/arm.c:14864: error: ISO C90 forbids mixed declarations and code
../../LOCAL/trunk/gcc/config/arm/arm.c:14926: error: ISO C90 forbids mixed declarations and code
../../LOCAL/trunk/gcc/config/arm/arm.c:14943: error: ISO C90 forbids mixed declarations and code

It bootstraps successfully with the attached patch.
The hunk for genopinit.c is tested also on i686-linux with
bootstrap and the top level "make -k check".
Could ARM experts look at it?  I'm a newbie for this target
and could have done something wrong.

Regards,
	kaz
--
2007-11-29  Kaz Kojima  <kkojima@gcc.gnu.org>

	* genopinit.c: Include tm_p.h in generated file.

	* config/arm/neon.md (vec_set<mode>_internal): Use INTVAL
	to extract the integer from operands[2].
	(vec_setv2di_internal): Likewise.

	* config/arm/arm.c (thumb1_compute_save_reg_mask): Cast
	the result of arm_size_return_regs to avoid a warning.
	(arm_init_neon_builtins): Move code after declarations.

diff -uprN ORIG/trunk/gcc/config/arm/arm.c LOCAL/trunk/gcc/config/arm/arm.c
--- ORIG/trunk/gcc/config/arm/arm.c	2007-11-23 21:23:23.000000000 +0900
+++ LOCAL/trunk/gcc/config/arm/arm.c	2007-11-29 00:05:13.000000000 +0900
@@ -10882,7 +10882,7 @@ thumb1_compute_save_reg_mask (void)
       reg = thumb_find_work_register (1 << LAST_LO_REGNUM);
       /* Make sure the register returned by thumb_find_work_register is
 	 not part of the return value.  */
-      if (reg * UNITS_PER_WORD <= arm_size_return_regs ())
+      if (reg * UNITS_PER_WORD <= (unsigned) arm_size_return_regs ())
 	reg = LAST_LO_REGNUM;
 
       if (! call_used_regs[reg])
@@ -14839,27 +14839,6 @@ arm_init_neon_builtins (void)
   tree neon_intSI_type_node = make_signed_type (GET_MODE_PRECISION (SImode));
   tree neon_intDI_type_node = make_signed_type (GET_MODE_PRECISION (DImode));
   tree neon_float_type_node = make_node (REAL_TYPE);
-  TYPE_PRECISION (neon_float_type_node) = FLOAT_TYPE_SIZE;
-  layout_type (neon_float_type_node);
-
-  /* Define typedefs which exactly correspond to the modes we are basing vector
-     types on.  If you change these names you'll need to change
-     the table used by arm_mangle_type too.  */
-  (*lang_hooks.types.register_builtin_type) (neon_intQI_type_node,
-					     "__builtin_neon_qi");
-  (*lang_hooks.types.register_builtin_type) (neon_intHI_type_node,
-					     "__builtin_neon_hi");
-  (*lang_hooks.types.register_builtin_type) (neon_intSI_type_node,
-					     "__builtin_neon_si");
-  (*lang_hooks.types.register_builtin_type) (neon_float_type_node,
-					     "__builtin_neon_sf");
-  (*lang_hooks.types.register_builtin_type) (neon_intDI_type_node,
-					     "__builtin_neon_di");
-
-  (*lang_hooks.types.register_builtin_type) (neon_polyQI_type_node,
-					     "__builtin_neon_poly8");
-  (*lang_hooks.types.register_builtin_type) (neon_polyHI_type_node,
-					     "__builtin_neon_poly16");
 
   tree intQI_pointer_node = build_pointer_type (neon_intQI_type_node);
   tree intHI_pointer_node = build_pointer_type (neon_intHI_type_node);
@@ -14913,32 +14892,12 @@ arm_init_neon_builtins (void)
   tree intUSI_type_node = make_unsigned_type (GET_MODE_PRECISION (SImode));
   tree intUDI_type_node = make_unsigned_type (GET_MODE_PRECISION (DImode));
 
-  (*lang_hooks.types.register_builtin_type) (intUQI_type_node,
-					     "__builtin_neon_uqi");
-  (*lang_hooks.types.register_builtin_type) (intUHI_type_node,
-					     "__builtin_neon_uhi");
-  (*lang_hooks.types.register_builtin_type) (intUSI_type_node,
-					     "__builtin_neon_usi");
-  (*lang_hooks.types.register_builtin_type) (intUDI_type_node,
-					     "__builtin_neon_udi");
-
   /* Opaque integer types for structures of vectors.  */
   tree intEI_type_node = make_signed_type (GET_MODE_PRECISION (EImode));
   tree intOI_type_node = make_signed_type (GET_MODE_PRECISION (OImode));
   tree intCI_type_node = make_signed_type (GET_MODE_PRECISION (CImode));
   tree intXI_type_node = make_signed_type (GET_MODE_PRECISION (XImode));
 
-  (*lang_hooks.types.register_builtin_type) (intTI_type_node,
-					     "__builtin_neon_ti");
-  (*lang_hooks.types.register_builtin_type) (intEI_type_node,
-					     "__builtin_neon_ei");
-  (*lang_hooks.types.register_builtin_type) (intOI_type_node,
-					     "__builtin_neon_oi");
-  (*lang_hooks.types.register_builtin_type) (intCI_type_node,
-					     "__builtin_neon_ci");
-  (*lang_hooks.types.register_builtin_type) (intXI_type_node,
-					     "__builtin_neon_xi");
-
   /* Pointers to vector types.  */
   tree V8QI_pointer_node = build_pointer_type (V8QI_type_node);
   tree V4HI_pointer_node = build_pointer_type (V4HI_type_node);
@@ -14986,6 +14945,47 @@ arm_init_neon_builtins (void)
   tree reinterp_ftype_qreg[5][5];
   tree dreg_types[5], qreg_types[5];
 
+  TYPE_PRECISION (neon_float_type_node) = FLOAT_TYPE_SIZE;
+  layout_type (neon_float_type_node);
+
+  /* Define typedefs which exactly correspond to the modes we are basing vector
+     types on.  If you change these names you'll need to change
+     the table used by arm_mangle_type too.  */
+  (*lang_hooks.types.register_builtin_type) (neon_intQI_type_node,
+					     "__builtin_neon_qi");
+  (*lang_hooks.types.register_builtin_type) (neon_intHI_type_node,
+					     "__builtin_neon_hi");
+  (*lang_hooks.types.register_builtin_type) (neon_intSI_type_node,
+					     "__builtin_neon_si");
+  (*lang_hooks.types.register_builtin_type) (neon_float_type_node,
+					     "__builtin_neon_sf");
+  (*lang_hooks.types.register_builtin_type) (neon_intDI_type_node,
+					     "__builtin_neon_di");
+
+  (*lang_hooks.types.register_builtin_type) (neon_polyQI_type_node,
+					     "__builtin_neon_poly8");
+  (*lang_hooks.types.register_builtin_type) (neon_polyHI_type_node,
+					     "__builtin_neon_poly16");
+  (*lang_hooks.types.register_builtin_type) (intUQI_type_node,
+					     "__builtin_neon_uqi");
+  (*lang_hooks.types.register_builtin_type) (intUHI_type_node,
+					     "__builtin_neon_uhi");
+  (*lang_hooks.types.register_builtin_type) (intUSI_type_node,
+					     "__builtin_neon_usi");
+  (*lang_hooks.types.register_builtin_type) (intUDI_type_node,
+					     "__builtin_neon_udi");
+
+  (*lang_hooks.types.register_builtin_type) (intTI_type_node,
+					     "__builtin_neon_ti");
+  (*lang_hooks.types.register_builtin_type) (intEI_type_node,
+					     "__builtin_neon_ei");
+  (*lang_hooks.types.register_builtin_type) (intOI_type_node,
+					     "__builtin_neon_oi");
+  (*lang_hooks.types.register_builtin_type) (intCI_type_node,
+					     "__builtin_neon_ci");
+  (*lang_hooks.types.register_builtin_type) (intXI_type_node,
+					     "__builtin_neon_xi");
+
   dreg_types[0] = V8QI_type_node;
   dreg_types[1] = V4HI_type_node;
   dreg_types[2] = V2SI_type_node;
diff -uprN ORIG/trunk/gcc/config/arm/neon.md LOCAL/trunk/gcc/config/arm/neon.md
--- ORIG/trunk/gcc/config/arm/neon.md	2007-08-23 09:26:40.000000000 +0900
+++ LOCAL/trunk/gcc/config/arm/neon.md	2007-11-28 14:56:32.000000000 +0900
@@ -751,7 +751,7 @@
           (match_operand:SI 2 "immediate_operand" "i")))]
   "TARGET_NEON"
 {
-  HOST_WIDE_INT elem = ffs (operands[2]) - 1;
+  HOST_WIDE_INT elem = ffs ((int) INTVAL (operands[2])) - 1;
   int half_elts = GET_MODE_NUNITS (<MODE>mode) / 2;
   int elt = elem % half_elts;
   int hi = (elem / half_elts) * 2;
@@ -775,7 +775,7 @@
           (match_operand:SI 2 "immediate_operand" "i")))]
   "TARGET_NEON"
 {
-  HOST_WIDE_INT elem = ffs (operands[2]) - 1;
+  HOST_WIDE_INT elem = ffs ((int) INTVAL (operands[2])) - 1;
   int regno = REGNO (operands[0]) + 2 * elem;
 
   operands[0] = gen_rtx_REG (DImode, regno);
diff -uprN ORIG/trunk/gcc/genopinit.c LOCAL/trunk/gcc/genopinit.c
--- ORIG/trunk/gcc/genopinit.c	2007-09-08 09:56:06.000000000 +0900
+++ LOCAL/trunk/gcc/genopinit.c	2007-11-28 14:45:01.000000000 +0900
@@ -480,6 +480,7 @@ from the machine description file `md'. 
   printf ("#include \"coretypes.h\"\n");
   printf ("#include \"tm.h\"\n");
   printf ("#include \"rtl.h\"\n");
+  printf ("#include \"tm_p.h\"\n");
   printf ("#include \"flags.h\"\n");
   printf ("#include \"insn-config.h\"\n");
   printf ("#include \"recog.h\"\n");


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]