From owner-svn-src-head@FreeBSD.ORG Fri Jul 1 20:45:56 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5ECC7106566C; Fri, 1 Jul 2011 20:45:56 +0000 (UTC) (envelope-from uqs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 43D888FC08; Fri, 1 Jul 2011 20:45:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p61Kjuo4005989; Fri, 1 Jul 2011 20:45:56 GMT (envelope-from uqs@svn.freebsd.org) Received: (from uqs@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p61Kju11005984; Fri, 1 Jul 2011 20:45:56 GMT (envelope-from uqs@svn.freebsd.org) Message-Id: <201107012045.p61Kju11005984@svn.freebsd.org> From: Ulrich Spoerlein Date: Fri, 1 Jul 2011 20:45:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r223715 - head/contrib/gcc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Jul 2011 20:45:56 -0000 Author: uqs Date: Fri Jul 1 20:45:55 2011 New Revision: 223715 URL: http://svn.freebsd.org/changeset/base/223715 Log: - Fix typo in check_for_nested_with_variably_modified present - Implement -Wvariable-decl. - Port -Wtrampolines support from gcc3. (all three also via OpenBSD) PR: gnu/127136, gnu/157019 Submitted by: Henning Petersen, Pedro Giffuni MFC after: 6 weeks Modified: head/contrib/gcc/c-decl.c head/contrib/gcc/c.opt head/contrib/gcc/common.opt head/contrib/gcc/tree-nested.c Modified: head/contrib/gcc/c-decl.c ============================================================================== --- head/contrib/gcc/c-decl.c Fri Jul 1 19:23:25 2011 (r223714) +++ head/contrib/gcc/c-decl.c Fri Jul 1 20:45:55 2011 (r223715) @@ -4340,6 +4340,8 @@ grokdeclarator (const struct c_declarato pedwarn ("ISO C90 forbids variable-size array %qs", name); } + if (warn_variable_decl) + warning (0, "variable-sized array %qs", name); } if (integer_zerop (size)) Modified: head/contrib/gcc/c.opt ============================================================================== --- head/contrib/gcc/c.opt Fri Jul 1 19:23:25 2011 (r223714) +++ head/contrib/gcc/c.opt Fri Jul 1 20:45:55 2011 (r223715) @@ -404,6 +404,10 @@ Wtraditional C ObjC Var(warn_traditional) Warn about features not present in traditional C +Wtrampolines +Common Var(warn_trampolines) +Warn when trampolines are emitted + Wtrigraphs C ObjC C++ ObjC++ Warn if trigraphs are encountered that might affect the meaning of the program Modified: head/contrib/gcc/common.opt ============================================================================== --- head/contrib/gcc/common.opt Fri Jul 1 19:23:25 2011 (r223714) +++ head/contrib/gcc/common.opt Fri Jul 1 20:45:55 2011 (r223715) @@ -189,6 +189,10 @@ Wunused-variable Common Var(warn_unused_variable) Warn when a variable is unused +Wvariable-decl +Common Var(warn_variable_decl) +Warn about variable-sized declarations. + Wvolatile-register-var Common Var(warn_register_var) Warn when a register variable is declared volatile Modified: head/contrib/gcc/tree-nested.c ============================================================================== --- head/contrib/gcc/tree-nested.c Fri Jul 1 19:23:25 2011 (r223714) +++ head/contrib/gcc/tree-nested.c Fri Jul 1 20:45:55 2011 (r223715) @@ -750,7 +750,7 @@ check_for_nested_with_variably_modified for (cgn = cgn->nested; cgn ; cgn = cgn->next_nested) { for (arg = DECL_ARGUMENTS (cgn->decl); arg; arg = TREE_CHAIN (arg)) - if (variably_modified_type_p (TREE_TYPE (arg), 0), orig_fndecl) + if (variably_modified_type_p (TREE_TYPE (arg), orig_fndecl)) return true; if (check_for_nested_with_variably_modified (cgn->decl, orig_fndecl)) @@ -1621,6 +1621,10 @@ convert_tramp_reference (tree *tp, int * it doesn't need a trampoline. */ if (DECL_NO_STATIC_CHAIN (decl)) break; + if (warn_trampolines) + { + warning(0, "local function address taken needing trampoline generation"); + } /* Lookup the immediate parent of the callee, as that's where we need to insert the trampoline. */