[Bug target/79752] incorrect code generation for __divkf3 with -O2 -mcpu=power9

meissner at linux dot vnet.ibm.com gcc-bugzilla@gcc.gnu.org
Tue Feb 28 23:29:00 GMT 2017


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79752

--- Comment #2 from Michael Meissner <meissner at linux dot vnet.ibm.com> ---
On Tue, Feb 28, 2017 at 09:13:42PM +0000, acsawdey at gcc dot gnu.org wrote:
> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79752
> 
> --- Comment #1 from acsawdey at gcc dot gnu.org ---
> Meissner spotted the cause. Verified that this fixes it:
> 
> Index: ../trunk/gcc/config/rs6000/rs6000.md
> ===================================================================
> --- ../trunk/gcc/config/rs6000/rs6000.md        (revision 245787)
> +++ ../trunk/gcc/config/rs6000/rs6000.md        (working copy)
> @@ -3161,7 +3161,7 @@
>     && ! reg_mentioned_p (operands[3], operands[1])
>     && ! reg_mentioned_p (operands[3], operands[2])"
>    [(set (match_dup 0)
> -       (div:GPR (match_dup 1)
> +       (udiv:GPR (match_dup 1)
>                  (match_dup 2)))
>     (set (match_dup 3)
>         (mult:GPR (match_dup 0)
> 
> Now to bootstrap/regtest this and post.

One minor formatting nit.  When you change div -> udiv, you will need to
indent the (match_dup 20 on the next line by one space.


More information about the Gcc-bugs mailing list