From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 106508 invoked by alias); 12 Nov 2015 11:55:46 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 106499 invoked by uid 89); 12 Nov 2015 11:55:46 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.7 required=5.0 tests=AWL,BAYES_00,KAM_LAZY_DOMAIN_SECURITY,RCVD_IN_DNSWL_LOW autolearn=no version=3.3.2 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 (AES256-GCM-SHA384 encrypted) ESMTPS; Thu, 12 Nov 2015 11:55:45 +0000 Received: from localhost (localhost [127.0.0.1]) by filtered-smtp.eu.adacore.com (Postfix) with ESMTP id 6E2C0330CE0F; Thu, 12 Nov 2015 12:55:42 +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 8FS5uJzJ63ZM; Thu, 12 Nov 2015 12:55:42 +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 440B1330CDFC; Thu, 12 Nov 2015 12:55:42 +0100 (CET) From: Eric Botcazou To: Bernd Schmidt Cc: gcc-patches@gcc.gnu.org Subject: Re: [patch] Fix PR target/67265 Date: Thu, 12 Nov 2015 11:55:00 -0000 Message-ID: <2846170.Qq7a3i2rle@polaris> User-Agent: KMail/4.14.9 (Linux/3.16.7-29-desktop; KDE/4.14.9; x86_64; ; ) In-Reply-To: <56433630.8090804@redhat.com> References: <1775738.N5UXceF4Z6@polaris> <9047439.tY6cSNOYhm@polaris> <56433630.8090804@redhat.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="nextPart2524173.I9vFyyo8vR" Content-Transfer-Encoding: 7Bit X-SW-Source: 2015-11/txt/msg01499.txt.bz2 This is a multi-part message in MIME format. --nextPart2524173.I9vFyyo8vR Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Content-length: 1549 > Ok if it passes testing. Thanks, it did so I installed the fix yesterday but further testing then revealed an oversight: the following assertion in ix86_adjust_stack_and_probe gcc_assert (cfun->machine->fs.cfa_reg != stack_pointer_rtx); will now evidently trigger (simple testcase attached). I can sched some light on it here since I wrote the code: the initial version of ix86_adjust_stack_and_probe didn't bother generating CFI because it only manipulates the stack pointer and the CFA register was guaranteed to be the frame pointer until yesterday, so I put the assertion to check this guarantee. Then Richard H. enhanced the CFI machinery to always track stack adjustments (IIRC this was a prerequisite for your implementation of shrink-wrapping) so I added code to generate CFI: /* Even if the stack pointer isn't the CFA register, we need to correctly describe the adjustments made to it, in particular differentiate the frame-related ones from the frame-unrelated ones. */ if (size > 0) To sum up, I think that the assertion is obsolete and can be removed without further ado; once done, the compiler generates correct CFI for the testcase. So I installed the following one-liner as obvious after testing on x86-64. 2015-11-12 Eric Botcazou PR target/67265 * config/i386/i386.c (ix86_adjust_stack_and_probe): Remove obsolete assertion on the CFA register. 2015-11-12 Eric Botcazou * gcc.target/i386/pr67265-2.c: New test. -- Eric Botcazou --nextPart2524173.I9vFyyo8vR Content-Disposition: attachment; filename="pr67265-2b.diff" Content-Transfer-Encoding: 7Bit Content-Type: text/x-patch; charset="utf-8"; name="pr67265-2b.diff" Content-length: 573 Index: config/i386/i386.c =================================================================== --- config/i386/i386.c (revision 230204) +++ config/i386/i386.c (working copy) @@ -12245,8 +12245,6 @@ ix86_adjust_stack_and_probe (const HOST_ release_scratch_register_on_entry (&sr); } - gcc_assert (cfun->machine->fs.cfa_reg != stack_pointer_rtx); - /* Even if the stack pointer isn't the CFA register, we need to correctly describe the adjustments made to it, in particular differentiate the frame-related ones from the frame-unrelated ones. */ --nextPart2524173.I9vFyyo8vR Content-Disposition: attachment; filename="pr67265-2.c" Content-Transfer-Encoding: 7Bit Content-Type: text/x-csrc; charset="UTF-8"; name="pr67265-2.c" Content-length: 133 /* { dg-do compile } */ /* { dg-options "-O -fstack-check" } */ void foo (int n) { volatile char arr[64 * 1024]; arr[n] = 1; } --nextPart2524173.I9vFyyo8vR--