From patchwork Wed Feb 1 11:43:13 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Botcazou X-Patchwork-Id: 722454 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org 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 3vD1V50mKJz9snk for ; Wed, 1 Feb 2017 22:43:24 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="PHc/7OXi"; dkim-atps=neutral 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:cc:subject:date:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; q=dns; s= default; b=d6lFeuJyVJ+IFFSh7nNUymmLPMu7V57a1vVhnO87qgxB0baYQozgu 0zF6onogifxxOrCV94xYb26bujZWeDXJkh7tF0sTMBtZm3ph5aOMKBBOyz0tM7B3 dq5E2OVG7LZzjcXb/b7YbKzFbRgvqZXKAzf1ZqCOB2U6044HxgzAec= 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:cc:subject:date:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; s=default; bh=1NaJLPOwjiN8DSdIrnweAomH/Po=; b=PHc/7OXixYzJGSP4qjZGrXfplDSf 8zCWNMB02DzFm9Ed/6Gy2DgH/u3GYyQSEipgvvz+mJlSIPhv6hp6eRYXEU0h56Yu JMKvKDIpWYEW5bDh0/kjrQN9mAnZh+ZKsTqMfMetIEssmtB6u1HJpxSdKnoxaqWr d6B7zcn7kF4ZgEo= Received: (qmail 102242 invoked by alias); 1 Feb 2017 11:43:18 -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 102226 invoked by uid 89); 1 Feb 2017 11:43:17 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.1 required=5.0 tests=AWL, BAYES_00, KAM_ASCII_DIVIDERS, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=no version=3.3.2 spammy=sk:hard_fr X-HELO: smtp.eu.adacore.com Received: from mel.act-europe.fr (HELO smtp.eu.adacore.com) (194.98.77.210) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 01 Feb 2017 11:43:16 +0000 Received: from localhost (localhost [127.0.0.1]) by filtered-smtp.eu.adacore.com (Postfix) with ESMTP id F117782077; Wed, 1 Feb 2017 12:43:13 +0100 (CET) Received: from smtp.eu.adacore.com ([127.0.0.1]) by localhost (smtp.eu.adacore.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ZrZAxq3k40-0; Wed, 1 Feb 2017 12:43:13 +0100 (CET) Received: from polaris.localnet (bon31-6-88-161-99-133.fbx.proxad.net [88.161.99.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.eu.adacore.com (Postfix) with ESMTPSA id CAD7381DEE; Wed, 1 Feb 2017 12:43:13 +0100 (CET) From: Eric Botcazou To: Bernd Schmidt Cc: gcc-patches@gcc.gnu.org Subject: Re: [patch] Fix PR middle-end/78468 Date: Wed, 01 Feb 2017 12:43:13 +0100 Message-ID: <1909701.JNdQ3ADYu6@polaris> User-Agent: KMail/4.14.10 (Linux/3.16.7-53-desktop; KDE/4.14.9; x86_64; ; ) In-Reply-To: <71f74918-538f-ac0d-91e7-5eb796449e5a@redhat.com> References: <2127372.YidMXMCpNE@polaris> <71f74918-538f-ac0d-91e7-5eb796449e5a@redhat.com> MIME-Version: 1.0 > I'd say let's not have a middle ground - this stuff is sufficiently > brain-twisting that I'd rather go back to a known working state. If > there was an error in the previous patch, let's roll it back until we > fully understand the situation. Here's a revised version along these lines, OK for mainline after testing? PR middle-end/78468 * emit-rtl.c (init_emit): Add ??? comment for problematic alignment settings of the virtual registers. Revert again 2016-08-23 Dominik Vogt * explow.c (get_dynamic_stack_size): Take known alignment of stack pointer + STACK_DYNAMIC_OFFSET into account when calculating the size needed. Index: emit-rtl.c =================================================================== --- emit-rtl.c (revision 244917) +++ emit-rtl.c (working copy) @@ -5725,10 +5725,13 @@ init_emit (void) REGNO_POINTER_ALIGN (HARD_FRAME_POINTER_REGNUM) = STACK_BOUNDARY; REGNO_POINTER_ALIGN (ARG_POINTER_REGNUM) = STACK_BOUNDARY; + /* ??? These are problematic (for example, 3 out of 4 are wrong on + 32-bit SPARC and cannot be all fixed because of the ABI). */ REGNO_POINTER_ALIGN (VIRTUAL_INCOMING_ARGS_REGNUM) = STACK_BOUNDARY; REGNO_POINTER_ALIGN (VIRTUAL_STACK_VARS_REGNUM) = STACK_BOUNDARY; REGNO_POINTER_ALIGN (VIRTUAL_STACK_DYNAMIC_REGNUM) = STACK_BOUNDARY; REGNO_POINTER_ALIGN (VIRTUAL_OUTGOING_ARGS_REGNUM) = STACK_BOUNDARY; + REGNO_POINTER_ALIGN (VIRTUAL_CFA_REGNUM) = BITS_PER_WORD; #endif Index: explow.c =================================================================== --- explow.c (revision 244917) +++ explow.c (working copy) @@ -1233,15 +1233,9 @@ get_dynamic_stack_size (rtx *psize, unsi example), so we must preventively align the value. We leave space in SIZE for the hole that might result from the alignment operation. */ - unsigned known_align = REGNO_POINTER_ALIGN (VIRTUAL_STACK_DYNAMIC_REGNUM); - if (known_align == 0) - known_align = BITS_PER_UNIT; - if (required_align > known_align) - { - extra = (required_align - known_align) / BITS_PER_UNIT; - size = plus_constant (Pmode, size, extra); - size = force_operand (size, NULL_RTX); - } + extra = (required_align - BITS_PER_UNIT) / BITS_PER_UNIT; + size = plus_constant (Pmode, size, extra); + size = force_operand (size, NULL_RTX); if (flag_stack_usage_info && pstack_usage_size) *pstack_usage_size += extra;