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  <ja...@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

Reply via email to