https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113362
Jeffrey A. Law <law at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |law at gcc dot gnu.org --- Comment #3 from Jeffrey A. Law <law at gcc dot gnu.org> --- This is a failure to use the divmod pattern because the public riscv uarchs haven't set that flag. I added support for that style of code generation perhaps a year or so ago, but I don't know the public uarchs well enough to know if they should be using divmod or not. I suspect most if not all should, the only viable case for not using divmod would be if they have fusion for this kind of idiom. But all the proper support is in place. And with Ventana's internal tree with our uarch enabled: divu a5,a1,a2 mul a2,a5,a2 sd a5,0(a0) sub a1,a1,a2 sd a1,8(a0) So what really needs to happen here is folks that know the various upstreamed uarchs need to chime in and set the bit appropriately for their uarchs.