On 09/15/2015 04:06 AM, Richard Biener wrote:
On Tue, Sep 8, 2015 at 1:17 PM, Kai Tietz <ktiet...@googlemail.com> wrote:
Hi,
This patch is the first part of obsoleting 'shorten_compare' function
for folding.
It adjusts the uses of 'shorten_compare' to ignore folding returned by
it, and adds
missing pattterns to match.pd to allow full bootstrap of C/C++ without
regressions.
Due we are using 'shorten_compare' for some diagnostic we can't simply
remove it. So if this patch gets approved, the next step will be to
rename the function to something like 'check_compare', and adjust its
arguments and inner logic to reflect that we don't modify
arguments/expression anymore within that function.
Bootstrap just show 2 regressions within gcc.dg testsuite due patterns
matched are folded more early by forward-propagation. I adjusted
them, and added them to patch, too.
Some comments on the patterns you added below
I did regression-testing for x86_64-unknown-linux-gnu.
ChangeLog
2015-09-08 Kai Tietz <kti...@redhat.com>
* match.pd: Add missing patterns from shorten_compare.
* c/c-typeck.c (build_binary_op): Discard foldings of shorten_compare.
* cp/typeck.c (cp_build_binary_op): Likewise.
2015-09-08 Kai Tietz <kti...@redhat.com>
* gcc.dg/tree-ssa/vrp23.c: Adjust testcase to reflect that
pattern is matching now already within forward-propagation pass.
* gcc.dg/tree-ssa/vrp24.c: Likewise.
[ snip ]
I think these are always true, to/from REAL_TYPE is FIX_TRUNC /
FLOAT_EXPR. What you
might get is conversion to/from decimal FP from/to non-decimal FP.
+ && single_use (@1)
+ && single_use (@3)
We have :s now, I'd like to see comments before any explicit
single_use () uses as to why
they were added. Also why @1 and @3? Either @0 and @3 or @1 and @2?
Yea, I was looking at that as well when I was trying to understand why
so much changed with/without this patch.
It's probably good policy that anything that uses :s/single_use ought to
give some kind of justification, preferably with a testcase which shows
why the :s/single_use is needed.