This patch silences two warnings in the mep-elf target, fixing the config-list.mk...
authorJan-Benedict Glaw <jbglaw@lug-owl.de>
Fri, 29 Aug 2014 01:44:42 +0000 (01:44 +0000)
committerJan-Benedict Glaw <jbglaw@gcc.gnu.org>
Fri, 29 Aug 2014 01:44:42 +0000 (01:44 +0000)
First one:
~~~~~~~~~~
g++ -c  -DIN_GCC_FRONTEND -DIN_GCC_FRONTEND -g -O2 -DIN_GCC  -DCROSS_DIRECTORY_STRUCTURE  -fno-exceptions -fno-rtti -fasynchronous-unwind-tables -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wmissing-format-attribute -Woverloaded-virtual -pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings -Werror -fno-common  -DHAVE_CONFIG_H -I. -I. -I../../../gcc/gcc -I../../../gcc/gcc/. -I../../../gcc/gcc/../include -I../../../gcc/gcc/../libcpp/include -I/opt/cfarm/mpc/include  -I../../../gcc/gcc/../libdecnumber -I../../../gcc/gcc/../libdecnumber/dpd -I../libdecnumber -I../../../gcc/gcc/../libbacktrace -DCLOOG_INT_GMP  -DCLOOG_INT_GMP   -I. -I. -I../../../gcc/gcc -I../../../gcc/gcc/. -I../../../gcc/gcc/../include -I../../../gcc/gcc/../libcpp/include -I/opt/cfarm/mpc/include  -I../../../gcc/gcc/../libdecnumber -I../../../gcc/gcc/../libdecnumber/dpd -I../libdecnumber -I../../../gcc/gcc/../libbacktrace -DCLOOG_INT_GMP  -DCLOOG_INT_GMP  ../../../gcc/gcc/config/mep/mep-pragma.c
../../../gcc/gcc/config/mep/mep-pragma.c: In function ‘void mep_pragma_coprocessor(cpp_reader*)’:
../../../gcc/gcc/config/mep/mep-pragma.c:271:18: error: ‘rclass’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
   enum reg_class rclass;
                  ^
cc1plus: all warnings being treated as errors
make[2]: *** [mep-pragma.o] Error 1

This is actually a misbehavior of current GCC, the code itself looks 100% okay
to me.  Shall I report that as a bug, too?

Second one:
~~~~~~~~~~~
g++ -c   -g -O2 -DIN_GCC  -DCROSS_DIRECTORY_STRUCTURE  -fno-exceptions -fno-rtti -fasynchronous-unwind-tables -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wmissing-format-attribute -Woverloaded-virtual -pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings -Werror -fno-common  -DHAVE_CONFIG_H -I. -I. -I../../../gcc/gcc -I../../../gcc/gcc/. -I../../../gcc/gcc/../include -I../../../gcc/gcc/../libcpp/include -I/opt/cfarm/mpc/include  -I../../../gcc/gcc/../libdecnumber -I../../../gcc/gcc/../libdecnumber/dpd -I../libdecnumber -I../../../gcc/gcc/../libbacktrace    -o mep.o -MT mep.o -MMD -MP -MF ./.deps/mep.TPo ../../../gcc/gcc/config/mep/mep.c
../../../gcc/gcc/config/mep/mep.c:3448:0: error: "VECTOR_TYPE_P" redefined [-Werror]
 #define VECTOR_TYPE_P(t) (TREE_CODE(t) == VECTOR_TYPE)
 ^
In file included from ../../../gcc/gcc/config/mep/mep.c:26:0:
../../../gcc/gcc/tree.h:474:0: note: this is the location of the previous definition
 #define VECTOR_TYPE_P(TYPE) (TREE_CODE (TYPE) == VECTOR_TYPE)
 ^
cc1plus: all warnings being treated as errors
make[2]: *** [mep.o] Error 1

2014-08-28  Jan-Benedict Glaw  <jbglaw@lug-owl.de>

* config/mep/mep-pragma.c (mep_pragma_coprocessor_subclass): Rework
to silence warning.
* config/mep/mep.c (VECTOR_TYPE_P): Remove duplicate definition.

From-SVN: r214710

gcc/ChangeLog
gcc/config/mep/mep-pragma.c
gcc/config/mep/mep.c

index 2095abfc1bfc2a3baf37d210889b47fcbac38719..3f821e92151cf8f237456cc6a5417f333f6db8cd 100644 (file)
@@ -1,3 +1,9 @@
+2014-08-29  Jan-Benedict Glaw  <jbglaw@lug-owl.de>
+
+       * config/mep/mep-pragma.c (mep_pragma_coprocessor_subclass): Rework
+       to silence warning.
+       * config/mep/mep.c (VECTOR_TYPE_P): Remove duplicate definition.
+
 2014-08-28  David Malcolm  <dmalcolm@redhat.com>
 
        * rtl.h (previous_insn): Strengthen param from rtx to rtx_insn *.
index 632e92da1943c48940e36dff54700c1cc814bb44..7bda2973b11c9eee8bb54f56cc8a9ff51bb74dea 100644 (file)
@@ -274,24 +274,21 @@ mep_pragma_coprocessor_subclass (void)
   if (type != CPP_CHAR)
     goto syntax_error;
   class_letter = tree_to_uhwi (val);
-  if (class_letter >= 'A' && class_letter <= 'D')
-    switch (class_letter)
-      {
-      case 'A':
-       rclass = USER0_REGS;
-       break;
-      case 'B':
-       rclass = USER1_REGS;
-       break;
-      case 'C':
-       rclass = USER2_REGS;
-       break;
-      case 'D':
-       rclass = USER3_REGS;
-       break;
-      }
-  else
+  switch (class_letter)
     {
+    case 'A':
+      rclass = USER0_REGS;
+      break;
+    case 'B':
+      rclass = USER1_REGS;
+      break;
+    case 'C':
+      rclass = USER2_REGS;
+      break;
+    case 'D':
+      rclass = USER3_REGS;
+      break;
+    default:
       error ("#pragma GCC coprocessor subclass letter must be in [ABCD]");
       return;
     }
index df6bba5029679be80ab2b527a42291ce99f4c16d..fcd5e0ae9d2cbe6918c30abf1ea14de0f91b83fb 100644 (file)
@@ -3445,8 +3445,6 @@ mep_expand_builtin_saveregs (void)
   return XEXP (regbuf, 0);
 }
 
-#define VECTOR_TYPE_P(t) (TREE_CODE(t) == VECTOR_TYPE)
-
 static tree
 mep_build_builtin_va_list (void)
 {