This fixes bogus replacing of an unsigned (-x)/y division by
-(x/y).
2020-09-18 Richard Biener <rguenther@suse.de>
PR tree-optimization/97089
* tree-ssa-sccvn.c (visit_nary_op): Do not replace unsigned
divisions.
}
}
break;
- case RDIV_EXPR:
case TRUNC_DIV_EXPR:
+ if (TYPE_UNSIGNED (type))
+ break;
+ /* Fallthru. */
+ case RDIV_EXPR:
case MULT_EXPR:
/* Match up ([-]a){/,*}([-])b with v=a{/,*}b, replacing it with -v. */
if (! HONOR_SIGN_DEPENDENT_ROUNDING (type))