This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] Fix REG_EQUAL note in x86 -m8bit-idiv code
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Uros Bizjak <ubizjak at gmail dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Fri, 29 Sep 2017 22:59:32 +0200
- Subject: [PATCH] Fix REG_EQUAL note in x86 -m8bit-idiv code
- Authentication-results: sourceware.org; auth=none
- Authentication-results: ext-mx04.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com
- Authentication-results: ext-mx04.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=jakub at redhat dot com
- Dmarc-filter: OpenDMARC Filter v1.3.2 mx1.redhat.com EDA1780B22
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
Hi!
While working on the following patch, I've discovered that the REG_EQUAL
notes for DImode signed/unsigned division/modulo are wrong, there is
e.g. (div:SI (reg:DI ...) (reg:DI ...)).
Fixed thusly, bootstrapped/regtested on x86_64-linux and i686-linux, ok for
trunk?
2017-09-29 Jakub Jelinek <jakub@redhat.com>
* config/i386/i386.c (ix86_split_idivmod): Use mode instead of
always SImode for DIV and MOD in REG_EQUAL notes.
--- gcc/config/i386/i386.c.jj 2017-09-28 20:35:14.000000000 +0200
+++ gcc/config/i386/i386.c 2017-09-29 19:15:27.822267844 +0200
@@ -21980,13 +21980,13 @@ ix86_split_idivmod (machine_mode mode, r
if (signed_p)
{
- div = gen_rtx_DIV (SImode, operands[2], operands[3]);
- mod = gen_rtx_MOD (SImode, operands[2], operands[3]);
+ div = gen_rtx_DIV (mode, operands[2], operands[3]);
+ mod = gen_rtx_MOD (mode, operands[2], operands[3]);
}
else
{
- div = gen_rtx_UDIV (SImode, operands[2], operands[3]);
- mod = gen_rtx_UMOD (SImode, operands[2], operands[3]);
+ div = gen_rtx_UDIV (mode, operands[2], operands[3]);
+ mod = gen_rtx_UMOD (mode, operands[2], operands[3]);
}
/* Extract remainder from AH. */
Jakub