From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31956 invoked by alias); 12 Apr 2012 16:50:42 -0000 Received: (qmail 31941 invoked by uid 22791); 12 Apr 2012 16:50:40 -0000 X-SWARE-Spam-Status: No, hits=-4.9 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,KHOP_RCVD_TRUST,KHOP_THREADED,RCVD_IN_DNSWL_LOW,RCVD_IN_HOSTKARMA_YE X-Spam-Check-By: sourceware.org Received: from mail-qc0-f175.google.com (HELO mail-qc0-f175.google.com) (209.85.216.175) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 12 Apr 2012 16:50:26 +0000 Received: by qcso7 with SMTP id o7so1393648qcs.20 for ; Thu, 12 Apr 2012 09:50:25 -0700 (PDT) MIME-Version: 1.0 Received: by 10.224.1.68 with SMTP id 4mr5081199qae.6.1334249425356; Thu, 12 Apr 2012 09:50:25 -0700 (PDT) Received: by 10.229.136.69 with HTTP; Thu, 12 Apr 2012 09:50:25 -0700 (PDT) In-Reply-To: <1333633759.19102.46.camel@gnopaine> References: <1331066954.17488.7.camel@gnopaine> <1333484715.19102.22.camel@gnopaine> <1333542912.19102.27.camel@gnopaine> <1333566953.4145.2.camel@oc2474580526.ibm.com> <1333633759.19102.46.camel@gnopaine> Date: Thu, 12 Apr 2012 16:50:00 -0000 Message-ID: Subject: Re: [PATCH] Fix PR18589 From: "H.J. Lu" To: "William J. Schmidt" Cc: Richard Guenther , gcc-patches@gcc.gnu.org, bergner@vnet.ibm.com Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org X-SW-Source: 2012-04/txt/msg00783.txt.bz2 On Thu, Apr 5, 2012 at 6:49 AM, William J. Schmidt wrote: > On Thu, 2012-04-05 at 11:23 +0200, Richard Guenther wrote: >> On Wed, Apr 4, 2012 at 9:15 PM, William J. Schmidt >> wrote: >> > >> > Unfortunately this seems to be necessary if I name the two passes >> > "reassoc1" and "reassoc2". =A0If I try to name both of them "reassoc" I >> > get failures in other tests like gfortran.dg/reassoc_4, where >> > -fdump-tree-reassoc1 doesn't work. =A0Unless I'm missing something >> > obvious, I think I need to keep that change. >> >> Hm, naming them "reassoc1" and "reassoc2" is a hack. =A0Naming both >> "reassoc" will not trigger re-naming them to reassoc1 and reassoc2 >> I think. =A0How ugly. =A0Especially that -fdump-tree-reassoc will no lon= ger >> work. =A0Maybe instead of using two pass structs resort to using >> the existing hack with using first_pass_instance and TODO_mark_first_ins= tance. > > OK, that seems to be the best among evils. =A0Using the > first_pass_instance hack, the patch is transformed as below. > Regstrapped on powerpc64-linux, no additional failures. =A0OK for trunk? > > Thanks, > Bill > > > gcc: > > 2012-04-05 =A0Bill Schmidt =A0 > > =A0 =A0 =A0 =A0PR tree-optimization/18589 > =A0 =A0 =A0 =A0* tree-ssa-reassoc.c (reassociate_stats): Add two fields. > =A0 =A0 =A0 =A0(operand_entry): Add count field. > =A0 =A0 =A0 =A0(add_repeat_to_ops_vec): New function. > =A0 =A0 =A0 =A0(completely_remove_stmt): Likewise. > =A0 =A0 =A0 =A0(remove_def_if_absorbed_call): Likewise. > =A0 =A0 =A0 =A0(remove_visited_stmt_chain): Remove feeding builtin pow/po= wi calls. > =A0 =A0 =A0 =A0(acceptable_pow_call): New function. > =A0 =A0 =A0 =A0(linearize_expr_tree): Look for builtin pow/powi calls and= add operand > =A0 =A0 =A0 =A0entries with repeat counts when found. > =A0 =A0 =A0 =A0(repeat_factor_d): New struct and associated typedefs. > =A0 =A0 =A0 =A0(repeat_factor_vec): New static vector variable. > =A0 =A0 =A0 =A0(compare_repeat_factors): New function. > =A0 =A0 =A0 =A0(get_reassoc_pow_ssa_name): Likewise. > =A0 =A0 =A0 =A0(attempt_builtin_powi): Likewise. > =A0 =A0 =A0 =A0(reassociate_bb): Call attempt_builtin_powi. > =A0 =A0 =A0 =A0(fini_reassoc): Two new calls to statistics_counter_event. > It breaks bootstrap on Linux/ia32: ../../src-trunk/gcc/tree-ssa-reassoc.c: In function 'void attempt_builtin_powi(gimple, VEC_operand_entry_t_heap**, tree_node**)': ../../src-trunk/gcc/tree-ssa-reassoc.c:3189:41: error: format '%ld' expects argument of type 'long int', but argument 3 has type 'long long int' [-Werror=3Dformat] fprintf (dump_file, ")^%ld\n", power); ^ ../../src-trunk/gcc/tree-ssa-reassoc.c:3222:44: error: format '%ld' expects argument of type 'long int', but argument 3 has type 'long long int' [-Werror=3Dformat] fprintf (dump_file, ")^%ld\n", power); ^ cc1plus: all warnings being treated as errors H.J.