From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2140) id 6B48B383F878; Thu, 17 Sep 2020 13:46:16 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 6B48B383F878 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1600350376; bh=M2Dloi60ZgG9pgsAj/XjRCx1PsevIs+CI0JHwc3ywl8=; h=From:To:Subject:Date:From; b=Oxsbw6b+2rgJz8Eeh15gaMc9LQ9lyY1DSYnL47KFLFk9XRB4I/TquJhODaB7JJUMs H7YIZb1MqUkb3HGR7zREpG5iV52i13vWEJoKtSwXyXbx/X+2FYVRm2g4NDXJ4OjSjs XQsMhdAxEZnKBlNZPToTORg6o1i0nzlXMItSb1UY= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Alexandre Oliva To: gcc-cvs@gcc.gnu.org Subject: [gcc(refs/users/aoliva/heads/testme)] verbosify unified nonconst merges X-Act-Checkin: gcc X-Git-Author: Alexandre Oliva X-Git-Refname: refs/users/aoliva/heads/testme X-Git-Oldrev: 4fe8268329a35236f3b03995495fbad922d7bd5a X-Git-Newrev: 139b006646d02d6a16d582714b44c897af682702 Message-Id: <20200917134616.6B48B383F878@sourceware.org> Date: Thu, 17 Sep 2020 13:46:16 +0000 (GMT) X-BeenThere: gcc-cvs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Sep 2020 13:46:16 -0000 https://gcc.gnu.org/g:139b006646d02d6a16d582714b44c897af682702 commit 139b006646d02d6a16d582714b44c897af682702 Author: Alexandre Oliva Date: Thu Sep 17 09:46:56 2020 -0300 verbosify unified nonconst merges Diff: --- gcc/fold-const.c | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/gcc/fold-const.c b/gcc/fold-const.c index c6cffb8ffcf..f901fad51b3 100644 --- a/gcc/fold-const.c +++ b/gcc/fold-const.c @@ -6675,6 +6675,20 @@ fold_truth_andor_1 (location_t loc, enum tree_code code, tree truth_type, ll_mask = const_binop (BIT_IOR_EXPR, ll_mask, rl_mask); lr_mask = const_binop (BIT_IOR_EXPR, lr_mask, rr_mask); + bool report = + !(lnbitsize == rnbitsize + && xll_bitpos == xlr_bitpos + && lnbitpos >= 0 + && rnbitpos >= 0) + && !(((ll_bitsize + ll_bitpos == rl_bitpos + && lr_bitsize + lr_bitpos == rr_bitpos) + || (ll_bitpos == rl_bitpos + rl_bitsize + && lr_bitpos == rr_bitpos + rr_bitsize)) + && ll_bitpos >= 0 + && rl_bitpos >= 0 + && lr_bitpos >= 0 + && rr_bitpos >= 0); + lhs = make_bit_field_ref (loc, ll_inner, ll_arg, lntype, lnbitsize, lnbitpos, ll_unsignedp || rl_unsignedp, ll_reversep); @@ -6724,7 +6738,16 @@ fold_truth_andor_1 (location_t loc, enum tree_code code, tree truth_type, if (! integer_all_onesp (lr_mask)) rhs = build2_loc (loc, BIT_AND_EXPR, type, rhs, lr_mask); - return build2_loc (loc, wanted_code, truth_type, lhs, rhs); + result = build2_loc (loc, wanted_code, truth_type, lhs, rhs); + + if (report) + inform (loc, "merged nc extra %qE and %qE into %qE", + lhs, rhs, result); + else if (l_xor || r_xor) + inform (loc, "merged extra %qE and %qE into %qE", + lhs, rhs, result); + + return result; } /* Handle the case of comparisons with constants. If there is something in