From patchwork Mon Jun 28 15:33:05 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan-Benedict Glaw X-Patchwork-Id: 1498025 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=sourceware.org; envelope-from=gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Received: from sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4GDBTX1DVVz9snk for ; Tue, 29 Jun 2021 01:33:35 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 721AE39BC072 for ; Mon, 28 Jun 2021 15:33:32 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from lug-owl.de (lug-owl.de [188.68.32.151]) by sourceware.org (Postfix) with ESMTP id 2AF20383B434 for ; Mon, 28 Jun 2021 15:33:07 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 2AF20383B434 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=lug-owl.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=lug-owl.de Received: by lug-owl.de (Postfix, from userid 1001) id E888C41EC3; Mon, 28 Jun 2021 17:33:05 +0200 (CEST) Date: Mon, 28 Jun 2021 17:33:05 +0200 From: Jan-Benedict Glaw To: Paul Koning Subject: pdp11: Fix warnings to allow compilation with a recent GCC and --enable-werror-always Message-ID: <20210628153305.an2wompb3wcghohv@lug-owl.de> MIME-Version: 1.0 Content-Disposition: inline X-Operating-System: Linux chamaeleon 5.8.0-0.bpo.2-amd64 X-gpg-fingerprint: 250D 3BCF 7127 0D8C A444 A961 1DBD 5E75 8399 E1BB X-gpg-key: wwwkeys.de.pgp.net X-Echelon-Enable: howto poison arsenous mail psychological biological nuclear warfare test the bombastical terror of flooding the spy listeners explosion sex drugs and rock'n'roll X-TKUeV: howto poison arsenous mail psychological biological nuclear warfare test the bombastical terror of flooding the spy listeners explosion sex drugs and rock'n'roll X-message-flag: Please send plain text messages only. Do not send HTML emails. Thank you. User-Agent: NeoMutt/20170113 (1.7.2) X-Spam-Status: No, score=-9.9 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_STATUS, RCVD_IN_DNSWL_NONE, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: GCC Patches Errors-To: gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org Sender: "Gcc-patches" Hi Paul! I'd like to install this patch to let the pdp11-aout configuration build again with eg. ../gcc/configure --target=pdp11-aout --enable-werror-always \ --enable-languages=all --disable-gcov --disable-shared \ --disable-threads --without-headers \ --prefix=/var/lib/laminar/run/gcc-pdp11-aout/5/toolchain-install No testsuite (yet? Maybe I'd add a bit), but re-checked some Hello World'ish code for no changes and it still runs on a SIMH pdp11. * config/pdp11/pdp11.h (ASM_OUTPUT_SKIP): Fix signedness warning. * config/pdp11/pdp11.c (pdp11_asm_print_operand_punct_valid_p): Remove "register" keyword. (pdp11_initial_elimination_offset) Remove unused variable. (pdp11_cmp_length) Ditto. (pdp11_insn_cost): Ditto, and fix signedness warning. Okay for master? MfG, JBG diff --git a/gcc/config/pdp11/pdp11.h b/gcc/config/pdp11/pdp11.h index a21ae648439..9bc5e089f49 100644 --- a/gcc/config/pdp11/pdp11.h +++ b/gcc/config/pdp11/pdp11.h @@ -618,10 +618,12 @@ extern int current_first_parm_offset; fprintf (FILE, "\t.even\n") #define ASM_OUTPUT_SKIP(FILE,SIZE) \ - if (TARGET_DEC_ASM) \ - fprintf (FILE, "\t.blkb\t%o\n", (SIZE) & 0xffff); \ - else \ - fprintf (FILE, "\t.=.+ %#o\n", (SIZE) & 0xffff); + do { \ + if (TARGET_DEC_ASM) \ + fprintf (FILE, "\t.blkb\t%o\n", (int) ((SIZE) & 0xffff)); \ + else \ + fprintf (FILE, "\t.=.+ %#o\n", (int) ((SIZE) & 0xffff)); \ + } while (0) /* This says how to output an assembler line to define a global common symbol. */ diff --git a/gcc/config/pdp11/pdp11.c b/gcc/config/pdp11/pdp11.c index b663b43a29c..4cab3aee598 100644 --- a/gcc/config/pdp11/pdp11.c +++ b/gcc/config/pdp11/pdp11.c @@ -829,12 +829,12 @@ pdp11_asm_print_operand_punct_valid_p (unsigned char c) } void -print_operand_address (FILE *file, register rtx addr) +print_operand_address (FILE *file, rtx addr) { - register rtx breg; + rtx breg; rtx offset; int again = 0; - + retry: switch (GET_CODE (addr)) @@ -1160,12 +1160,11 @@ pdp11_addr_cost (rtx addr, machine_mode mode, addr_space_t as ATTRIBUTE_UNUSED, static int pdp11_insn_cost (rtx_insn *insn, bool speed) { - int base_cost, i; + int base_cost; rtx pat, set, dest, src, src2; machine_mode mode; - const char *fmt; enum rtx_code op; - + if (recog_memoized (insn) < 0) return 0; @@ -1462,24 +1461,24 @@ bool pushpop_regeq (rtx op, int regno) { rtx addr; - + /* False if not memory reference. */ if (GET_CODE (op) != MEM) return FALSE; - + /* Get the address of the memory reference. */ addr = XEXP (op, 0); if (GET_CODE (addr) == MEM) addr = XEXP (addr, 0); - + switch (GET_CODE (addr)) { case PRE_DEC: case POST_INC: case PRE_MODIFY: case POST_MODIFY: - return REGNO (XEXP (addr, 0)) == regno; + return REGNO (XEXP (addr, 0)) == (unsigned) regno; default: return FALSE; } @@ -1771,8 +1770,7 @@ int pdp11_initial_elimination_offset (int from, int to) { /* Get the size of the register save area. */ - int spoff; - + if (from == FRAME_POINTER_REGNUM && to == STACK_POINTER_REGNUM) return get_frame_size (); else if (from == ARG_POINTER_REGNUM && to == FRAME_POINTER_REGNUM) @@ -2106,15 +2104,14 @@ pdp11_cmp_length (rtx *operands, int words) { rtx inops[2]; rtx exops[4][2]; - rtx lb[1]; int i, len = 0; if (!reload_completed) return 2; - + inops[0] = operands[0]; inops[1] = operands[1]; - + pdp11_expand_operands (inops, exops, 2, words, NULL, big); for (i = 0; i < words; i++)