[Bug tree-optimization/106687] [13 Regression] Wrong code with -O2 since r13-438-gcf2141a0c640fc9b
cvs-commit at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Tue Aug 23 01:05:35 GMT 2022
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106687
--- Comment #3 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Andrew Macleod <amacleod@gcc.gnu.org>:
https://gcc.gnu.org/g:de6d9e0b3d5c08896cbf047b299fc7f8d1e42be7
commit r13-2147-gde6d9e0b3d5c08896cbf047b299fc7f8d1e42be7
Author: Andrew MacLeod <amacleod@redhat.com>
Date: Mon Aug 22 15:40:48 2022 -0400
Return the correct relation
With an input condition of op1 > op2, and evaluating the unsigned
expression:
LHS = op1 - op2
range-ops was returning LHS < op1 , which is incorrect as op2 coould be
zero. This patch adjusts it to return LHS <= op1.
PR tree-optimization/106687
gcc/
* range-op.cc (operator_minus::lhs_op1_relation): Return VREL_LE
for the VREL_GT case as well.
gcc/testsuite/
* g++.dg/pr106687.C: New.
More information about the Gcc-bugs
mailing list