From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30718 invoked by alias); 2 Oct 2014 03:22:50 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 30665 invoked by uid 89); 2 Oct 2014 03:22:45 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-4.1 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Thu, 02 Oct 2014 03:22:43 +0000 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s923Mefv001310 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Wed, 1 Oct 2014 23:22:40 -0400 Received: from [10.10.116.27] ([10.10.116.27]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id s923McI8013758; Wed, 1 Oct 2014 23:22:39 -0400 Message-ID: <542CC4FA.70609@redhat.com> Date: Thu, 02 Oct 2014 03:22:00 -0000 From: Jason Merrill User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.1.1 MIME-Version: 1.0 To: DJ Delorie , Nathan Sidwell CC: gcc-patches@gcc.gnu.org Subject: Re: __intN patch 3/5: main __int128 -> __intN conversion. References: <201408132211.s7DMBGBu016387@greed.delorie.com> <201408212123.s7LLNPIQ018746@greed.delorie.com> <201408220515.s7M5Fhpa007479@greed.delorie.com> <201408221924.s7MJOcjB022631@greed.delorie.com> <201408260303.s7Q33nqm024601@greed.delorie.com> <201409302314.s8UNE7LP020494@greed.delorie.com> In-Reply-To: <201409302314.s8UNE7LP020494@greed.delorie.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2014-10/txt/msg00113.txt.bz2 On 09/30/2014 07:14 PM, DJ Delorie wrote: > Could one of you two please review the remaining C++ parts (cp/*) ? > > https://gcc.gnu.org/ml/gcc-patches/2014-08/msg02360.html > + for (i = 0; i < NUM_INT_N_ENTS; i ++) > { > + if (int_n_enabled_p [i] > + && (same_type_p (TYPE_MAIN_VARIANT (t1), > + int_n_trees[i].signed_type) > + || same_type_p (TYPE_MAIN_VARIANT (t2), > + int_n_trees[i].signed_type))) > + { > + tree t = ((TYPE_UNSIGNED (t1) || TYPE_UNSIGNED (t2)) > + ? int_n_trees[i].unsigned_type > + : int_n_trees[i].signed_type); > + return build_type_attribute_variant (t, attributes); > + } > } It seems like the int128 code here was broken and this is continuing that brokenness. Extended integer types have integer conversion rank corresponding to their bitsize, so int128 should have higher rank than long long, but here it was being checked after long long, and your code also follows the long long code. Also, we should be checking for both signed and unsigned variants. If you plan to allow __intN with sizes between those of int and long long, they need to have the appropriate intermediate conversion rank for their size. Basically I think the integral conversion code in cp_common_type ought to be rewritten to work on integer_types rather than naming specific types. > - 'n', /* itk_int128 */ > - 'o', /* itk_unsigned_int128 */ > + /* __intN types are handled separately */ Where are they mangled now? I also don't see any mangling tests. Jason