This is the mail archive of the gdb-cvs@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[binutils-gdb] tilegx-tdep: Correct aliasing errors in `tilegx_analyze_prologue'


https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=b348d11b70068e7eabba6d8f99d4ad371c3f6253

commit b348d11b70068e7eabba6d8f99d4ad371c3f6253
Author: Maciej W. Rozycki <macro@imgtec.com>
Date:   Mon Oct 17 16:18:06 2016 +0100

    tilegx-tdep: Correct aliasing errors in `tilegx_analyze_prologue'
    
    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'.

Diff:
---
 gdb/ChangeLog     | 5 +++++
 gdb/tilegx-tdep.c | 2 +-
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 4f706fd..6bc9805 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,8 @@
+2016-10-18  Maciej W. Rozycki  <macro@imgtec.com>
+
+	* tilegx-tdep.c (tilegx_analyze_prologue): Use the `long long'
+	type for `operands'.
+
 2016-10-17  Simon Marchi  <simon.marchi@ericsson.com>
 
 	* mi/mi-main.c (mi_cmd_trace_save): Check if argument is present
diff --git a/gdb/tilegx-tdep.c b/gdb/tilegx-tdep.c
index 45eb162..94ed401 100644
--- a/gdb/tilegx-tdep.c
+++ b/gdb/tilegx-tdep.c
@@ -449,7 +449,7 @@ tilegx_analyze_prologue (struct gdbarch* gdbarch,
       for (i = 0; i < num_insns; i++)
 	{
 	  struct tilegx_decoded_instruction *this_insn = &decoded[i];
-	  int64_t *operands = (int64_t *) this_insn->operand_values;
+	  long long *operands = this_insn->operand_values;
 	  const struct tilegx_opcode *opcode = this_insn->opcode;
 
 	  switch (opcode->mnemonic)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]