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.129.124]) by sourceware.org (Postfix) with ESMTPS id 9EC8E3858C2B for ; Mon, 15 May 2023 10:42:16 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 9EC8E3858C2B 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=1684147336; 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=+2BBRGe3oybdx57ElG+mQyoyf8VJxnUg8L6WKTMNWuc=; b=Z4Rbb8UuolAht18Kbzr//On3Pvg06cUpWOJL5FuFJI0PGPK8pPeNXYC+u8VgYIPXGTKEih ly6ojMGayyEqbTGLx3H2iLaf1ZcBKmBjTmoxOjMYycoI/v3b6QWugf8B0tuH/kbNvKxkSV /THTIPUy78+c24kp1LIZBdqB1ie+Sj4= 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-519-aNq-q1Q2NpmoIYWKTyfhSQ-1; Mon, 15 May 2023 06:42:14 -0400 X-MC-Unique: aNq-q1Q2NpmoIYWKTyfhSQ-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 90D741C313A4; Mon, 15 May 2023 10:42:14 +0000 (UTC) Received: from tucnak.zalov.cz (unknown [10.39.192.17]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 51A8F2166B26; Mon, 15 May 2023 10:42:14 +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 34FAgBZA175378 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Mon, 15 May 2023 12:42:12 +0200 Received: (from jakub@localhost) by tucnak.zalov.cz (8.17.1/8.17.1/Submit) id 34FAgA4h175377; Mon, 15 May 2023 12:42:10 +0200 Date: Mon, 15 May 2023 12:42:10 +0200 From: Jakub Jelinek To: Aldy Hernandez Cc: GCC patches , Andrew MacLeod , Richard Biener , mjambor@suse.cz Subject: Re: [PATCH] Add auto-resizing capability to irange's [PR109695] Message-ID: Reply-To: Jakub Jelinek References: <20230515103523.100412-1-aldyh@redhat.com> MIME-Version: 1.0 In-Reply-To: <20230515103523.100412-1-aldyh@redhat.com> X-Scanned-By: MIMEDefang 3.1 on 10.11.54.6 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.7 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.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On Mon, May 15, 2023 at 12:35:23PM +0200, Aldy Hernandez wrote: > gcc/ChangeLog: > > PR tree-optimization/109695 > * value-range.cc (irange::operator=): Resize range. > (irange::union_): Same. > (irange::intersect): Same. > (irange::invert): Same. > (int_range_max): Default to 3 sub-ranges and resize as needed. > * value-range.h (irange::maybe_resize): New. > (~int_range): New. > (int_range::int_range): Adjust for resizing. > (int_range::operator=): Same. LGTM. One question is if we shouldn't do it for GCC13/GCC12 as well, perhaps changing it to some larger number than 3 when the members aren't wide_ints in there but just trees. Sure, in 13/12 the problem is 10x less severe than in current trunk, but still we have some cases where we run out of stack because of it on some hosts. Jakub