From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 125002 invoked by alias); 19 May 2015 08:50:18 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 124938 invoked by uid 55); 19 May 2015 08:50:15 -0000 From: "rguenther at suse dot de" To: gcc-bugs@gcc.gnu.org Subject: [Bug middle-end/66110] uint8_t memory access not optimized Date: Tue, 19 May 2015 08:50:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: middle-end X-Bugzilla-Version: 5.1.0 X-Bugzilla-Keywords: alias, missed-optimization X-Bugzilla-Severity: normal X-Bugzilla-Who: rguenther at suse dot de X-Bugzilla-Status: RESOLVED X-Bugzilla-Resolution: FIXED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: rguenth at gcc dot gnu.org X-Bugzilla-Target-Milestone: 6.0 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2015-05/txt/msg01445.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66110 --- Comment #15 from rguenther at suse dot de --- On Mon, 18 May 2015, kevin at koconnor dot net wrote: > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66110 > > --- Comment #12 from Kevin OConnor --- > (In reply to Andreas Schwab from comment #11) > > Since typedef does not create a new type the effect of uint8_t is exactly > > the same as the type it is defined from. Thus if uint8_t is defined from > > unsigned char then uint8_t is a character type. > > Yes, of course. My point is that gcc does not need to define uint8_t / > __UINT8_TYPE__ as 'unsigned char'. Instead it could define it as a new integer > type (eg, __gcc_uint8_t) that is an 8-bit integer that does not alias. Yes, agreed. Like {signed,unsigned,} __gcc_int8_t or so... > As before, I understand if the cost of doing this is too high, but it's > unfortunate that there currently does not appear to be any way to define a > pointer to an 8-bit integer that doesn't alias. Another possibility would be to introduce an attribute similar to may_alias, "not_alias" so you can do typedef unsigned char uint8_t __attribute__((no_alias)); or sth like that. As that wouldn't alias with typedef unsigned char my_uint8_t __attribute__((no_alias)); the effects might be surprising though.