From patchwork Wed Jun 20 13:56:52 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Botcazou X-Patchwork-Id: 932274 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-480105-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=adacore.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="jAFUMnBz"; 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 419md024PKz9s2R for ; Wed, 20 Jun 2018 23:58:11 +1000 (AEST) 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=XtmGvcnpwNB5YvtQ NckaGSc4GYPWyo0ZvbBEc+8x4FaQtwc6TammuONG/G/iLUq6OmYBrHsi6sOUruwG NYn6A70XZKO2e0DzgzKCZRtjLUkFF0SWcTbBj8mQRc/8NBw8xE2MqQD8JLDW5APt vngsp/5sfINiBY1/ZDivrKlZmLM= 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=rn8oVkOfhRo55jC3peVEqQ hi8Z8=; b=jAFUMnBzur2TbnQ8NhDkru6kvxp0q9XPbQ3fiotDOq2bfLXAJcTW+g niaA3WxR+PFEbRKdapstI0r5OTxmOaoCnFImjfZVJ7ftX8tLsvDdE4Mi2D55I1Un ZlMVlunUjZnaWkl+7t5JY9FMomPX53vpxyiuVkYE4ahIkJkyTsIjY= Received: (qmail 118542 invoked by alias); 20 Jun 2018 13:58:03 -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 118532 invoked by uid 89); 20 Jun 2018 13:58:02 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-24.1 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_NUMSUBJECT, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.2 spammy=unconditionally 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, 20 Jun 2018 13:58:01 +0000 Received: from localhost (localhost [127.0.0.1]) by filtered-smtp.eu.adacore.com (Postfix) with ESMTP id D4F8C818CC for ; Wed, 20 Jun 2018 15:57:58 +0200 (CEST) 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 GWGV1fszBM7q for ; Wed, 20 Jun 2018 15:57:58 +0200 (CEST) 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 AF306815A8 for ; Wed, 20 Jun 2018 15:57:58 +0200 (CEST) From: Eric Botcazou To: gcc-patches@gcc.gnu.org Subject: [x86] Do not omit the frame pointer at -O0 Date: Wed, 20 Jun 2018 15:56:52 +0200 Message-ID: <6483947.mOsC1xWP0l@polaris> MIME-Version: 1.0 Hi, the fix for PR target/81736 unconditionally overrules -fno-omit-frame-pointer, including at -O0 where it is implicit. That seems brutal and unnecessary so the attached patch reverts it at -O0 and thus fixes 135 failures in the GDB testsuite: === gdb Summary === -# of expected passes 55397 -# of unexpected failures 359 +# of expected passes 55534 +# of unexpected failures 224 # of unexpected successes 3 # of expected failures 64 # of unknown successes 3 Tested on x86-64/Linux, OK for mainline and 8 branch? 2018-06-20 Eric Botcazou * config/i386/i386.c (ix86_finalize_stack_frame_flags): Do not overrule -fno-omit-frame-pointer when not optimizing. diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index 8a0baed5e02..d7dad81786a 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -13328,7 +13328,7 @@ ix86_finalize_stack_frame_flags (void) is used, but in the end nothing that needed the stack alignment had been spilled nor stack access, clear frame_pointer_needed and say we don't need stack realignment. */ - if ((stack_realign || !flag_omit_frame_pointer) + if ((stack_realign || (!flag_omit_frame_pointer && optimize)) && frame_pointer_needed && crtl->is_leaf && crtl->sp_is_unchanging