This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] Fix a -Wsign-compare warning in i386.c
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Uros Bizjak <ubizjak at gmail dot com>, Richard Henderson <rth at redhat dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Sat, 27 Apr 2013 00:23:18 +0200
- Subject: [PATCH] Fix a -Wsign-compare warning in i386.c
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
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