From patchwork Tue Oct 23 22:55:05 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Law X-Patchwork-Id: 988391 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-488178-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="cjYN9l5N"; 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 42fpd16kMvz9sDr for ; Wed, 24 Oct 2018 09:55:16 +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:to :from:subject:message-id:date:mime-version:content-type; q=dns; s=default; b=lcscDL11kluz/NTouy4iSLWHAHN9Q2zpidJNW+2OdHZTZapy4A IEvol0ggktIx1N+++87ByJajNWlXwpuZEN3/l5OeCg8aNGz89puZ2gemvw86s8+r 6G1IAM4xylzxesWfvx1S7kmXqcqg9/jtL2jai8B9pXmTgogBT6BNeQxao= 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:to :from:subject:message-id:date:mime-version:content-type; s= default; bh=bA6n6a0fCE5yUHrgbVmkCr6uroQ=; b=cjYN9l5NqGgoSdUUUCHC fzAvHzF9ybAVszCWAdUHrmuLazOBXL2N8b86G3CtdHuOjzY5C9OG2jYEsENX7WFc j4GvjryYFzuWWl62LtLrn3dKDWst/SF/F5IjY5f0Bu2UEYzWjSErExvrZv2hYkre PXEGmJf/ekCyti7vIUXvDAw= Received: (qmail 29805 invoked by alias); 23 Oct 2018 22:55:09 -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 29793 invoked by uid 89); 23 Oct 2018 22:55:09 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=tester, Hx-languages-length:1540, 0x03 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 23 Oct 2018 22:55:08 +0000 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 32911308214B for ; Tue, 23 Oct 2018 22:55:07 +0000 (UTC) Received: from localhost.localdomain (ovpn-112-46.rdu2.redhat.com [10.10.112.46]) by smtp.corp.redhat.com (Postfix) with ESMTP id 99BFF10021B1 for ; Tue, 23 Oct 2018 22:55:06 +0000 (UTC) To: gcc-patches From: Jeff Law Subject: [committed] Fix minor H8 bug exposed by recent combiner changes Openpgp: preference=signencrypt Message-ID: Date: Tue, 23 Oct 2018 16:55:05 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1 MIME-Version: 1.0 X-IsSubscribed: yes This has been latent since it's H8/SX support went in like 15 years ago... The recent combiner changes twiddled the set of registers we need to save sometimes. No big deal, except for a minor bug in the H8/S H8/SX support for stm. On the H8/S (but not the SX) there are restrictions on the alignment of the set of consecutive registers to save (or restore in the case of ldm). For example, pairs have to start on an even register. The code had it backwards -- it had the H8/S with no restrictions, but restrictions on the H8/SX. This caused builds in my tester to fail to build newlib for the H8/S. Fixed thusly. Installing on the trunk. Jeff * config/h8300/h8300.c (h8300_expand_prologue): Fix stm generation for H8/S. diff --git a/gcc/config/h8300/h8300.c b/gcc/config/h8300/h8300.c index 596f2fd2cda..24b7485602f 100644 --- a/gcc/config/h8300/h8300.c +++ b/gcc/config/h8300/h8300.c @@ -865,15 +865,15 @@ h8300_expand_prologue (void) if (TARGET_H8300S) { /* See how many registers we can push at the same time. */ - if ((!TARGET_H8300SX || (regno & 3) == 0) + if ((TARGET_H8300SX || (regno & 3) == 0) && ((saved_regs >> regno) & 0x0f) == 0x0f) n_regs = 4; - else if ((!TARGET_H8300SX || (regno & 3) == 0) + else if ((TARGET_H8300SX || (regno & 3) == 0) && ((saved_regs >> regno) & 0x07) == 0x07) n_regs = 3; - else if ((!TARGET_H8300SX || (regno & 1) == 0) + else if ((TARGET_H8300SX || (regno & 1) == 0) && ((saved_regs >> regno) & 0x03) == 0x03) n_regs = 2; }