On Sat, Sep 24, 2016 at 5:36 AM, kugan <kugan.vivekanandara...@linaro.org> wrote: > Hi Richard, > > There is also one more issue as reported by Pat Haugen. That is, in > converting value_range of ssa (which we get from get_range_info) to > argument type, my implementation is too simplistic and wrong at times. I can > check TYPE_UNSIGNED here but that would be pessimistic. > > tree-vrp already has logic to handle this so the attached patch exports this > and uses it. > > This also would be useful when we pass an argument of the function to anther > function call with unary operation. I will send a separate patch for that > later if this is OK. > > Bootstrapped and regression tested on x86_64-linux-gnu with no new > regressions. Is this OK for trunk?
extract_range_from_unary_expr_range has range two times, please just drop the _1 and have extract_range_from_unary_expr -- we have C++ now which should deal with overloads just fine. As followup you might want to rename the other _1 to overloads in tree-vrp.c as well. Ok with that change. Thanks, Richard. > Thanks, > Kugan > > gcc/ChangeLog: > > 2016-09-24 Kugan Vivekanandarajah <kug...@linaro.org> > > PR ipa/77677 > * ipa-prop.c (ipa_compute_jump_functions_for_edge): Use > extract_range_from_unary_expr to convert value_range. > * tree-vrp.c (extract_range_from_unary_expr_1): Rename to. > (extract_range_from_unary_expr): This. > * tree-vrp.h (extract_range_from_unary_expr): Declare. > > gcc/testsuite/ChangeLog: > > 2016-09-24 Kugan Vivekanandarajah <kug...@linaro.org> > > PR ipa/77677 > * gcc.dg/torture/pr77677-2.c: New test.