From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-74.mimecast.com (us-smtp-delivery-74.mimecast.com [170.10.133.74]) by sourceware.org (Postfix) with ESMTPS id EF3683858434 for ; Thu, 5 May 2022 09:46:47 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org EF3683858434 Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-528-6ZhKHlztPIeVZqhqQQMbhg-1; Thu, 05 May 2022 05:46:46 -0400 X-MC-Unique: 6ZhKHlztPIeVZqhqQQMbhg-1 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 65C973C138A2; Thu, 5 May 2022 09:46:46 +0000 (UTC) Received: from tucnak.zalov.cz (unknown [10.39.192.16]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 27AEE4021D9; Thu, 5 May 2022 09:46:46 +0000 (UTC) Received: from tucnak.zalov.cz (localhost [127.0.0.1]) by tucnak.zalov.cz (8.16.1/8.16.1) with ESMTPS id 2459khmm1706628 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Thu, 5 May 2022 11:46:43 +0200 Received: (from jakub@localhost) by tucnak.zalov.cz (8.16.1/8.16.1/Submit) id 2459kgbS1706627; Thu, 5 May 2022 11:46:42 +0200 Date: Thu, 5 May 2022 11:46:42 +0200 From: Jakub Jelinek To: Richard Biener Cc: gcc-patches@gcc.gnu.org Subject: Re: [PATCH] rewrite undefined overflow to defined in ifcombine Message-ID: Reply-To: Jakub Jelinek References: <20220505094459.912A313A65@imap2.suse-dmz.suse.de> MIME-Version: 1.0 In-Reply-To: <20220505094459.912A313A65@imap2.suse-dmz.suse.de> X-Scanned-By: MIMEDefang 2.85 on 10.11.54.10 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_NONE, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) 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: Thu, 05 May 2022 09:46:49 -0000 On Thu, May 05, 2022 at 11:44:59AM +0200, Richard Biener wrote: > When we make stmts to execute unconditionally in ifcombine we have > to make sure to rewrite stmts that can invoke undefined behavior > on overflow into a form with defined overflow. That's possible > for all but signed division for which we have to avoid the transform. > > Bootstrapped and tested on x86_64-unknown-linux-gnu. > > This was developed as not working solution to fix PR105142 and > I do not have a testcase that experiences wrong-code (but I only > tried for about 10 minutes to construct one). Still the problem > is obviously latent and we should fix it. > > Thus - OK for trunk? > > Thanks, > Richard. > > 2022-04-04 Richard Biener > > * tree-ssa-ifcombine.cc (bb_no_side_effects_p): Avoid executing > divisions with undefined overflow unconditionally. > (pass_tree_ifcombine::execute): Rewrite stmts with undefined > overflow to defined. LGTM. Jakub