From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11327 invoked by alias); 25 May 2012 20:01:50 -0000 Received: (qmail 11319 invoked by uid 22791); 25 May 2012 20:01:49 -0000 X-SWARE-Spam-Status: No, hits=-2.6 required=5.0 tests=AWL,BAYES_00,KHOP_THREADED,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from ka.mail.enyo.de (HELO ka.mail.enyo.de) (87.106.162.201) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 25 May 2012 20:01:35 +0000 Received: from [172.17.135.4] (helo=deneb.enyo.de) by ka.mail.enyo.de with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) id 1SY0hY-0003Hl-HH; Fri, 25 May 2012 22:01:32 +0200 Received: from fw by deneb.enyo.de with local (Exim 4.72) (envelope-from ) id 1SY0hY-00046D-1C; Fri, 25 May 2012 22:01:32 +0200 From: Florian Weimer To: Ian Lance Taylor Cc: gcc-help@gcc.gnu.org Subject: Re: Integral type with sizeof(T) == 1 and distinct aliasing class References: <87mx53tccm.fsf@mid.deneb.enyo.de> Date: Fri, 25 May 2012 20:01:00 -0000 In-Reply-To: (Ian Lance Taylor's message of "Sun, 20 May 2012 21:06:30 -0700") Message-ID: <87obpckp2c.fsf@mid.deneb.enyo.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii 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/msg00209.txt.bz2 * 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. However, 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. I guess I have to do this in a library after all, using template metaprogramming.