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 [216.205.24.124]) by sourceware.org (Postfix) with ESMTP id A3CEB3857829 for ; Wed, 16 Sep 2020 18:43:48 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org A3CEB3857829 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-333-hPQJBixdNtyAd4ErMw3fbw-1; Wed, 16 Sep 2020 14:43:45 -0400 X-MC-Unique: hPQJBixdNtyAd4ErMw3fbw-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id B7F69802B67 for ; Wed, 16 Sep 2020 18:43:44 +0000 (UTC) Received: from [10.10.113.83] (ovpn-113-83.rdu2.redhat.com [10.10.113.83]) by smtp.corp.redhat.com (Postfix) with ESMTP id 61A191002D55; Wed, 16 Sep 2020 18:43:44 +0000 (UTC) Subject: Re: [PATCH] Allow copying of symbolic ranges to an irange. To: Aldy Hernandez , gcc-patches References: <7451c973-0a40-f8b9-3546-aedd36f63ee2@redhat.com> <74d5d365-9efd-2c54-9087-917084108f44@redhat.com> From: Andrew MacLeod Message-ID: <443670c9-ea0d-5950-d851-7f82081164cb@redhat.com> Date: Wed, 16 Sep 2020 14:43:43 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.4.0 MIME-Version: 1.0 In-Reply-To: <74d5d365-9efd-2c54-9087-917084108f44@redhat.com> X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Mimecast-Spam-Score: 0.002 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00, BODY_8BITS, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, NICE_REPLY_A, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H5, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) 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: Wed, 16 Sep 2020 18:43:49 -0000 On 9/16/20 12:25 PM, Aldy Hernandez wrote: > > > >>  // Swap min/max if they are out of order.  Return TRUE if further > > these seems OK, but can't there be anti-ranges with symbolics  too? ie > > ~[a_12, a_12] > > The code for that just does: > > > >   else if (src.kind () == VR_ANTI_RANGE) > >      set (src.min (), src.max (), VR_ANTI_RANGE); > > > > That should just go to varying I guess? > > Ah, you're right.  I've tweaked the patch and have added a > corresponding test. > > > > > The conversion to legacy anti-range code also seems a little suspect in > > some cases... > > > > Finally, we theoretically shouldn't be accessing 'min()' and 'max()' > > fields in a multirange, which also looks like might happen in the final > > else clause. > > > > I wonder if it might be less complex to simply have 2 routines, like > > copy_to_legacy()  and copy_from_legacy()  instead of trying to handle > > then together?  I do find it seems to require more thinking than it > > should to follow the cases :-) > > Sigh, yes.  That code is too clever for its own good.  I'll work on it > as a follow-up. > > OK pending tests? > OK.  but do follow it up. Andrew