Hi,

when looking at PR 119318 I have first written a simple fix along the
lines of the fix for PR 118097 and PR 118785, i.e. without storing the
type in which we perform the operation encoded in an arithmetic jump
function but relying on expr_type_first_operand_type_p instead.  It
however became clear that in order to avoid regressions, I had to add
POINTER_PLUS_EXPR into that predicate which is missing there.  This
patch is available as an attachment to bugzilla in comment #5 and is a
simple, slightly unclean but viable way to deal with he bug.

However, the need to fiddle with the predicate led me to re-evaluate
how I approached these bugs and this is what this patch series does.
The first patch collects, stores and streams the type of the operation
encoded in the jump function.  The following ones then fix PR 119318
using it and change fixes to PRs 118097 118785 using this known type
rather than relying on expr_type_first_operand_type_p.

The last two patches in the series are only meant as an RFC and I'd
like to commit them only in the next stage 1 as they then take the
approach one step further and allow for more propagation.

Martin


Martin Jambor (7):
  ipa: Record and stream result types of arithemetic jump functions
  ipa-cp: Make propagation of bits in IPA-CP aware of type conversions
    (PR119318)
  ipa-cp: Make dumping of widest_ints even more sane
  ipa-cp: Use the stored and streamed pass-through types in ipa-vr
    (PR118785)
  ipa-cp: Use the collected pass-through types to propgate constants
    (PR118097)
  ipa: Remove  type checks in arithmetic pass-through jfunc construction
  ipa: Allow a type conversion in construction of aggregate jump
    functions

 gcc/ipa-cp.cc                       | 169 ++++++++++++++------------
 gcc/ipa-prop.cc                     | 176 ++++++++++++++++++----------
 gcc/ipa-prop.h                      |  15 +++
 gcc/testsuite/gcc.dg/ipa/pr119318.c |  38 ++++++
 4 files changed, 262 insertions(+), 136 deletions(-)
 create mode 100644 gcc/testsuite/gcc.dg/ipa/pr119318.c

-- 
2.48.1

Reply via email to