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]

[PATCH] Fix a -Wsign-compare warning in i386.c


Hi!

GCC 4.7.2 warns about -Wsign-compare when unsigned iterator is compared
with cregs_size.  GCC 4.8 doesn't warn about it (otherwise bootstrap would
fail), because it calls maybe_constant_value before emitting the warning,
but still I'd say it is better to use the same signedness.

Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk?

2013-04-26  Jakub Jelinek  <jakub@redhat.com>

	* config/i386/i386.c (ix86_expand_call): Make cregs_size unsigned.

--- gcc/config/i386/i386.c.jj	2013-04-26 19:11:33.000000000 +0200
+++ gcc/config/i386/i386.c	2013-04-26 19:12:21.329725950 +0200
@@ -23714,7 +23714,8 @@ ix86_expand_call (rtx retval, rtx fnaddr
 		  rtx callarg2,
 		  rtx pop, bool sibcall)
 {
-  int const cregs_size = ARRAY_SIZE (x86_64_ms_sysv_extra_clobbered_registers);
+  unsigned int const cregs_size
+    = ARRAY_SIZE (x86_64_ms_sysv_extra_clobbered_registers);
   rtx vec[3 + cregs_size];
   rtx use = NULL, call;
   unsigned int vec_len = 0;

	Jakub


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