From patchwork Mon Jan 24 18:47:49 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Graham Reed X-Patchwork-Id: 80228 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id AC0F61007D1 for ; Tue, 25 Jan 2011 05:48:08 +1100 (EST) Received: (qmail 7126 invoked by alias); 24 Jan 2011 18:48:04 -0000 Received: (qmail 7069 invoked by uid 22791); 24 Jan 2011 18:48:03 -0000 X-SWARE-Spam-Status: No, hits=-2.0 required=5.0 tests=AWL, BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, RCVD_IN_DNSWL_NONE, T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from a-pb-sasl-sd.pobox.com (HELO sasl.smtp.pobox.com) (64.74.157.62) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 24 Jan 2011 18:47:56 +0000 Received: from sasl.smtp.pobox.com (unknown [127.0.0.1]) by a-pb-sasl-sd.pobox.com (Postfix) with ESMTP id D92782643; Mon, 24 Jan 2011 13:48:42 -0500 (EST) Received: from a-pb-sasl-sd.pobox.com (unknown [127.0.0.1]) by a-pb-sasl-sd.pobox.com (Postfix) with ESMTP id C7C412640; Mon, 24 Jan 2011 13:48:41 -0500 (EST) Received: from mail.7deadly.org (unknown [199.19.173.170]) by a-pb-sasl-sd.pobox.com (Postfix) with ESMTPA id 717E8263F; Mon, 24 Jan 2011 13:48:40 -0500 (EST) Received: from torgrahamr.algorithmics.com (external.algorithmics.com [204.92.92.4]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.7deadly.org (Postfix) with ESMTP id 284F5288316; Mon, 24 Jan 2011 13:47:50 -0500 (EST) Message-ID: <4D3DC955.8060207@pobox.com> Date: Mon, 24 Jan 2011 13:47:49 -0500 From: Graham Reed User-Agent: Mozilla/5.0 (X11; U; Linux i686 (x86_64); en-GB; rv:1.9.2.8) Gecko/20100802 Thunderbird/3.1.2 MIME-Version: 1.0 To: libstdc++@gcc.gnu.org, gcc-patches@gcc.gnu.org Subject: fix libstdc++/47387 AIX ctype mask override X-Pobox-Relay-ID: 904ABDD2-27EA-11E0-B987-BC4EF3E828EC-26351928!a-pb-sasl-sd.pobox.com X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Per bug 47387, the attached patch fixes the problem, found by the libstdc++ regression suite, where ctype mask override isn't working. It applies only to AIX. The existing testcase '22_locale/ctype/is/char/3.cc' is sufficient to verify the fix. PR libstdc++/47387 * config/os/aix/ctype_inline.h: Use _M_table if provided. I have run the regression suite with this change on powerpc-ibm-aix5.3.0.0, verifying 4 multilib combinations: '', 'ppc64', 'pthread', and 'pthread/ppc64' in the 4.5.2 release code. Index: libstdc++-v3/config/os/aix/ctype_inline.h =================================================================== --- libstdc++-v3/config/os/aix/ctype_inline.h (revision 169055) +++ libstdc++-v3/config/os/aix/ctype_inline.h (working copy) @@ -39,14 +39,23 @@ bool ctype:: is(mask __m, char __c) const - { return __OBJ_DATA(__lc_ctype)->mask[__c] & __m; } + { + if(_M_table) + return _M_table[static_cast(__c)] & __m; + else + return __OBJ_DATA(__lc_ctype)->mask[__c] & __m; + } const char* ctype:: is(const char* __low, const char* __high, mask* __vec) const { - while (__low < __high) - *__vec++ = __OBJ_DATA(__lc_ctype)->mask[*__low++]; + if(_M_table) + while (__low < __high) + *__vec++ = _M_table[static_cast(*__low++)]; + else + while (__low < __high) + *__vec++ = __OBJ_DATA(__lc_ctype)->mask[*__low++]; return __high; }