public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [BUILDROBOT][PATCH] Fix warnings in the mep-elf target
@ 2014-08-28 22:00 Jan-Benedict Glaw
  2014-08-28 22:47 ` Andrew Pinski
  2014-08-28 22:49 ` DJ Delorie
  0 siblings, 2 replies; 5+ messages in thread
From: Jan-Benedict Glaw @ 2014-08-28 22:00 UTC (permalink / raw)
  To: gcc-patches, DJ Delorie

[-- Attachment #1: Type: text/plain, Size: 4630 bytes --]

Hi!

The following patch silences two warnings in the mep-elf target,
fixing the config-list.mk build:


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





This patch should fix it. Okay to apply?


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.


diff --git a/gcc/config/mep/mep-pragma.c b/gcc/config/mep/mep-pragma.c
index 632e92d..7bda297 100644
--- a/gcc/config/mep/mep-pragma.c
+++ b/gcc/config/mep/mep-pragma.c
@@ -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;
     }
diff --git a/gcc/config/mep/mep.c b/gcc/config/mep/mep.c
index 3c71b95..eb0adf8 100644
--- a/gcc/config/mep/mep.c
+++ b/gcc/config/mep/mep.c
@@ -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)
 {


MfG, JBG

-- 
      Jan-Benedict Glaw      jbglaw@lug-owl.de              +49-172-7608481
 Signature of:                      http://perl.plover.com/Questions.html
 the second  :

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [BUILDROBOT][PATCH] Fix warnings in the mep-elf target
  2014-08-28 22:00 [BUILDROBOT][PATCH] Fix warnings in the mep-elf target Jan-Benedict Glaw
@ 2014-08-28 22:47 ` Andrew Pinski
  2014-08-29  1:34   ` Jan-Benedict Glaw
  2014-08-29  1:38   ` Jan-Benedict Glaw
  2014-08-28 22:49 ` DJ Delorie
  1 sibling, 2 replies; 5+ messages in thread
From: Andrew Pinski @ 2014-08-28 22:47 UTC (permalink / raw)
  To: Jan-Benedict Glaw; +Cc: GCC Patches, DJ Delorie

On Thu, Aug 28, 2014 at 3:00 PM, Jan-Benedict Glaw <jbglaw@lug-owl.de> wrote:
> Hi!
>
> The following patch silences two warnings in the mep-elf target,
> fixing the config-list.mk build:


I thought -Werror was only on when the versions of GCC match.

Thanks,
Andrew

>
>
> 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
>
>
>
>
>
> This patch should fix it. Okay to apply?
>
>
> 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.
>
>
> diff --git a/gcc/config/mep/mep-pragma.c b/gcc/config/mep/mep-pragma.c
> index 632e92d..7bda297 100644
> --- a/gcc/config/mep/mep-pragma.c
> +++ b/gcc/config/mep/mep-pragma.c
> @@ -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;
>      }
> diff --git a/gcc/config/mep/mep.c b/gcc/config/mep/mep.c
> index 3c71b95..eb0adf8 100644
> --- a/gcc/config/mep/mep.c
> +++ b/gcc/config/mep/mep.c
> @@ -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)
>  {
>
>
> MfG, JBG
>
> --
>       Jan-Benedict Glaw      jbglaw@lug-owl.de              +49-172-7608481
>  Signature of:                      http://perl.plover.com/Questions.html
>  the second  :

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [BUILDROBOT][PATCH] Fix warnings in the mep-elf target
  2014-08-28 22:00 [BUILDROBOT][PATCH] Fix warnings in the mep-elf target Jan-Benedict Glaw
  2014-08-28 22:47 ` Andrew Pinski
@ 2014-08-28 22:49 ` DJ Delorie
  1 sibling, 0 replies; 5+ messages in thread
From: DJ Delorie @ 2014-08-28 22:49 UTC (permalink / raw)
  To: Jan-Benedict Glaw; +Cc: gcc-patches


> This patch should fix it. Okay to apply?

Ok.  Thanks!

> 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.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [BUILDROBOT][PATCH] Fix warnings in the mep-elf target
  2014-08-28 22:47 ` Andrew Pinski
@ 2014-08-29  1:34   ` Jan-Benedict Glaw
  2014-08-29  1:38   ` Jan-Benedict Glaw
  1 sibling, 0 replies; 5+ messages in thread
From: Jan-Benedict Glaw @ 2014-08-29  1:34 UTC (permalink / raw)
  To: Andrew Pinski; +Cc: GCC Patches, DJ Delorie

[-- Attachment #1: Type: text/plain, Size: 730 bytes --]

On Thu, 2014-08-28 15:47:07 -0700, Andrew Pinski <pinskia@gmail.com> wrote:
> On Thu, Aug 28, 2014 at 3:00 PM, Jan-Benedict Glaw <jbglaw@lug-owl.de> wrote:
> > Hi!
> >
> > The following patch silences two warnings in the mep-elf target,
> > fixing the config-list.mk build:
> 
> 
> I thought -Werror was only on when the versions of GCC match.

Exactly that's the case. The config-list.mk backend ensures that a g++
of the very same revision is used. It's first in $PATH.

MfG, JBG

-- 
      Jan-Benedict Glaw      jbglaw@lug-owl.de              +49-172-7608481
Signature of:                   ...und wenn Du denkst, es geht nicht mehr,
the second  :                          kommt irgendwo ein Lichtlein her.

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [BUILDROBOT][PATCH] Fix warnings in the mep-elf target
  2014-08-28 22:47 ` Andrew Pinski
  2014-08-29  1:34   ` Jan-Benedict Glaw
@ 2014-08-29  1:38   ` Jan-Benedict Glaw
  1 sibling, 0 replies; 5+ messages in thread
From: Jan-Benedict Glaw @ 2014-08-29  1:38 UTC (permalink / raw)
  To: Andrew Pinski; +Cc: GCC Patches, DJ Delorie

[-- Attachment #1: Type: text/plain, Size: 864 bytes --]

On Thu, 2014-08-28 15:47:07 -0700, Andrew Pinski <pinskia@gmail.com> wrote:
> On Thu, Aug 28, 2014 at 3:00 PM, Jan-Benedict Glaw <jbglaw@lug-owl.de> wrote:
> > The following patch silences two warnings in the mep-elf target,
> > fixing the config-list.mk build:
> 
> 
> I thought -Werror was only on when the versions of GCC match.

See https://plus.google.com/112436047517408844110/posts/UE2dPJra4Qj ,
https://plus.google.com/112436047517408844110/posts/duprj3yMRT9 and
https://plus.google.com/112436047517408844110/posts/j53pZGTHerx .

MfG, JBG

-- 
      Jan-Benedict Glaw      jbglaw@lug-owl.de              +49-172-7608481
Signature of:               The real problem with C++ for kernel modules is:
the second  :                                 the language just sucks.
                                                   -- Linus Torvalds

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2014-08-29  1:38 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-08-28 22:00 [BUILDROBOT][PATCH] Fix warnings in the mep-elf target Jan-Benedict Glaw
2014-08-28 22:47 ` Andrew Pinski
2014-08-29  1:34   ` Jan-Benedict Glaw
2014-08-29  1:38   ` Jan-Benedict Glaw
2014-08-28 22:49 ` DJ Delorie

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).