From owner-svn-src-all@FreeBSD.ORG Thu Jun 21 17:30:38 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id BC791106567D; Thu, 21 Jun 2012 17:30:38 +0000 (UTC) (envelope-from zeising@daemonic.se) Received: from mail.lysator.liu.se (mail.lysator.liu.se [IPv6:2001:6b0:17:f0a0::3]) by mx1.freebsd.org (Postfix) with ESMTP id 2A7468FC17; Thu, 21 Jun 2012 17:30:38 +0000 (UTC) Received: from mail.lysator.liu.se (localhost [127.0.0.1]) by mail.lysator.liu.se (Postfix) with ESMTP id 6051040005; Thu, 21 Jun 2012 19:30:37 +0200 (CEST) Received: by mail.lysator.liu.se (Postfix, from userid 1004) id 4FBE240007; Thu, 21 Jun 2012 19:30:37 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on bernadotte.lysator.liu.se X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=AWL autolearn=disabled version=3.3.1 X-Spam-Score: 0.0 Received: from mx.daemonic.se (mx.daemonic.se [IPv6:2001:470:dca9:0:1::3]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.lysator.liu.se (Postfix) with ESMTPSA id 90E5F40005; Thu, 21 Jun 2012 19:30:36 +0200 (CEST) Received: from mailscanner.daemonic.se (mailscanner.daemonic.se [IPv6:2001:470:dca9:0:1::6]) by mx.daemonic.se (Postfix) with ESMTPS id 3WJ90j48smz8ggx; Thu, 21 Jun 2012 19:30:29 +0200 (CEST) X-Virus-Scanned: amavisd-new at daemonic.se Received: from mx.daemonic.se ([10.1.0.3]) (using TLS with cipher CAMELLIA256-SHA) by mailscanner.daemonic.se (mailscanner.daemonic.se [10.1.0.6]) (amavisd-new, port 10025) with ESMTPS id 4xGcQtFjUFBn; Thu, 21 Jun 2012 19:30:26 +0200 (CEST) Received: from mail.daemonic.se (mail.daemonic.se [IPv6:2001:470:dca9:0:1::4]) by mx.daemonic.se (Postfix) with ESMTPS id 3WJ90f4GCmz8ggv; Thu, 21 Jun 2012 19:30:26 +0200 (CEST) Received: from tifa.daemonic.se (tifa.daemonic.se [10.32.0.6]) by mail.daemonic.se (Postfix) with ESMTPSA id 3WJ90f3gZdz9Ctq; Thu, 21 Jun 2012 19:30:26 +0200 (CEST) Received: from tifa.daemonic.se (localhost [IPv6:::1]) by tifa.daemonic.se (Postfix) with ESMTP id 5D23E22AC3; Thu, 21 Jun 2012 19:30:18 +0200 (CEST) Message-ID: <4FE35A2A.3030408@daemonic.se> Date: Thu, 21 Jun 2012 19:30:18 +0200 From: Niclas Zeising User-Agent: Mutt/1.5.21 MIME-Version: 1.0 To: "Pedro F. Giffuni" References: <201206211649.q5LGnKrn024904@svn.freebsd.org> In-Reply-To: <201206211649.q5LGnKrn024904@svn.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV using ClamSMTP Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r237406 - head/contrib/gcc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Jun 2012 17:30:38 -0000 On 06/21/12 18:49, Pedro F. Giffuni wrote: > Author: pfg > Date: Thu Jun 21 16:49:20 2012 > New Revision: 237406 > URL: http://svn.freebsd.org/changeset/base/237406 > > Log: > Bring a couple of fixes for gcc optimizations. > > The GCC4.3 branch contains some optimization fixes > that were not considered regressions and therefore > were never backported. We are bringing a couple of > them that are under GPLv2 since they were made > before the license switch upstream. > > While here, add the GCC revision numbers in the > log. > > Discussed with: jkim > MFC after: 1 week > > Modified: > head/contrib/gcc/ChangeLog.gcc43 > head/contrib/gcc/fold-const.c > head/contrib/gcc/gimplify.c > head/contrib/gcc/tree-ssa-ccp.c > head/contrib/gcc/tree-ssa-pre.c > > Modified: head/contrib/gcc/ChangeLog.gcc43 > ============================================================================== > --- head/contrib/gcc/ChangeLog.gcc43 Thu Jun 21 16:48:56 2012 (r237405) > +++ head/contrib/gcc/ChangeLog.gcc43 Thu Jun 21 16:49:20 2012 (r237406) > @@ -5,6 +5,18 @@ > with SSE3 instruction set support. > * doc/invoke.texi: Likewise. > > +2007-04-12 Richard Guenther (r123736) > + > + PR tree-optimization/24689 > + PR tree-optimization/31307 > + * fold-const.c (operand_equal_p): Compare INTEGER_CST array > + indices by value. > + * gimplify.c (canonicalize_addr_expr): To be consistent with > + gimplify_compound_lval only set operands two and three of > + ARRAY_REFs if they are not gimple_min_invariant. This makes > + it never at this place. > + * tree-ssa-ccp.c (maybe_fold_offset_to_array_ref): Likewise. > + > 2007-04-07 H.J. Lu (r123639) > > * config/i386/i386.c (ix86_handle_option): Handle SSSE3. > @@ -96,7 +108,7 @@ > > * doc/invoke.texi: Add entry about geode processor. > > -2006-10-24 Richard Guenther > +2006-10-24 Richard Guenther (r118001) > > PR middle-end/28796 > * builtins.c (fold_builtin_classify): Use HONOR_INFINITIES > @@ -170,7 +182,13 @@ > > * doc/invoke.texi: Document -mssse3/-mno-ssse3 switches. > > -2006-10-21 Richard Guenther > +2006-10-21 Richard Guenther (r117932) > + > + PR tree-optimization/3511 > + * tree-ssa-pre.c (phi_translate): Fold CALL_EXPRs that > + got new invariant arguments during PHI translation. > + > +2006-10-21 Richard Guenther (r117929) > > * builtins.c (fold_builtin_classify): Fix typo. > > > Modified: head/contrib/gcc/fold-const.c > ============================================================================== > --- head/contrib/gcc/fold-const.c Thu Jun 21 16:48:56 2012 (r237405) > +++ head/contrib/gcc/fold-const.c Thu Jun 21 16:49:20 2012 (r237406) > @@ -2802,9 +2802,13 @@ operand_equal_p (tree arg0, tree arg1, u > > case ARRAY_REF: > case ARRAY_RANGE_REF: > - /* Operands 2 and 3 may be null. */ > + /* Operands 2 and 3 may be null. > + Compare the array index by value if it is constant first as we > + may have different types but same value here. */ > return (OP_SAME (0) > - && OP_SAME (1) > + && (tree_int_cst_equal (TREE_OPERAND (arg0, 1), > + TREE_OPERAND (arg1, 1)) > + || OP_SAME (1)) > && OP_SAME_WITH_NULL (2) > && OP_SAME_WITH_NULL (3)); > > > Modified: head/contrib/gcc/gimplify.c > ============================================================================== > --- head/contrib/gcc/gimplify.c Thu Jun 21 16:48:56 2012 (r237405) > +++ head/contrib/gcc/gimplify.c Thu Jun 21 16:49:20 2012 (r237406) > @@ -1600,9 +1600,7 @@ canonicalize_addr_expr (tree *expr_p) > /* All checks succeeded. Build a new node to merge the cast. */ > *expr_p = build4 (ARRAY_REF, dctype, obj_expr, > TYPE_MIN_VALUE (TYPE_DOMAIN (datype)), > - TYPE_MIN_VALUE (TYPE_DOMAIN (datype)), > - size_binop (EXACT_DIV_EXPR, TYPE_SIZE_UNIT (dctype), > - size_int (TYPE_ALIGN_UNIT (dctype)))); > + NULL_TREE, NULL_TREE); > *expr_p = build1 (ADDR_EXPR, ctype, *expr_p); > } > > > Modified: head/contrib/gcc/tree-ssa-ccp.c > ============================================================================== > --- head/contrib/gcc/tree-ssa-ccp.c Thu Jun 21 16:48:56 2012 (r237405) > +++ head/contrib/gcc/tree-ssa-ccp.c Thu Jun 21 16:49:20 2012 (r237406) > @@ -1621,9 +1621,7 @@ maybe_fold_offset_to_array_ref (tree bas > if (!integer_zerop (elt_offset)) > idx = int_const_binop (PLUS_EXPR, idx, elt_offset, 0); > > - return build4 (ARRAY_REF, orig_type, base, idx, min_idx, > - size_int (tree_low_cst (elt_size, 1) > - / (TYPE_ALIGN_UNIT (elt_type)))); > + return build4 (ARRAY_REF, orig_type, base, idx, NULL_TREE, NULL_TREE); > } > > > > Modified: head/contrib/gcc/tree-ssa-pre.c > ============================================================================== > --- head/contrib/gcc/tree-ssa-pre.c Thu Jun 21 16:48:56 2012 (r237405) > +++ head/contrib/gcc/tree-ssa-pre.c Thu Jun 21 16:49:20 2012 (r237406) > @@ -1076,6 +1076,7 @@ phi_translate (tree expr, value_set_t se > tree newexpr; > tree vh = get_value_handle (expr); > bool listchanged = false; > + bool invariantarg = false; > VEC (tree, gc) *vuses = VALUE_HANDLE_VUSES (vh); > VEC (tree, gc) *tvuses; > > @@ -1134,10 +1135,26 @@ phi_translate (tree expr, value_set_t se > if (newval != oldval) > { > listchanged = true; > + invariantarg |= is_gimple_min_invariant (newval); > TREE_VALUE (newwalker) = get_value_handle (newval); > } > } > } > + > + /* In case of new invariant args we might try to fold the call > + again. */ > + if (invariantarg) > + { > + tree tmp = fold_ternary (CALL_EXPR, TREE_TYPE (expr), > + newop0, newarglist, newop2); > + if (tmp) > + { > + STRIP_TYPE_NOPS (tmp); > + if (is_gimple_min_invariant (tmp)) > + return tmp; > + } > + } > + > if (listchanged) > vn_lookup_or_add (newarglist, NULL); > Could this fix the issues with mozilla ports not compiling on -O2? I will test later, but I'm just checking if you have any insight... Regards! -- Niclas Zeising