Hi Prathamesh, Could you split out the ARM specific portions into a separate patch please in a patch series?
>@deftypefn {Target Hook} void TARGET_EXPAND_DIVMOD_LIBFUNC (bool >@var{unsignedp}, machine_mode @var{mode}, @var{rtx}, @var{rtx}, rtx >*@var{quot}, rtx *@var{rem}) >Expand divmod libfunc >@end deftypefn > This could do with some more detail here with respect to the conditions when a port needs to define this particular macro. Based on the discussion it would be good to have an assert for TARGET_IDIV in the hook for the ARM port. i.e gcc_assert (!TARGET_IDIV); > ># Return 1 if the target supports divmod > >proc check_effective_target_divmod { } { > if { [istarget arm*-*-*] } { > return 1 > } > return 0 >} > This will fail test cases in a configuration where a div instruction exists. If you are looking to check the transformation - I think you need to check for __ARM_ARCH_EXT_IDIV__ here similar to the way in which we test for FMA or __ARM_FEATURE_UNALIGNED. Could you please repost with the changes so that I can take another look ? Otherwise I think this is something we should queue up for GCC 7. thanks, Ramana