From patchwork Mon May 16 08:40:53 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Botcazou X-Patchwork-Id: 622505 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 3r7YpX1Ww8z9syq for ; Mon, 16 May 2016 18:41:23 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=qitxBXwW; 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:subject:date:message-id:mime-version:content-type :content-transfer-encoding; q=dns; s=default; b=IycJAjpYJoYHb9Ki fw7KWDjkYpfQuBPxyW9wdVjXhxIsukztb89SvT4MPSoL29l1WHisZHWa09G11LeA 7eng+uGyQa8OmIXPQj1I9VkR7tuMayruSd7dnVfadAJrEQLuh+B4yyOIidAHnb4q lsm1P8aUCRNVh2fNocdKCH1J8bM= 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=hALSdY030pmwdJ6h6CojXn tH5+I=; b=qitxBXwWPC81PDFHLH1Bomb1s3VA4TKA0z0O0TeKEyliaM+mpIuCZ2 VHbcI2vp8jZ05zbr61BP+RUfjE/X+IIgSW3HPwOzA5aRPoXjVdJ4FTYpBkPTYkDF mu/MlB8JrwjsMoB3AYLonQ+Br+SXF4llJgoazgBcWkWAyGpUiDRN4= Received: (qmail 1674 invoked by alias); 16 May 2016 08:41:07 -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 1622 invoked by uid 89); 16 May 2016 08:41:06 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.5 required=5.0 tests=AWL, BAYES_00, KAM_LAZY_DOMAIN_SECURITY, RCVD_IN_DNSWL_NONE autolearn=no version=3.3.2 spammy=Hx-languages-length:1224, U*ebotcazou, ebotcazouadacorecom, sk:ebotcaz 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; Mon, 16 May 2016 08:40:56 +0000 Received: from localhost (localhost [127.0.0.1]) by filtered-smtp.eu.adacore.com (Postfix) with ESMTP id 02A11812E9 for ; Mon, 16 May 2016 10:40:54 +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 hUUjvCDWadeP for ; Mon, 16 May 2016 10:40:53 +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 D01F8812DB for ; Mon, 16 May 2016 10:40:53 +0200 (CEST) From: Eric Botcazou To: gcc-patches@gcc.gnu.org Subject: [ARM] Fix bogus -fstack-usage warning on naked functions Date: Mon, 16 May 2016 10:40:53 +0200 Message-ID: <1484861.cdItfTZVga@polaris> User-Agent: KMail/4.14.10 (Linux/3.16.7-35-desktop; KDE/4.14.9; x86_64; ; ) MIME-Version: 1.0 Hi, -fstack-usage issues the "not supported by this target" warning on naked functions because the prologue routines do an early return for them. Tested on arm-eabi, may I apply it on all active branches? 2016-05-16 Eric Botcazou * config/arm/arm.c (arm_expand_prologue): Set the stack usage to 0 for naked functions. (thumb1_expand_prologue): Likewise. Index: config/arm/arm.c =================================================================== --- config/arm/arm.c (revision 236264) +++ config/arm/arm.c (working copy) @@ -21467,7 +21467,11 @@ arm_expand_prologue (void) /* Naked functions don't have prologues. */ if (IS_NAKED (func_type)) - return; + { + if (flag_stack_usage_info) + current_function_static_stack_size = 0; + return; + } /* Make a copy of c_f_p_a_s as we may need to modify it locally. */ args_to_push = crtl->args.pretend_args_size; @@ -24721,7 +24725,11 @@ thumb1_expand_prologue (void) /* Naked functions don't have prologues. */ if (IS_NAKED (func_type)) - return; + { + if (flag_stack_usage_info) + current_function_static_stack_size = 0; + return; + } if (IS_INTERRUPT (func_type)) {