On Fri, 15 Jun 2018, Jakub Jelinek wrote: > Hi! > > The match.pd framework uses op0 == op1 || operand_equal_p (op0, op1, 0) > style comparisons heavily; the reason why we don't optimize away say > volatile int i; > ... > int j = i - i; > into int j = (i, 0); > is only because both the C and C++ FE convert the volatile arguments to > non-volatile ones before the arithmetic operation (e.g. c_common_type > returns a non-qualified type). Unfortunately, in C FE this doesn't happen > for POINTER_DIFF_EXPR, where no conversion happens. The following patch > makes sure we convert the pointer arguments to some non-qualified pointers > first. > > Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk/8.2?
OK. -- Joseph S. Myers jos...@codesourcery.com