This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: r114239: New warning introduced
- From: Roger Sayle <roger at eyesopen dot com>
- To: Jan-Benedict Glaw <jbglaw at lug-owl dot de>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Tue, 30 May 2006 15:42:42 -0600 (MDT)
- Subject: Re: r114239: New warning introduced
On Tue, 30 May 2006, Jan-Benedict Glaw wrote:
> I suppose it was this commit that introduced a new warning
> (--target=vax-linux-uclibc):
>
> gcc -c -g -O2 -DIN_GCC -DCROSS_COMPILE -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -Wmissing-format-attribute -fno-common -DHAVE_CONFIG_H -I. -I. -I/tmp/build-temp-vax-linux-uclibc/src/gcc/gcc -I/tmp/build-temp-vax-linux-uclibc/src/gcc/gcc/. -I/tmp/build-temp-vax-linux-uclibc/src/gcc/gcc/../include -I/tmp/build-temp-vax-linux-uclibc/src/gcc/gcc/../libcpp/include -I/tmp/build-temp-vax-linux-uclibc/src/gcc/gcc/../libdecnumber -I../libdecnumber /tmp/build-temp-vax-linux-uclibc/src/gcc/gcc/simplify-rtx.c -o simplify-rtx.o
> /tmp/build-temp-vax-linux-uclibc/src/gcc/gcc/simplify-rtx.c: In function #simplify_binary_operation_1#:
> /tmp/build-temp-vax-linux-uclibc/src/gcc/gcc/simplify-rtx.c:2467: warning: comparison between signed and unsigned
My apologies for the delay, for some reason mail to sayle@gcc.gnu.org
no longer reaches me. My apologies also for this inconvenience; the
relative sizes of "int" to "HOST_WIDE_INT" means that these warnings
are only visible on some platforms, and alas not on powerpc-apple-darwin
where my patch was bootstrapped and regression tested.
The problem has now been resolved by committing the obvious fix below,
as revision 112448.
2006-05-30 Roger Sayle <roger@eyesopen.com>
* simplify-rtx.c (simplify_binary_operation_1) <LSHIFTRT>: Cast
width to HOST_WIDE_INT to avoid comparison warnings on some targets.
Index: simplify-rtx.c
===================================================================
*** simplify-rtx.c (revision 114247)
--- simplify-rtx.c (working copy)
*************** simplify_binary_operation_1 (enum rtx_co
*** 2464,2470 ****
if (GET_CODE (op0) == CLZ
&& GET_CODE (trueop1) == CONST_INT
&& STORE_FLAG_VALUE == 1
! && INTVAL (trueop1) < width)
{
enum machine_mode imode = GET_MODE (XEXP (op0, 0));
unsigned HOST_WIDE_INT zero_val = 0;
--- 2464,2470 ----
if (GET_CODE (op0) == CLZ
&& GET_CODE (trueop1) == CONST_INT
&& STORE_FLAG_VALUE == 1
! && INTVAL (trueop1) < (HOST_WIDE_INT) width)
{
enum machine_mode imode = GET_MODE (XEXP (op0, 0));
unsigned HOST_WIDE_INT zero_val = 0;
Roger
--