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 [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id 0539A3858CDB for ; Fri, 9 Jun 2023 09:11:40 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 0539A3858CDB Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1686301900; h=from:from:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=7OSzFl2cmDKWifIPklMqYbltyPKtcxHqxwGUyHpl8J0=; b=Gid3uBinqy9EMdF6mWY360AGw7T5IxRAB8tBy7pVKBu6GVQ69QCXrwvtfXCt0RPXIliGTQ MTZQeG82QIltWX5zBhnIVVJxt8ncSl9t4NPf1kq5BqYqsJJmjf6r6jKTtpQoqg5EjAyDpS FxoN9q7gTWoOVErfage5WsKl7xq4YKk= 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-628-5f7Maq2TMaexZTMJtZKEOg-1; Fri, 09 Jun 2023 05:11:35 -0400 X-MC-Unique: 5f7Maq2TMaexZTMJtZKEOg-1 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 4B72A3C021AC; Fri, 9 Jun 2023 09:11:35 +0000 (UTC) Received: from tucnak.zalov.cz (unknown [10.39.194.30]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 0B61D515542; Fri, 9 Jun 2023 09:11:34 +0000 (UTC) Received: from tucnak.zalov.cz (localhost [127.0.0.1]) by tucnak.zalov.cz (8.17.1/8.17.1) with ESMTPS id 3599BWTt116394 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Fri, 9 Jun 2023 11:11:32 +0200 Received: (from jakub@localhost) by tucnak.zalov.cz (8.17.1/8.17.1/Submit) id 3599BV8Y116391; Fri, 9 Jun 2023 11:11:31 +0200 Date: Fri, 9 Jun 2023 11:11:31 +0200 From: Jakub Jelinek To: Richard Biener Cc: Andrew Pinski , gcc-patches@gcc.gnu.org Subject: Re: [PATCH] MATCH: Fix zero_one_valued_p not to match signed 1 bit integers Message-ID: Reply-To: Jakub Jelinek References: <20230609014701.3123763-1-apinski@marvell.com> MIME-Version: 1.0 In-Reply-To: X-Scanned-By: MIMEDefang 3.1 on 10.11.54.9 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-3.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On Fri, Jun 09, 2023 at 11:06:04AM +0200, Richard Biener via Gcc-patches wrote: > On Fri, Jun 9, 2023 at 3:48 AM Andrew Pinski via Gcc-patches > wrote: > > > > So for the attached testcase, we assumed that zero_one_valued_p would > > be the value [0,1] but currently zero_one_valued_p matches also > > signed 1 bit integers. > > This changes that not to match that and fixes the 2 new testcases at > > all optimization levels. > > > > OK? Bootstrapped and tested on x86_64-linux-gnu with no regressions. > > OK. Note, this means it won't return true for zero INTEGER_CSTs with signed 1-bit precision type. Such value is in the [0, 1] range. Though, I guess signed 1-bit precision types are so rare and problematic that it doesn't hurt not to optimize that. Jakub