From patchwork Sun Jul 29 18:35:39 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Iain Buclaw X-Patchwork-Id: 950657 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-482608-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=gdcproject.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="mSIe/B5j"; 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 41drxQ4dWWz9ryl for ; Mon, 30 Jul 2018 04:35:51 +1000 (AEST) Received: (qmail 27550 invoked by alias); 29 Jul 2018 18:35:44 -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 27525 invoked by uid 89); 29 Jul 2018 18:35:43 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-25.2 required=5.0 tests=AWL, BAYES_00, FREEMAIL_FROM, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: mail-qk0-f175.google.com Received: from mail-qk0-f175.google.com (HELO mail-qk0-f175.google.com) (209.85.220.175) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sun, 29 Jul 2018 18:35:42 +0000 Received: by mail-qk0-f175.google.com with SMTP id c126-v6so6447588qkd.7 for ; Sun, 29 Jul 2018 11:35:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:from:date:message-id:subject:to:cc; bh=19c7VTgB/rdBmMVxFkYxXXJy44nvw1E/Zv9QL8p4joc=; b=mSIe/B5jxE8EAyd0CiRrLxrl30+t9guWve4koXNpiS5c2ajd3+aeN1JLX48SVV4eUp 7TysXxXCGneijS1ThrbnPg4oeX8m6TnkSq0R+WNdKiyCdq2+O++1aXUHQhugvBxfvj+s nVK7ceQ7TYKI47cLaTgRb57iT/zFJubChaSD2FZkNKPUZHdGE+NGXViEchGkwmigWKnH OP5IN5B9SN64gz7CF5k7oqhE2X7TmjwvS8Mli+8DX1Nj/kV5iCWds1CbvwYAPeEsCJxf yyMhNeFxFcNwFBGsy8JPnjtYpw2BCg6A14wq3xNeghm+yCsTV1Poe0L50cO20BQIrYoH hGvg== MIME-Version: 1.0 Sender: ibuclaw@gmail.com Received: by 2002:ac8:787:0:0:0:0:0 with HTTP; Sun, 29 Jul 2018 11:35:39 -0700 (PDT) From: Iain Buclaw Date: Sun, 29 Jul 2018 20:35:39 +0200 Message-ID: Subject: [PATCH] Move -Walloca and related warnings from c.opt to common.opt To: gcc-patches Cc: msebor@gmail.com X-IsSubscribed: yes Hi, Since r262910, it was noticed that new -Walloca-larger-than= warnings started appearing when building the D frontend's standard library. These have been checked and verified as valid, and appropriate fixes will be sent on upstream. As for the warning itself, as it is now default on, it would be preferable to be able control it. Given the choice between adding these options to the D frontend or moving them to common, I'd rather move them to common. Regards Iain. gcc/ChangeLog * common.opt (-Walloca): Moved from common.opt. (Walloca-larger-than=): Likewise. (Wno-alloca-larger-than): Likewise. gcc/c-family/ChangeLog * c.opt (-Walloca): Move to common.opt. (Walloca-larger-than=): Likewise. (Wno-alloca-larger-than): Likewise. diff --git a/gcc/c-family/c.opt b/gcc/c-family/c.opt index d6148380710..67da5a9e401 100644 --- a/gcc/c-family/c.opt +++ b/gcc/c-family/c.opt @@ -299,10 +299,6 @@ Wall C ObjC C++ ObjC++ Warning Enable most warning messages. -Walloca -C ObjC C++ ObjC++ Var(warn_alloca) Warning -Warn on any use of alloca. - Walloc-size-larger-than= C ObjC C++ LTO ObjC++ Var(warn_alloc_size_limit) Joined Host_Wide_Int ByteSize Warning Init(HOST_WIDE_INT_MAX) -Walloc-size-larger-than= Warn for calls to allocation functions that @@ -316,16 +312,6 @@ Walloc-zero C ObjC C++ ObjC++ Var(warn_alloc_zero) Warning -Walloc-zero Warn for calls to allocation functions that specify zero bytes. -Walloca-larger-than= -C ObjC C++ LTO ObjC++ Var(warn_alloca_limit) Warning Joined Host_Wide_Int ByteSize Init(HOST_WIDE_INT_MAX) --Walloca-larger-than= Warn on unbounded uses of -alloca, and on bounded uses of alloca whose bound can be larger than - bytes. - -Wno-alloca-larger-than -C ObjC C++ LTO ObjC++ Alias(Walloca-larger-than=,18446744073709551615EiB,none) Warning --Wno-alloca-larger-than Disable Walloca-larger-than= warning. Equivalent to Walloca-larger-than= or larger. - Warray-bounds LangEnabledBy(C ObjC C++ LTO ObjC++) ; in common.opt diff --git a/gcc/common.opt b/gcc/common.opt index 4bf8de90331..fa68eda4213 100644 --- a/gcc/common.opt +++ b/gcc/common.opt @@ -538,6 +538,20 @@ Waggressive-loop-optimizations Common Var(warn_aggressive_loop_optimizations) Init(1) Warning Warn if a loop with constant number of iterations triggers undefined behavior. +Walloca +Common Var(warn_alloca) Warning +Warn on any use of alloca. + +Walloca-larger-than= +Common Var(warn_alloca_limit) Warning Joined Host_Wide_Int ByteSize Init(HOST_WIDE_INT_MAX) +-Walloca-larger-than= Warn on unbounded uses of +alloca, and on bounded uses of alloca whose bound can be larger than + bytes. + +Wno-alloca-larger-than +Common Alias(Walloca-larger-than=,18446744073709551615EiB,none) Warning +-Wno-alloca-larger-than Disable Walloca-larger-than= warning. Equivalent to Walloca-larger-than= or larger. + Warray-bounds Common Var(warn_array_bounds) Warning Warn if an array is accessed out of bounds.