public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* -Werror,-Wtautological-overlap-compare error in h8300-tdep.c
@ 2020-05-15 21:05 Simon Marchi
  2020-05-17 13:54 ` Yoshinori Sato
  0 siblings, 1 reply; 6+ messages in thread
From: Simon Marchi @ 2020-05-15 21:05 UTC (permalink / raw)
  To: gdb-patches

When building with clang 11, we get:

  CXX    h8300-tdep.o
/home/smarchi/src/binutils-gdb/gdb/h8300-tdep.c:225:21: error: overlapping comparisons always evaluate to false [-Werror,-Wtautological-overlap-compare]
              if (disp < 0 && disp > 0xffffff)
                  ~~~~~~~~~^~~~~~~~~~~~~~~~~~
/home/smarchi/src/binutils-gdb/gdb/h8300-tdep.c:203:17: error: overlapping comparisons always evaluate to false [-Werror,-Wtautological-overlap-compare]
          if (disp < 0 && disp > 0xffffff)
              ~~~~~~~~~^~~~~~~~~~~~~~~~~~
/home/smarchi/src/binutils-gdb/gdb/h8300-tdep.c:184:17: error: overlapping comparisons always evaluate to false [-Werror,-Wtautological-overlap-compare]
          if (disp < 0 && disp > 0xffffff)
              ~~~~~~~~~^~~~~~~~~~~~~~~~~~

Indeed, disp (of type LONGEST) can't be less than 0 and greater than 0xffffff.

The closest thing I could find to an instruction set reference was this:

  https://www.renesas.com/cn/en/doc/products/mpumcu/001/e602025_h8300.pdf

... but it didn't really help me decode this code.  I'm reporting it in hope that
somebody that knows what they are doing would know how to fix it.

Yoshinori, I CCed you because you happen to be the last person who did a meaningful commit
in h8300-tdep.c, so maybe you have an idea.

Simon

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

end of thread, other threads:[~2020-05-25  9:52 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-15 21:05 -Werror,-Wtautological-overlap-compare error in h8300-tdep.c Simon Marchi
2020-05-17 13:54 ` Yoshinori Sato
2020-05-17 15:01   ` Simon Marchi
2020-05-18 12:51     ` Yoshinori Sato
2020-05-19 17:35       ` Simon Marchi
2020-05-25  9:52         ` Yoshinori Sato

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