From patchwork Fri Jan 12 18:02:36 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sebastian Perta X-Patchwork-Id: 860128 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-471029-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="ajqwttHf"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3zJ9Zq6V21z9sNc for ; Sat, 13 Jan 2018 05:02:59 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:subject:date:message-id:mime-version:content-type :content-transfer-encoding; q=dns; s=default; b=bW63ZxXLH2jpJNjK xHcHk80y3f2ebeOvcC+2QFw2B52cMEpJ0f1n5IORPrLZul+7ybNXbaJvaa2skHt/ 2GlBm7J7+RRScizkjWyML97I0F9IWP2G99MX3bdg64ARwBFfUVadWh6dAzEF71Jb R5Ds9NwWs6amrOl1u3W9PPKVehg= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:subject:date:message-id:mime-version:content-type :content-transfer-encoding; s=default; bh=yCdd7FrJUauxdmcMK8+jrJ YSXnk=; b=ajqwttHfEWSSgmdb9cwXde5QxKm05uqUtHi1aZ0j67a0UQFN8DAjA9 c6slg5jkr+8VMWMd2587LSF1sYv+uDMi8eHA5c18ub8W8k52yetyqq5UgGi6ymxT hcRbwjaxrvP5eURhtC/WBj90pe2TZWZTxLVfLu7czfRytoylhsjAI= Received: (qmail 130201 invoked by alias); 12 Jan 2018 18:02:44 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 130089 invoked by uid 89); 12 Jan 2018 18:02:43 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-11.1 required=5.0 tests=BAYES_00, GIT_PATCH_2, GIT_PATCH_3, KAM_ASCII_DIVIDERS, KAM_SHORT, RCVD_IN_DNSWL_NONE, SPF_PASS, T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 spammy=H*UA:Outlook, H*x:Outlook, H*UA:Microsoft, H*x:Microsoft X-HELO: relmlie3.idc.renesas.com Received: from relmlor4.renesas.com (HELO relmlie3.idc.renesas.com) (210.160.252.174) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 12 Jan 2018 18:02:40 +0000 Received: from unknown (HELO relmlir3.idc.renesas.com) ([10.200.68.153]) by relmlie3.idc.renesas.com with ESMTP; 13 Jan 2018 03:02:37 +0900 Received: from relmlii2.idc.renesas.com (relmlii2.idc.renesas.com [10.200.68.66]) by relmlir3.idc.renesas.com (Postfix) with ESMTP id 9AA953FCB6 for ; Sat, 13 Jan 2018 03:02:37 +0900 (JST) Received: from unknown (HELO REEBED03978) ([10.226.37.54]) by relmlii2.idc.renesas.com with ESMTP; 13 Jan 2018 03:02:36 +0900 From: "Sebastian Perta" To: Subject: [PATCH] RL78 UNUSED note setting bug fix in rl78_note_reg_set Date: Fri, 12 Jan 2018 18:02:36 -0000 Message-ID: <000601d38bcf$8790a0d0$96b1e270$@renesas.com> MIME-Version: 1.0 Hello, The below patch fixes 31 regression failures (28 for C and 3 for C++, see below) plus the problem discovered here https://gcc.gnu.org/ml/gcc-patches/2018-01/msg00688.html by DJ. Tested with the following command: make -k check-gcc RUNTESTFLAGS=--target_board=rl78-sim List of previous fails which get fixed by this patch: FAIL: gcc.c-torture/execute/pr42512.c -O3 -fomit-frame-pointer -funroll-loops -fpeel-loops -ftracer -finline-functions execution test FAIL: gcc.c-torture/execute/pr53645-2.c -O1 execution test FAIL: gcc.c-torture/execute/pr53645-2.c -O2 execution test FAIL: gcc.c-torture/execute/pr53645-2.c -O3 -fomit-frame-pointer -funroll-loops -fpeel-loops -ftracer -finline-functions execution test FAIL: gcc.c-torture/execute/pr53645-2.c -O3 -g execution test FAIL: gcc.c-torture/execute/pr53645-2.c -Os execution test FAIL: gcc.c-torture/execute/pr53645-2.c -O2 -flto -fno-use-linker-plugin -flto-partition=none execution test FAIL: gcc.c-torture/execute/pr53645-2.c -O2 -flto -fuse-linker-plugin -fno-fat-lto-objects execution test FAIL: gcc.c-torture/execute/pr53645.c -O1 execution test FAIL: gcc.c-torture/execute/pr53645.c -O2 execution test FAIL: gcc.c-torture/execute/pr53645.c -O3 -fomit-frame-pointer -funroll-loops -fpeel-loops -ftracer -finline-functions execution test FAIL: gcc.c-torture/execute/pr53645.c -O3 -g execution test FAIL: gcc.c-torture/execute/pr53645.c -Os execution test FAIL: gcc.c-torture/execute/pr53645.c -O2 -flto -fno-use-linker-plugin -flto-partition=none execution test FAIL: gcc.c-torture/execute/pr53645.c -O2 -flto -fuse-linker-plugin -fno-fat-lto-objects execution test FAIL: gcc.c-torture/execute/pr61306-2.c -O1 execution test FAIL: gcc.c-torture/execute/pr61306-2.c -O2 execution test FAIL: gcc.c-torture/execute/pr61306-2.c -O3 -g execution test FAIL: gcc.c-torture/execute/pr61306-2.c -Os execution test FAIL: gcc.c-torture/execute/pr61306-2.c -O2 -flto -fno-use-linker-plugin -flto-partition=none execution test FAIL: gcc.c-torture/execute/pr65401.c -O3 -fomit-frame-pointer -funroll-loops -fpeel-loops -ftracer -finline-functions execution test FAIL: gcc.dg/compat/struct-by-value-13 c_compat_x_tst.o-c_compat_y_tst.o link FAIL: gcc.dg/builtin-arith-overflow-1.c execution test FAIL: gcc.dg/builtin-bswap-4.c execution test FAIL: gcc.dg/pr26719.c execution test FAIL: c-c++-common/torture/builtin-arith-overflow-14.c -O0 (test for excess errors) FAIL: c-c++-common/torture/builtin-arith-overflow-3.c -O0 (test for excess errors) FAIL: gcc.dg/torture/pr57569.c -Os execution test FAIL: tmpdir-g++.dg-struct-layout-1/t005 cp_compat_x_tst.o-cp_compat_y_tst.o link FAIL: c-c++-common/torture/builtin-arith-overflow-14.c -O0 (test for excess errors) FAIL: c-c++-common/torture/builtin-arith-overflow-3.c -O0 (test for excess errors) Please let me know if this is OK. Thank you! Best Regards, Sebastian for (i = 0; i < GET_MODE_SIZE (GET_MODE (d)); i ++) Index: ChangeLog =================================================================== --- ChangeLog (revision 256590) +++ ChangeLog (working copy) @@ -1,3 +1,8 @@ +2018-01-12 Sebastian Perta + + * config/rl78/rl78.c (rl78_note_reg_set): fixed dead reg check + for non-QImode registers + 2018-01-12 Vladimir Makarov PR rtl-optimization/80481 Index: config/rl78/rl78.c =================================================================== --- config/rl78/rl78.c (revision 256590) +++ config/rl78/rl78.c (working copy) @@ -3792,7 +3792,7 @@ rl78_note_reg_set (char *dead, rtx d, rtx insn) { int r, i; - + bool is_dead; if (GET_CODE (d) == MEM) rl78_note_reg_uses (dead, XEXP (d, 0), insn); @@ -3799,9 +3799,15 @@ if (GET_CODE (d) != REG) return; + /* 'dead' keeps track of the QImode registers if r is of different size + we need to check the other subparts as well */ r = REGNO (d); - if (dead [r]) - add_reg_note (insn, REG_UNUSED, gen_rtx_REG (GET_MODE (d), r)); + is_dead = true; + for (i = 0; i < GET_MODE_SIZE (GET_MODE (d)); i ++) + if (!dead [r + i]) + is_dead = false; + if(is_dead) + add_reg_note (insn, REG_UNUSED, gen_rtx_REG (GET_MODE (d), r)); if (dump_file) fprintf (dump_file, "note set reg %d size %d\n", r, GET_MODE_SIZE (GET_MODE (d)));