From patchwork Fri Apr 29 15:00:12 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nathan Froyd X-Patchwork-Id: 93436 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]) by ozlabs.org (Postfix) with SMTP id CE7BB1007D7 for ; Sat, 30 Apr 2011 01:00:44 +1000 (EST) Received: (qmail 30783 invoked by alias); 29 Apr 2011 15:00:43 -0000 Received: (qmail 30775 invoked by uid 22791); 29 Apr 2011 15:00:42 -0000 X-SWARE-Spam-Status: No, hits=-1.7 required=5.0 tests=AWL, BAYES_00, T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (38.113.113.100) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 29 Apr 2011 15:00:13 +0000 Received: (qmail 26501 invoked from network); 29 Apr 2011 15:00:12 -0000 Received: from unknown (HELO localhost) (froydnj@127.0.0.2) by mail.codesourcery.com with ESMTPA; 29 Apr 2011 15:00:12 -0000 Date: Fri, 29 Apr 2011 08:00:12 -0700 From: Nathan Froyd To: gcc-patches@gcc.gnu.org Subject: [PATCH,c++] delete TREE_NEGATED_INT Message-ID: <20110429150012.GV23480@codesourcery.com> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.17+20080114 (2008-01-14) X-IsSubscribed: yes 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 As $SUBJECT suggests. It is write-only; I'm not sure what it was ever used for. Tested on x86_64-unknonw-linux-gnu. OK to commit? -Nathan gcc/cp/ * cp-tree.h (TREE_NEGATED_INT): Delete. * semantics.c (finish_unary_op_expr): Don't try to set it. diff --git a/gcc/cp/cp-tree.h b/gcc/cp/cp-tree.h index a65998d..899959e 100644 --- a/gcc/cp/cp-tree.h +++ b/gcc/cp/cp-tree.h @@ -2937,10 +2937,6 @@ more_aggr_init_expr_args_p (const aggr_init_expr_arg_iterator *iter) #define TYPENAME_IS_RESOLVING_P(NODE) \ (TREE_LANG_FLAG_2 (TYPENAME_TYPE_CHECK (NODE))) -/* Nonzero in INTEGER_CST means that this int is negative by dint of - using a twos-complement negated operand. */ -#define TREE_NEGATED_INT(NODE) TREE_LANG_FLAG_0 (INTEGER_CST_CHECK (NODE)) - /* [class.virtual] A class that declares or inherits a virtual function is called a diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c index 815824a..99ca28b 100644 --- a/gcc/cp/semantics.c +++ b/gcc/cp/semantics.c @@ -2302,19 +2302,7 @@ tree finish_unary_op_expr (enum tree_code code, tree expr) { tree result = build_x_unary_op (code, expr, tf_warning_or_error); - /* Inside a template, build_x_unary_op does not fold the - expression. So check whether the result is folded before - setting TREE_NEGATED_INT. */ - if (code == NEGATE_EXPR && TREE_CODE (expr) == INTEGER_CST - && TREE_CODE (result) == INTEGER_CST - && !TYPE_UNSIGNED (TREE_TYPE (result)) - && INT_CST_LT (result, integer_zero_node)) - { - /* RESULT may be a cached INTEGER_CST, so we must copy it before - setting TREE_NEGATED_INT. */ - result = copy_node (result); - TREE_NEGATED_INT (result) = 1; - } + if (TREE_OVERFLOW_P (result) && !TREE_OVERFLOW_P (expr)) overflow_warning (input_location, result);