From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 113061 invoked by alias); 17 Oct 2016 15:46:36 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 113051 invoked by uid 89); 17 Oct 2016 15:46:36 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.2 required=5.0 tests=BAYES_00,KAM_LAZY_DOMAIN_SECURITY,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=no version=3.3.2 spammy=Hx-languages-length:2068 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 ESMTP; Mon, 17 Oct 2016 15:46:35 +0000 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 0D57C804E5; Mon, 17 Oct 2016 15:46:34 +0000 (UTC) Received: from [127.0.0.1] (ovpn01.gateway.prod.ext.ams2.redhat.com [10.39.146.11]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u9HFkWVs010407; Mon, 17 Oct 2016 11:46:33 -0400 Subject: Re: [PATCH] tilegx-tdep: Correct aliasing errors in `tilegx_analyze_prologue' To: "Maciej W. Rozycki" , gdb-patches@sourceware.org References: From: Pedro Alves Message-ID: Date: Mon, 17 Oct 2016 15:46:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-SW-Source: 2016-10/txt/msg00483.txt.bz2 On 10/17/2016 04:18 PM, Maciej W. Rozycki wrote: > Fix a load of aliasing build errors: > > cc1plus: warnings being treated as errors > .../gdb/tilegx-tdep.c: In function 'CORE_ADDR tilegx_analyze_prologue(gdbarch*, CORE_ADDR, CORE_ADDR, tilegx_frame_cache*, frame_info*)': > .../gdb/tilegx-tdep.c:609: error: dereferencing pointer 'operands' does break strict-aliasing rules > .../gdb/tilegx-tdep.c:592: error: dereferencing pointer 'operands' does break strict-aliasing rules > .../gdb/tilegx-tdep.c:571: error: dereferencing pointer 'operands' does break strict-aliasing rules > [...] > .../gdb/tilegx-tdep.c:601: error: dereferencing pointer '' does break strict-aliasing rules > .../gdb/tilegx-tdep.c:601: note: initialized from here > cc1plus: error: dereferencing pointer 'operands' does break strict-aliasing rules > cc1plus: error: dereferencing pointer 'operands' does break strict-aliasing rules > .../gdb/tilegx-tdep.c:452: note: initialized from here > cc1plus: error: dereferencing pointer 'pretmp.896' does break strict-aliasing rules > cc1plus: note: initialized from here > cc1plus: error: dereferencing pointer 'pretmp.896' does break strict-aliasing rules > cc1plus: note: initialized from here > make[1]: *** [tilegx-tdep.o] Error 1 > > from an attempt to cast a `long long' pointer to an `int64_t' pointer, > which may not necessarily be compatible types. Use the `long long' type > for the auxiliary variable then as this is the type of the structure > member referred. > > gdb/ > * tilegx-tdep.c (tilegx_analyze_prologue): Use the `long long' > type for `operands'. > --- > Hi, > > This was discovered in an `--enable-targets=all' `mips-mti-linux-gnu' > build and may be dependent on the host type and compiler version, which > are `x86_64-linux' and 4.4.7 here, respectively. OK to apply? > Sure, please do ahead. I'd be better if tilegx.h used uint32_t/uint64_t, etc, but that can always be done separately by someone motivated. Thanks, Pedro Alves