From patchwork Mon Oct 17 15:18:06 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Maciej W. Rozycki" X-Patchwork-Id: 16579 Received: (qmail 7836 invoked by alias); 17 Oct 2016 15:18:20 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 7809 invoked by uid 89); 17 Oct 2016 15:18:19 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.2 required=5.0 tests=BAYES_00, RP_MATCHES_RCVD, SPF_PASS autolearn=ham version=3.3.2 spammy=4.4.7, *operands, auxiliary X-HELO: mailapp01.imgtec.com Received: from mailapp02.imgtec.com (HELO mailapp01.imgtec.com) (217.156.133.132) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 17 Oct 2016 15:18:18 +0000 Received: from HHMAIL03.hh.imgtec.org (unknown [10.44.0.21]) by Forcepoint Email with ESMTPS id 2F62EDE82B8BA for ; Mon, 17 Oct 2016 16:18:12 +0100 (IST) Received: from HHMAIL01.hh.imgtec.org (10.100.10.19) by HHMAIL03.hh.imgtec.org (10.44.0.21) with Microsoft SMTP Server (TLS) id 14.3.294.0; Mon, 17 Oct 2016 16:18:15 +0100 Received: from [10.20.78.147] (10.20.78.147) by HHMAIL01.hh.imgtec.org (10.100.10.21) with Microsoft SMTP Server id 14.3.294.0; Mon, 17 Oct 2016 16:18:14 +0100 Date: Mon, 17 Oct 2016 16:18:06 +0100 From: "Maciej W. Rozycki" To: Subject: [PATCH] tilegx-tdep: Correct aliasing errors in `tilegx_analyze_prologue' Message-ID: User-Agent: Alpine 2.00 (DEB 1167 2008-08-23) MIME-Version: 1.0 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? Maciej gdb-tilegx-prologue-operands-fix.diff Index: binutils/gdb/tilegx-tdep.c =================================================================== --- binutils.orig/gdb/tilegx-tdep.c 2016-10-05 00:58:09.000000000 +0100 +++ binutils/gdb/tilegx-tdep.c 2016-10-15 01:29:35.689998335 +0100 @@ -449,7 +449,7 @@ tilegx_analyze_prologue (struct 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)