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 B01273847700 for ; Wed, 3 Apr 2024 07:46:29 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org B01273847700 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org B01273847700 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1712130391; cv=none; b=IbEIf7jhZgeowA576nG+KJXci8eTCe8esP2lz8L396cjd4C2LkYbc3H3CqZgWOA68faVC9+jqAdNhi/lGUoHBgaYDSnVh/IjOvxs2Pfx63NWTExX2bmJUfeDVQMT256i03jeCWl9rko7hK3sRroXqQKiDUzLDUnQkn3dV00B1yk= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1712130391; c=relaxed/simple; bh=VXfY/qWNNVQqOG35mauJi99sqR4cildT4Tb2TnB8syc=; h=DKIM-Signature:Date:From:To:Subject:Message-ID:MIME-Version; b=e0Vlql5Lyh41sRO8bFsbYoU3A3PNH7jKTZGuzvGa9zlsCrtP7cXUrdL02gUbYPqCGc9hAOvK18QNFm0WE/8bonZu3QeMaM1j7c/shcwUd/RyfNK1x/uK8h9AqGAnc6Kd2ndk4+bShJ9bcDlw565fJqVW3DjbUWMXAtz/ID6GTBE= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1712130389; 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:in-reply-to:in-reply-to: references:references; bh=QYrS71rvAprP2R7lH4nta9xz/N0hYDriRKZtueR3ejg=; b=CDsm2xsTDoy5vkP0UN1+adauv4K4urKFRRsvROxBKJKgdyy8KbtKDC0nnUEgxldNNUmf7u K9zWkFH+fn7Xs58ForvtNKwJNKEwKO5ejBn9xZ0VX2reoKNEVSxuAs+m2Uojs63Y+aIx5o M/3CFG05u38gV+amFPIYIVkISXzxEso= Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-270-ttHLLrppPUW39SlhEIcpRQ-1; Wed, 03 Apr 2024 03:46:26 -0400 X-MC-Unique: ttHLLrppPUW39SlhEIcpRQ-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id AD07B3806712; Wed, 3 Apr 2024 07:46:25 +0000 (UTC) Received: from tucnak.zalov.cz (unknown [10.45.224.14]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 7173D40735E3; Wed, 3 Apr 2024 07:46:25 +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 4337k3Gt1844745 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Wed, 3 Apr 2024 09:46:04 +0200 Received: (from jakub@localhost) by tucnak.zalov.cz (8.17.1/8.17.1/Submit) id 4337k3l61844744; Wed, 3 Apr 2024 09:46:03 +0200 Date: Wed, 3 Apr 2024 09:46:03 +0200 From: Jakub Jelinek To: Richard Biener Cc: Jason Merrill , gcc-patches@gcc.gnu.org Subject: Re: [PATCH] c++: Implement C++26 P2809R3 - Trivial infinite loops are not Undefined Behavior Message-ID: Reply-To: Jakub Jelinek References: MIME-Version: 1.0 In-Reply-To: X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.2 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=-3.6 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_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE,TXREP 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 Wed, Apr 03, 2024 at 09:35:07AM +0200, Richard Biener wrote: > Just in case making the control expression constant to the middle-end > doesn't scale. I think we need to evaluate it as constant expression in any case, that is the only way to determine if it is trivial infinite loop or not. The constant evaluator already has constexpr_ops_count counter and doesn't process more than -fconstexpr-ops-limit= operations, then it will just punt (in this case quietly). And, when we already evaluate it, just storing the result is very cheap. Jakub