This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] tilegx-tdep: Correct aliasing errors in `tilegx_analyze_prologue'
- From: Pedro Alves <palves at redhat dot com>
- To: "Maciej W. Rozycki" <macro at imgtec dot com>, gdb-patches at sourceware dot org
- Date: Mon, 17 Oct 2016 16:46:32 +0100
- Subject: Re: [PATCH] tilegx-tdep: Correct aliasing errors in `tilegx_analyze_prologue'
- Authentication-results: sourceware.org; auth=none
- References: <alpine.DEB.2.00.1610150200220.31859@tp.orcam.me.uk>
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 '<anonymous>' 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