From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24842 invoked by alias); 25 May 2012 20:41:06 -0000 Received: (qmail 24833 invoked by uid 22791); 25 May 2012 20:41:05 -0000 X-SWARE-Spam-Status: No, hits=-5.1 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,FREEMAIL_FROM,KHOP_RCVD_TRUST,KHOP_THREADED,RCVD_IN_DNSWL_LOW,RCVD_IN_HOSTKARMA_YE X-Spam-Check-By: sourceware.org Received: from mail-ob0-f175.google.com (HELO mail-ob0-f175.google.com) (209.85.214.175) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 25 May 2012 20:40:52 +0000 Received: by obhx4 with SMTP id x4so1912260obh.20 for ; Fri, 25 May 2012 13:40:52 -0700 (PDT) MIME-Version: 1.0 Received: by 10.182.164.69 with SMTP id yo5mr301528obb.17.1337978452132; Fri, 25 May 2012 13:40:52 -0700 (PDT) Received: by 10.182.92.168 with HTTP; Fri, 25 May 2012 13:40:52 -0700 (PDT) In-Reply-To: <87obpckp2c.fsf@mid.deneb.enyo.de> References: <87mx53tccm.fsf@mid.deneb.enyo.de> <87obpckp2c.fsf@mid.deneb.enyo.de> Date: Fri, 25 May 2012 20:41:00 -0000 Message-ID: Subject: Re: Integral type with sizeof(T) == 1 and distinct aliasing class From: Gabriel Dos Reis To: Florian Weimer Cc: Ian Lance Taylor , gcc-help@gcc.gnu.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes Mailing-List: contact gcc-help-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-help-owner@gcc.gnu.org X-SW-Source: 2012-05/txt/msg00210.txt.bz2 On Fri, May 25, 2012 at 3:01 PM, Florian Weimer wrote: > * Ian Lance Taylor: > >> Florian Weimer writes: >> >>> Is there a type which is basically an (unsigned) char, but with the >>> additional feature that a pointer derived from it wouldn't alias with >>> basically anything? >>> >>> This type would be handy for optimizing marshaling code. >> >> There is no such type. =A0However, use of the restrict qualifier should >> achieve a similar effect. > > It turns out that I can't get GCC to eliminate redundant bounds > checks, no matter what the type is. =A0I guess I have to do this in a > library after all, using template metaprogramming. is it possible to use one of those GCC type mode extensions to typedef int with mode saying it has 8-bit and use that? -- Gaby