From: Jan-Benedict Glaw <jbglaw@lug-owl.de>
To: Jeff Law <jeffreyalaw@gmail.com>
Cc: "gcc-patches@gcc.gnu.org" <gcc-patches@gcc.gnu.org>
Subject: Re: [committed] More infrastructure to avoid bogus RTL on H8
Date: Tue, 25 Oct 2022 21:59:06 +0200 [thread overview]
Message-ID: <20221025195906.rk5wx6ttpwohwn4p@lug-owl.de> (raw)
In-Reply-To: <3aa2cc41-0ad2-e106-56d4-f839ae2c1078@gmail.com>
[-- Attachment #1: Type: text/plain, Size: 1414 bytes --]
Hi Jeff!
On Mon, 2022-10-17 17:47:16 -0600, Jeff Law via Gcc-patches <gcc-patches@gcc.gnu.org> wrote:
> --- a/gcc/config/h8300/h8300.cc
> +++ b/gcc/config/h8300/h8300.cc
> @@ -5531,6 +5531,32 @@ h8300_ok_for_sibcall_p (tree fndecl, tree)
>
> return 1;
> }
> +
> +/* Return TRUE if OP is a PRE_INC or PRE_DEC
> + instruction using REG, FALSE otherwise. */
> +
> +bool
> +pre_incdec_with_reg (rtx op, int reg)
> +{
> + /* OP must be a MEM. */
> + if (GET_CODE (op) != MEM)
> + return false;
> +
> + /* The address must be a PRE_INC or PRE_DEC. */
> + op = XEXP (op, 0);
> + if (GET_CODE (op) != PRE_DEC && GET_CODE (op) != PRE_INC)
> + return false;
> +
> + /* It must be a register that is being incremented
> + or decremented. */
> + op = XEXP (op, 0);
> + if (!REG_P (op))
> + return false;
> +
> + /* Finally, check that the register number matches. */
> + return REGNO (op) == reg;
This results in a new signed-vs-unsigned warning for me:
[all 2022-10-25 00:41:11] ../../gcc/gcc/config/h8300/h8300.cc: In function 'bool pre_incdec_with_reg(rtx, int)':
[all 2022-10-25 00:41:11] ../../gcc/gcc/config/h8300/h8300.cc:5557:21: error: comparison of integer expressions of different signedness: 'unsigned int' and 'int' [-Werror=sign-compare]
[all 2022-10-25 00:41:11] 5557 | return REGNO (op) == reg;
Thanks,
Jan-Benedict
--
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]
next prev parent reply other threads:[~2022-10-25 19:59 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-17 23:47 Jeff Law
2022-10-25 19:59 ` Jan-Benedict Glaw [this message]
2022-10-29 3:35 ` Jeff Law
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20221025195906.rk5wx6ttpwohwn4p@lug-owl.de \
--to=jbglaw@lug-owl.de \
--cc=gcc-patches@gcc.gnu.org \
--cc=jeffreyalaw@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).