This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[committed] Remove a redundant condition check in tic6x-linux-tdep.c
- From: Yao Qi <yao at codesourcery dot com>
- To: <gdb-patches at sourceware dot org>
- Date: Fri, 30 Nov 2012 15:35:22 +0800
- Subject: [committed] Remove a redundant condition check in tic6x-linux-tdep.c
Hi,
When gdb is configured as target=tic6x-uclinux, and compiled with clang,
I get this warning:
gdb/tic6x-linux-tdep.c:66:19: error: comparison of unsigned expression >= 0 is always true [-Werror,-Wtautological-compare]
It is redundant to check 'REGNUM >= 0' as it is unsigned. The
following patch is to fix it. Committed.
gdb:
2012-11-30 Yao Qi <yao@codesourcery.com>
* tic6x-linux-tdep.c (tic6x_register_sigcontext_offset): Don't
check REGNUM >= 0.
---
gdb/tic6x-linux-tdep.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/gdb/tic6x-linux-tdep.c b/gdb/tic6x-linux-tdep.c
index 3b96201..f4450c9 100644
--- a/gdb/tic6x-linux-tdep.c
+++ b/gdb/tic6x-linux-tdep.c
@@ -63,7 +63,7 @@ tic6x_register_sigcontext_offset (unsigned int regnum, struct gdbarch *gdbarch)
else if (regnum == TIC6X_B5_REGNUM || regnum == TIC6X_B5_REGNUM + 2
|| regnum == TIC6X_B5_REGNUM + 4)
return 4 * (regnum - TIC6X_B5_REGNUM + 19); /* B5, B7, B9 */
- else if (regnum >= 0 && regnum < TIC6X_A4_REGNUM)
+ else if (regnum < TIC6X_A4_REGNUM)
return 4 * (regnum - 0 + 8); /* A0 - A3 */
else if (regnum >= TIC6X_B0_REGNUM && regnum < TIC6X_B4_REGNUM)
return 4 * (regnum - TIC6X_B0_REGNUM + 15); /* B0 - B3 */
--
1.7.7.6