From patchwork Wed Dec 1 20:16:21 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Jambor X-Patchwork-Id: 73902 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 58E82B6EF2 for ; Thu, 2 Dec 2010 07:22:56 +1100 (EST) Received: (qmail 19968 invoked by alias); 1 Dec 2010 20:22:49 -0000 Received: (qmail 19951 invoked by uid 22791); 1 Dec 2010 20:22:48 -0000 X-SWARE-Spam-Status: No, hits=-6.2 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_HI X-Spam-Check-By: sourceware.org Received: from cantor.suse.de (HELO mx1.suse.de) (195.135.220.2) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 01 Dec 2010 20:22:43 +0000 Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.221.2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.suse.de (Postfix) with ESMTP id 23B7B966E9 for ; Wed, 1 Dec 2010 21:22:41 +0100 (CET) Resent-From: Martin Jambor Resent-Date: Wed, 1 Dec 2010 21:22:40 +0100 Resent-Message-ID: <20101201202240.GD18215@virgil.arch.suse.de> Resent-To: GCC Patches Message-Id: <20101201201711.029187216@virgil.suse.cz> User-Agent: quilt/0.48-4.4 Date: Wed, 01 Dec 2010 21:16:21 +0100 From: Martin Jambor To: GCC Patches Cc: Richard Guenther , Jan Hubicka Subject: [PATCH, PR 45934 3/6] More robust compute_complex_ancestor_jump_func References: <20101201201618.861802217@virgil.suse.cz> Content-Disposition: inline; filename=complex_assign_improvement.diff 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 Hi, compute_complex_ancestor_jump_func tries to match a pattern like this: if (obj_2(D) != 0B) goto ; else goto ; : iftmp.1_3 = &obj_2(D)->D.1762; : # iftmp.1_1 = PHI D.1879_6 = middleman_1 (iftmp.1_1, i_5(D)); return D.1879_6; */ At some point while working at the devirtualization issues I have seen this failing because the zero was the zeroth parameter in the phi node. I think it is necessary for some of the new testcases to work but I am not really sure any more, I only remembered when I was splitting the big patch into separate ones. I did not bootstrap this patch separately but it did pas bootstrap and testsuite on x86_64-linux and make check-c++ on i686 together with the rest. Thanks, Martin 2010-11-30 Martin Jambor * ipa-prop.c (compute_complex_ancestor_jump_func): Work also if the zero is the first phi parameter. Index: icln/gcc/ipa-prop.c =================================================================== --- icln.orig/gcc/ipa-prop.c +++ icln/gcc/ipa-prop.c @@ -461,11 +461,15 @@ compute_complex_ancestor_jump_func (stru tree tmp, parm, expr; int index, i; - if (gimple_phi_num_args (phi) != 2 - || !integer_zerop (PHI_ARG_DEF (phi, 1))) + if (gimple_phi_num_args (phi) != 2) return; - tmp = PHI_ARG_DEF (phi, 0); + if (integer_zerop (PHI_ARG_DEF (phi, 1))) + tmp = PHI_ARG_DEF (phi, 0); + else if (integer_zerop (PHI_ARG_DEF (phi, 0))) + tmp = PHI_ARG_DEF (phi, 1); + else + return; if (TREE_CODE (tmp) != SSA_NAME || SSA_NAME_IS_DEFAULT_DEF (tmp) || !POINTER_TYPE_P (TREE_TYPE (tmp))