From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by sourceware.org (Postfix) with ESMTP id D0B433858D37 for ; Mon, 17 Aug 2020 09:19:31 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org D0B433858D37 Received: from mail-wr1-f72.google.com (mail-wr1-f72.google.com [209.85.221.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-355-dxmBYShGPlSpzIsYQ3BYfQ-1; Mon, 17 Aug 2020 05:19:29 -0400 X-MC-Unique: dxmBYShGPlSpzIsYQ3BYfQ-1 Received: by mail-wr1-f72.google.com with SMTP id o10so6765403wrs.21 for ; Mon, 17 Aug 2020 02:19:28 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language; bh=LAyc1hXA1C5l5WVLepLZ64a9Jxf5j6DuOGbi8XD5Wqo=; b=XFj8uKBBTqf2IJE+I+LVXrA7MOXLT+EFRqzZ0veVXaKSERruUcUu5jR5YQkIr/IYk2 xp2h83WxTafXBSyUNS1guuxcC2NG301cOjSlKdVSXmVrnxYLECWQZXTP+odbu4CN/LBA 7dCQfIeX/06UrH1y9Up2pPn4ezFOW/DT/Sm19ZRzKmiq9+U1/TYhxNxXyLIcKm5QTW3i Qbcd8JzC9NNW2HDWeuVoQwRdpVCnBR96lzFJIWqly7Bkhb3GwPRUTkhXuGhSf4kAb46X adf9CnmUlher36ACQ4PaF3Wtk7MN0gmER9AL6omCIQ7k2o5ntUBlyaD9j6UFZQssfvPi azKg== X-Gm-Message-State: AOAM531D5Yya4hJgM+smgsslyvCV6DVRVBr7hTZ1fDLtaf3l3bsNeU4Q f18nS0TMvkQ2Y/JeNEgfz1x9FhCr5Lr19bFM7D0kum3YqXYJr+fDhmxB5edCnyFB2NdLEjIv1Wo 0sb3bSuVkYprJGiVQZw== X-Received: by 2002:adf:ab05:: with SMTP id q5mr13763700wrc.46.1597655968016; Mon, 17 Aug 2020 02:19:28 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwq+ffCSsftVixN9ryCxHUCtWO7fLcHmiMjx15nq/IA8xj9Z4uB8j4EBfZYc92+RW6ZLYBq4w== X-Received: by 2002:adf:ab05:: with SMTP id q5mr13763689wrc.46.1597655967764; Mon, 17 Aug 2020 02:19:27 -0700 (PDT) Received: from abulafia.quesejoda.com (93.98.17.109.rev.sfr.net. [109.17.98.93]) by smtp.gmail.com with ESMTPSA id v29sm31141437wrv.51.2020.08.17.02.19.26 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 17 Aug 2020 02:19:27 -0700 (PDT) Subject: Re: PING: Fwd: [PATCH 1/2] Add statement context to get_value_range. To: Andrew MacLeod , gcc-patches , Jeff Law References: <20200804115501.583870-1-aldyh@redhat.com> <20200804115501.583870-2-aldyh@redhat.com> <69323d9d-a491-1fd4-d8f9-adb95380e681@redhat.com> From: Aldy Hernandez Message-ID: <3754cb10-050d-2837-a9db-3430d5640da5@redhat.com> Date: Mon, 17 Aug 2020 11:19:25 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <69323d9d-a491-1fd4-d8f9-adb95380e681@redhat.com> Content-Language: en-US X-Mimecast-Spam-Score: 0.001 X-Mimecast-Originator: redhat.com Content-Type: multipart/mixed; boundary="------------CF6F62EB2D732FBFBA033B50" X-Spam-Status: No, score=-9.7 required=5.0 tests=BAYES_00, BODY_8BITS, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, NICE_REPLY_A, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Aug 2020 09:19:34 -0000 This is a multi-part message in MIME format. --------------CF6F62EB2D732FBFBA033B50 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit On 8/14/20 6:03 PM, Andrew MacLeod wrote: > On 8/11/20 7:53 AM, Aldy Hernandez via Gcc-patches wrote: >> ---------- Forwarded message --------- >> From: Aldy Hernandez >> Date: Tue, Aug 4, 2020, 13:55 >> Subject: [PATCH 1/2] Add statement context to get_value_range. >> To: >> Cc: , Aldy Hernandez >> >> >> This is in line with the statement context that we have for get_value() >> in the substitute_and_fold_engine class. >> --- >>   gcc/vr-values.c | 64 ++++++++++++++++++++++++++----------------------- >>   gcc/vr-values.h | 14 +++++------ >>   2 files changed, 41 insertions(+), 37 deletions(-) >> >> diff --git a/gcc/vr-values.c b/gcc/vr-values.c >> index 511342f2f13..9002d87c14b 100644 >> --- a/gcc/vr-values.c >> +++ b/gcc/vr-values.c >> @@ -147,7 +147,8 @@ vr_values::get_lattice_entry (const_tree var) >>      return NULL.  Otherwise create an empty range if none existed for >> VAR. >> */ >> >>   const value_range_equiv * >> -vr_values::get_value_range (const_tree var) >> +vr_values::get_value_range (const_tree var, >> +                           gimple *stmt ATTRIBUTE_UNUSED) >>   { >>     /* If we have no recorded ranges, then return NULL.  */ >>     if (!vr_value) >> @@ -450,7 +451,7 @@ simplify_using_ranges::op_with_boolean_value_range_p >> (tree op) >> >>     /* ?? Errr, this should probably check for [0,0] and [1,1] as well >>        as [0,1].  */ >> -  const value_range *vr = get_value_range (op); >> +  const value_range *vr = get_value_range (op, NULL); >>     return *vr == value_range (build_zero_cst (TREE_TYPE (op)), >>                               build_one_cst (TREE_TYPE (op))); >>   } > > I think if we are adding "gimple *stmt" as a parameter, we should make > if default to NULL...  Then we won't have to change all the callers that > don't have a need for it. > I get that it helped us find all the places where stmts were > available/needed originally, but I think that need is no longer relevant > and we can revert to making it a default parameter now. Done. > > further more, I don't think it should be a ATTRIBUTE_UNUSED, and then > pass a NULL further down :)  we should be able to pass stmt. > >> @@ -972,12 +973,13 @@ vr_values::extract_range_from_cond_expr >> (value_range_equiv *vr, gassign *stmt) >> >>   void >>   vr_values::extract_range_from_comparison (value_range_equiv *vr, >> +                                         gimple *stmt, >>                                            enum tree_code code, >>                                            tree type, tree op0, tree op1) > > Now that we are passing stmt in, and there is only one use of this > function, I think you can kill the final 4 parameters and just get them > in the function itself... Done. > >>   { >>     bool sop; >>     tree val >> -    = simplifier.vrp_evaluate_conditional_warnv_with_ops (code, op0, >> op1, >> +    = simplifier.vrp_evaluate_conditional_warnv_with_ops (stmt, code, >> op0, >> op1, >>                                                            false, &sop, >> NULL); >>     if (val) >>       { >> @@ -1008,14 +1010,14 @@ check_for_binary_op_overflow (vr_values *store, >>   { >>     value_range vr0, vr1; >>     if (TREE_CODE (op0) == SSA_NAME) >> -    vr0 = *store->get_value_range (op0); >> +    vr0 = *store->get_value_range (op0, NULL); >>     else if (TREE_CODE (op0) == INTEGER_CST) >>       vr0.set (op0); >>     else >>       vr0.set_varying (TREE_TYPE (op0)); >> >>     if (TREE_CODE (op1) == SSA_NAME) >> -    vr1 = *store->get_value_range (op1); >> +    vr1 = *store->get_value_range (op1, NULL); >>     else if (TREE_CODE (op1) == INTEGER_CST) >>       vr1.set (op1); >>     else >> @@ -1472,7 +1474,7 @@ vr_values::extract_range_from_assignment >> (value_range_equiv *vr, gassign *stmt) >>     else if (code == COND_EXPR) >>       extract_range_from_cond_expr (vr, stmt); >>     else if (TREE_CODE_CLASS (code) == tcc_comparison) >> -    extract_range_from_comparison (vr, gimple_assign_rhs_code (stmt), >> +    extract_range_from_comparison (vr, stmt, gimple_assign_rhs_code >> (stmt), >>                                     gimple_expr_type (stmt), >>                                     gimple_assign_rhs1 (stmt), >>                                     gimple_assign_rhs2 (stmt)); >> @@ -1805,7 +1807,7 @@ vr_values::adjust_range_with_scev >> (value_range_equiv >> *vr, class loop *loop, >>     if (TREE_CODE (step) == INTEGER_CST >>         && is_gimple_val (init) >>         && (TREE_CODE (init) != SSA_NAME >> -         || get_value_range (init)->kind () == VR_RANGE)) >> +         || get_value_range (init, stmt)->kind () == VR_RANGE)) >>       { >>         widest_int nit; >> >> @@ -1838,7 +1840,7 @@ vr_values::adjust_range_with_scev >> (value_range_equiv >> *vr, class loop *loop, >>                    value_range initvr; >> >>                    if (TREE_CODE (init) == SSA_NAME) >> -                   initvr = *(get_value_range (init)); >> +                   initvr = *(get_value_range (init, stmt)); >>                    else if (is_gimple_min_invariant (init)) >>                      initvr.set (init); >>                    else >> @@ -2090,7 +2092,7 @@ const value_range_equiv * >>   simplify_using_ranges::get_vr_for_comparison (int i, value_range_equiv >> *tem) >>   { >>     /* Shallow-copy equiv bitmap.  */ >> -  const value_range_equiv *vr = get_value_range (ssa_name (i)); >> +  const value_range_equiv *vr = get_value_range (ssa_name (i), NULL); >> >>     /* If name N_i does not have a valid range, use N_i as its own >>        range.  This allows us to compare against names that may >> @@ -2115,7 +2117,7 @@ simplify_using_ranges::compare_name_with_value >>                                   bool *strict_overflow_p, bool >> use_equiv_p) >>   { >>     /* Get the set of equivalences for VAR.  */ >> -  bitmap e = get_value_range (var)->equiv (); >> +  bitmap e = get_value_range (var, NULL)->equiv (); >> >>     /* Start at -1.  Set it to 0 if we do a comparison without relying >>        on overflow, or 1 if all comparisons rely on overflow.  */ >> @@ -2195,8 +2197,8 @@ simplify_using_ranges::compare_names (enum >> tree_code >> comp, tree n1, tree n2, >>   { >>     /* Compare the ranges of every name equivalent to N1 against the >>        ranges of every name equivalent to N2.  */ >> -  bitmap e1 = get_value_range (n1)->equiv (); >> -  bitmap e2 = get_value_range (n2)->equiv (); >> +  bitmap e1 = get_value_range (n1, NULL)->equiv (); >> +  bitmap e2 = get_value_range (n2, NULL)->equiv (); >> >>     /* Use the fake bitmaps if e1 or e2 are not available.  */ >>     static bitmap s_e1 = NULL, s_e2 = NULL; >> @@ -2308,8 +2310,8 @@ >> simplify_using_ranges::vrp_evaluate_conditional_warnv_with_ops_using_ranges >> >>       (enum tree_code code, tree op0, tree op1, bool * strict_overflow_p) >>   { >>     const value_range_equiv *vr0, *vr1; >> -  vr0 = (TREE_CODE (op0) == SSA_NAME) ? get_value_range (op0) : NULL; >> -  vr1 = (TREE_CODE (op1) == SSA_NAME) ? get_value_range (op1) : NULL; >> +  vr0 = (TREE_CODE (op0) == SSA_NAME) ? get_value_range (op0, NULL) : >> NULL; >> +  vr1 = (TREE_CODE (op1) == SSA_NAME) ? get_value_range (op1, NULL) : >> NULL; >> >>     tree res = NULL_TREE; >>     if (vr0 && vr1) >> @@ -2326,7 +2328,8 @@ >> simplify_using_ranges::vrp_evaluate_conditional_warnv_with_ops_using_ranges >> >> >>   tree >>   simplify_using_ranges::vrp_evaluate_conditional_warnv_with_ops >> -                                               (enum tree_code code, >> +                                               (gimple *stmt, >> +                                                enum tree_code code, >>                                                   tree op0, tree op1, >>                                                   bool use_equiv_p, >>                                                   bool >> *strict_overflow_p, > > I was really hoping that by passing stmt in here, we could avoid passing > code, op1 and op2 as well... but unfortunately, with further digging it > seems that there are issues with VRP .   in particular there are places > which tweak  op1 and op2 before being passed for consideration... > specifically  vrp_evaluate_conditional  calls here and has incoming > tweaks.  they should be fine as far as ranger interaction goes, but > prevents us from condensing those parameters... :-( > > So that is OK for now. Perhaps when we get into replacing VRP, we can > clean this up more. Tested on ppc64le-linux and pushed the attached patch. Aldy --------------CF6F62EB2D732FBFBA033B50 Content-Type: text/x-patch; charset=UTF-8; name="0001-Add-statement-context-to-get_value_range.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="0001-Add-statement-context-to-get_value_range.patch" >From d8b8023cdb0b275c3f4254380b7e41d14f5cb79f Mon Sep 17 00:00:00 2001 Date: Tue, 4 Aug 2020 12:18:21 +0200 Subject: [PATCH] Add statement context to get_value_range. This is in line with the statement context that we have for get_value() in the substitute_and_fold_engine class. gcc/ChangeLog: * vr-values.c (vr_values::get_value_range): Add stmt param. (vr_values::extract_range_from_comparison): Same. (vr_values::extract_range_from_assignment): Pass stmt to extract_range_from_comparison. (vr_values::adjust_range_with_scev): Pass stmt to get_value_range. (simplify_using_ranges::vrp_evaluate_conditional): Add stmt param. Pass stmt to get_value_range. (simplify_using_ranges::vrp_visit_cond_stmt): Pass stmt to get_value_range. (simplify_using_ranges::simplify_abs_using_ranges): Same. (simplify_using_ranges::simplify_div_or_mod_using_ranges): Same. (simplify_using_ranges::simplify_bit_ops_using_ranges): Same. (simplify_using_ranges::simplify_cond_using_ranges_1): Same. (simplify_using_ranges::simplify_switch_using_ranges): Same. (simplify_using_ranges::simplify_float_conversion_using_ranges): Same. * vr-values.h (class vr_values): Add stmt arg to vrp_evaluate_conditional_warnv_with_ops. Add stmt arg to extract_range_from_comparison and get_value_range. (simplify_using_ranges::get_value_range): Add stmt arg. --- gcc/vr-values.c | 53 ++++++++++++++++++++++++++----------------------- gcc/vr-values.h | 14 ++++++------- 2 files changed, 35 insertions(+), 32 deletions(-) diff --git a/gcc/vr-values.c b/gcc/vr-values.c index 511342f2f13..fe51a6faeb8 100644 --- a/gcc/vr-values.c +++ b/gcc/vr-values.c @@ -147,7 +147,8 @@ vr_values::get_lattice_entry (const_tree var) return NULL. Otherwise create an empty range if none existed for VAR. */ const value_range_equiv * -vr_values::get_value_range (const_tree var) +vr_values::get_value_range (const_tree var, + gimple *stmt ATTRIBUTE_UNUSED) { /* If we have no recorded ranges, then return NULL. */ if (!vr_value) @@ -972,12 +973,15 @@ vr_values::extract_range_from_cond_expr (value_range_equiv *vr, gassign *stmt) void vr_values::extract_range_from_comparison (value_range_equiv *vr, - enum tree_code code, - tree type, tree op0, tree op1) + gimple *stmt) { + enum tree_code code = gimple_assign_rhs_code (stmt); + tree type = gimple_expr_type (stmt); + tree op0 = gimple_assign_rhs1 (stmt); + tree op1 = gimple_assign_rhs2 (stmt); bool sop; tree val - = simplifier.vrp_evaluate_conditional_warnv_with_ops (code, op0, op1, + = simplifier.vrp_evaluate_conditional_warnv_with_ops (stmt, code, op0, op1, false, &sop, NULL); if (val) { @@ -1472,10 +1476,7 @@ vr_values::extract_range_from_assignment (value_range_equiv *vr, gassign *stmt) else if (code == COND_EXPR) extract_range_from_cond_expr (vr, stmt); else if (TREE_CODE_CLASS (code) == tcc_comparison) - extract_range_from_comparison (vr, gimple_assign_rhs_code (stmt), - gimple_expr_type (stmt), - gimple_assign_rhs1 (stmt), - gimple_assign_rhs2 (stmt)); + extract_range_from_comparison (vr, stmt); else if (get_gimple_rhs_class (code) == GIMPLE_SINGLE_RHS && is_gimple_min_invariant (gimple_assign_rhs1 (stmt))) vr->set (gimple_assign_rhs1 (stmt)); @@ -1805,7 +1806,7 @@ vr_values::adjust_range_with_scev (value_range_equiv *vr, class loop *loop, if (TREE_CODE (step) == INTEGER_CST && is_gimple_val (init) && (TREE_CODE (init) != SSA_NAME - || get_value_range (init)->kind () == VR_RANGE)) + || get_value_range (init, stmt)->kind () == VR_RANGE)) { widest_int nit; @@ -1838,7 +1839,7 @@ vr_values::adjust_range_with_scev (value_range_equiv *vr, class loop *loop, value_range initvr; if (TREE_CODE (init) == SSA_NAME) - initvr = *(get_value_range (init)); + initvr = *(get_value_range (init, stmt)); else if (is_gimple_min_invariant (init)) initvr.set (init); else @@ -2326,7 +2327,8 @@ simplify_using_ranges::vrp_evaluate_conditional_warnv_with_ops_using_ranges tree simplify_using_ranges::vrp_evaluate_conditional_warnv_with_ops - (enum tree_code code, + (gimple *stmt, + enum tree_code code, tree op0, tree op1, bool use_equiv_p, bool *strict_overflow_p, @@ -2387,7 +2389,7 @@ simplify_using_ranges::vrp_evaluate_conditional_warnv_with_ops } else gcc_unreachable (); - const value_range_equiv *vr0 = get_value_range (op0); + const value_range_equiv *vr0 = get_value_range (op0, stmt); /* If vro, the range for OP0 to pass the overflow test, has no intersection with *vr0, OP0's known range, then the overflow test can't pass, so return the node for false. @@ -2449,8 +2451,8 @@ simplify_using_ranges::vrp_evaluate_conditional (tree_code code, tree op0, return NULL_TREE; sop = false; - ret = vrp_evaluate_conditional_warnv_with_ops (code, op0, op1, true, &sop, - &only_ranges); + ret = vrp_evaluate_conditional_warnv_with_ops (stmt, code, op0, op1, true, + &sop, &only_ranges); if (ret && sop) { @@ -2493,7 +2495,7 @@ simplify_using_ranges::vrp_evaluate_conditional (tree_code code, tree op0, always fold regardless of the value of OP0. If -Wtype-limits was specified, emit a warning. */ tree type = TREE_TYPE (op0); - const value_range_equiv *vr0 = get_value_range (op0); + const value_range_equiv *vr0 = get_value_range (op0, stmt); if (vr0->varying_p () && INTEGRAL_TYPE_P (type) @@ -2544,7 +2546,7 @@ simplify_using_ranges::vrp_visit_cond_stmt (gcond *stmt, edge *taken_edge_p) fprintf (dump_file, "\t"); print_generic_expr (dump_file, use); fprintf (dump_file, ": "); - dump_value_range (dump_file, get_value_range (use)); + dump_value_range (dump_file, get_value_range (use, stmt)); } fprintf (dump_file, "\n"); @@ -2594,7 +2596,8 @@ simplify_using_ranges::vrp_visit_cond_stmt (gcond *stmt, edge *taken_edge_p) 4 more predicates folded in SPEC. */ bool sop; - val = vrp_evaluate_conditional_warnv_with_ops (gimple_cond_code (stmt), + val = vrp_evaluate_conditional_warnv_with_ops (stmt, + gimple_cond_code (stmt), gimple_cond_lhs (stmt), gimple_cond_rhs (stmt), false, &sop, NULL); @@ -3119,7 +3122,7 @@ simplify_using_ranges::simplify_div_or_mod_using_ranges } else { - vr = get_value_range (op0); + vr = get_value_range (op0, stmt); if (range_int_cst_p (vr)) { op0min = vr->min (); @@ -3130,7 +3133,7 @@ simplify_using_ranges::simplify_div_or_mod_using_ranges if (rhs_code == TRUNC_MOD_EXPR && TREE_CODE (op1) == SSA_NAME) { - const value_range_equiv *vr1 = get_value_range (op1); + const value_range_equiv *vr1 = get_value_range (op1, stmt); if (range_int_cst_p (vr1)) op1min = vr1->min (); } @@ -3279,7 +3282,7 @@ simplify_using_ranges::simplify_abs_using_ranges (gimple_stmt_iterator *gsi, gimple *stmt) { tree op = gimple_assign_rhs1 (stmt); - const value_range *vr = get_value_range (op); + const value_range *vr = get_value_range (op, stmt); if (vr) { @@ -3369,14 +3372,14 @@ simplify_using_ranges::simplify_bit_ops_using_ranges wide_int mask; if (TREE_CODE (op0) == SSA_NAME) - vr0 = *(get_value_range (op0)); + vr0 = *(get_value_range (op0, stmt)); else if (is_gimple_min_invariant (op0)) vr0.set (op0); else return false; if (TREE_CODE (op1) == SSA_NAME) - vr1 = *(get_value_range (op1)); + vr1 = *(get_value_range (op1, stmt)); else if (is_gimple_min_invariant (op1)) vr1.set (op1); else @@ -3595,7 +3598,7 @@ simplify_using_ranges::simplify_cond_using_ranges_1 (gcond *stmt) && INTEGRAL_TYPE_P (TREE_TYPE (op0)) && is_gimple_min_invariant (op1)) { - const value_range *vr = get_value_range (op0); + const value_range *vr = get_value_range (op0, stmt); /* If we have range information for OP0, then we might be able to simplify this conditional. */ @@ -3739,7 +3742,7 @@ simplify_using_ranges::simplify_switch_using_ranges (gswitch *stmt) if (TREE_CODE (op) == SSA_NAME) { - vr = get_value_range (op); + vr = get_value_range (op, stmt); /* We can only handle integer ranges. */ if (vr->varying_p () @@ -4032,7 +4035,7 @@ simplify_using_ranges::simplify_float_conversion_using_ranges gimple *stmt) { tree rhs1 = gimple_assign_rhs1 (stmt); - const value_range *vr = get_value_range (rhs1); + const value_range *vr = get_value_range (rhs1, stmt); scalar_float_mode fltmode = SCALAR_FLOAT_TYPE_MODE (TREE_TYPE (gimple_assign_lhs (stmt))); scalar_int_mode mode; diff --git a/gcc/vr-values.h b/gcc/vr-values.h index 62a20218c6d..330b4605e39 100644 --- a/gcc/vr-values.h +++ b/gcc/vr-values.h @@ -38,12 +38,13 @@ public: // ?? These should be cleaned, merged, and made private. tree vrp_evaluate_conditional (tree_code, tree, tree, gimple *); void vrp_visit_cond_stmt (gcond *, edge *); - tree vrp_evaluate_conditional_warnv_with_ops (enum tree_code, + tree vrp_evaluate_conditional_warnv_with_ops (gimple *stmt, enum tree_code, tree, tree, bool, bool *, bool *); private: - const value_range_equiv *get_value_range (const_tree op); + const value_range_equiv *get_value_range (const_tree op, + gimple *stmt = NULL); bool simplify_truth_ops_using_ranges (gimple_stmt_iterator *, gimple *); bool simplify_div_or_mod_using_ranges (gimple_stmt_iterator *, gimple *); bool simplify_abs_using_ranges (gimple_stmt_iterator *, gimple *); @@ -101,7 +102,7 @@ class vr_values vr_values (void); ~vr_values (void); - const value_range_equiv *get_value_range (const_tree); + const value_range_equiv *get_value_range (const_tree, gimple * = NULL); void set_vr_value (tree, value_range_equiv *); value_range_equiv *swap_vr_value (tree, value_range_equiv *); @@ -140,8 +141,7 @@ class vr_values void extract_range_from_unary_expr (value_range_equiv *, enum tree_code, tree, tree); void extract_range_from_cond_expr (value_range_equiv *, gassign *); - void extract_range_from_comparison (value_range_equiv *, enum tree_code, - tree, tree, tree); + void extract_range_from_comparison (value_range_equiv *, gimple *); void vrp_visit_assignment_or_call (gimple*, tree *, value_range_equiv *); void vrp_visit_switch_stmt (gswitch *, edge *); @@ -167,9 +167,9 @@ class vr_values }; inline const value_range_equiv * -simplify_using_ranges::get_value_range (const_tree op) +simplify_using_ranges::get_value_range (const_tree op, gimple *stmt) { - return store->get_value_range (op); + return store->get_value_range (op, stmt); } extern tree get_output_for_vrp (gimple *); -- 2.26.2 --------------CF6F62EB2D732FBFBA033B50--