From patchwork Tue Jun 18 14:12:42 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Biener X-Patchwork-Id: 252352 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]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "localhost", Issuer "www.qmailtoaster.com" (not verified)) by ozlabs.org (Postfix) with ESMTPS id 099432C0079 for ; Wed, 19 Jun 2013 00:12:55 +1000 (EST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:subject:message-id:mime-version:content-type; q=dns; s= default; b=UdJbmnmWjUZ8d3gcTETIGFoD4gKye1nUG+SGfvg3bioH067QEEqT4 3iXR2anchbYOsz2E/KCBI/DaxJ4RJmuxHix2rq3xm9TH2tl9BDugQkOjj115v/jx nCgZIL69J4CowEWROfrOspwjhSKDm23DykQzoJx2+PgqQtR9khGenw= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:subject:message-id:mime-version:content-type; s= default; bh=9aHnDS8fBKd+qiJrYKpZ6XJrWuQ=; b=B9m4SwdlcBsg96Ey27AE fNke2IGV+9M6uE9AMTwV8yYyV87wPliq1RH8qayUbconvoyd3wujYKeeHepaXxh5 sKlYOAtkjRMUXU66dTJl63izDGIWrllNsiaIKNoeBfAWcR4d7nTz/S1/SIJ0ndvW FAEK1/Mc6jOnIIKECfxE42A= Received: (qmail 19742 invoked by alias); 18 Jun 2013 14:12:48 -0000 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 Received: (qmail 19708 invoked by uid 89); 18 Jun 2013 14:12:45 -0000 X-Spam-SWARE-Status: No, score=-5.6 required=5.0 tests=AWL, BAYES_00, KHOP_RCVD_UNTRUST, RCVD_IN_HOSTKARMA_W, RCVD_IN_HOSTKARMA_WL, RP_MATCHES_RCVD, TW_CF, TW_TM autolearn=ham version=3.3.1 Received: from cantor2.suse.de (HELO mx2.suse.de) (195.135.220.15) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Tue, 18 Jun 2013 14:12:44 +0000 Received: from relay1.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 6BA8BA51FE for ; Tue, 18 Jun 2013 16:12:42 +0200 (CEST) Date: Tue, 18 Jun 2013 16:12:42 +0200 (CEST) From: Richard Biener To: gcc-patches@gcc.gnu.org Subject: [PATCH] Fix mv?.C ICEs Message-ID: User-Agent: Alpine 2.00 (LNX 1167 2008-08-23) MIME-Version: 1.0 This fixes the mv?.C ICEs in the testsuite (and transforms a subset of them to execute fails for me). Running target unix/ FAIL: g++.dg/ext/mv12.C -std=gnu++98 execution test FAIL: g++.dg/ext/mv12.C -std=gnu++11 execution test FAIL: g++.dg/ext/mv2.C -std=gnu++98 execution test FAIL: g++.dg/ext/mv2.C -std=gnu++11 execution test FAIL: g++.dg/ext/mv5.C -std=gnu++98 execution test FAIL: g++.dg/ext/mv5.C -std=gnu++11 execution test Bootstrapped and tested on x86_64-unknown-linux-gnu, applied to trunk. Richard. 2013-06-18 Richard Biener * Makefile.in (cgraphunit.o): Add $(CFGLOOP_H) dependency. * cgraphunit.c: Include cfgloop.h. (init_lowered_empty_function): Initialize the loop tree. (assemble_thunk): Insert new BBs into loops. Index: gcc/Makefile.in =================================================================== --- gcc/Makefile.in (revision 200164) +++ gcc/Makefile.in (working copy) @@ -2903,7 +2903,7 @@ cgraphunit.o : cgraphunit.c $(CONFIG_H) $(TREE_FLOW_H) $(TREE_PASS_H) debug.h $(DIAGNOSTIC_H) \ $(FIBHEAP_H) output.h $(PARAMS_H) $(RTL_H) $(IPA_PROP_H) \ gt-cgraphunit.h tree-iterator.h $(COVERAGE_H) $(TREE_DUMP_H) \ - $(GIMPLE_PRETTY_PRINT_H) $(IPA_INLINE_H) $(IPA_UTILS_H) \ + $(GIMPLE_PRETTY_PRINT_H) $(IPA_INLINE_H) $(IPA_UTILS_H) $(CFGLOOP_H) \ $(LTO_STREAMER_H) output.h $(REGSET_H) $(EXCEPT_H) $(GCC_PLUGIN_H) plugin.h cgraphclones.o : cgraphclones.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ $(TREE_H) langhooks.h $(TREE_INLINE_H) toplev.h $(DIAGNOSTIC_CORE_H) $(FLAGS_H) $(GGC_H) \ Index: gcc/cgraphunit.c =================================================================== --- gcc/cgraphunit.c (revision 200164) +++ gcc/cgraphunit.c (working copy) @@ -192,6 +192,7 @@ along with GCC; see the file COPYING3. #include "ipa-utils.h" #include "lto-streamer.h" #include "except.h" +#include "cfgloop.h" #include "regset.h" /* FIXME: For reg_obstack. */ /* Queue of cgraph nodes scheduled to be added into cgraph. This is a @@ -1196,18 +1197,24 @@ init_lowered_empty_function (tree decl, init_tree_ssa (cfun); init_ssa_operands (cfun); cfun->gimple_df->in_ssa_p = true; + cfun->curr_properties |= PROP_ssa; } DECL_INITIAL (decl) = make_node (BLOCK); DECL_SAVED_TREE (decl) = error_mark_node; - cfun->curr_properties |= - (PROP_gimple_lcf | PROP_gimple_leh | PROP_cfg | PROP_ssa | PROP_gimple_any); + cfun->curr_properties |= (PROP_gimple_lcf | PROP_gimple_leh | PROP_gimple_any + | PROP_cfg | PROP_loops); + + set_loops_for_fn (cfun, ggc_alloc_cleared_loops ()); + init_loops_structure (cfun, loops_for_fn (cfun), 1); + loops_for_fn (cfun)->state |= LOOPS_MAY_HAVE_MULTIPLE_LATCHES; /* Create BB for body of the function and connect it properly. */ bb = create_basic_block (NULL, (void *) 0, ENTRY_BLOCK_PTR); - make_edge (ENTRY_BLOCK_PTR, bb, 0); + make_edge (ENTRY_BLOCK_PTR, bb, EDGE_FALLTHRU); make_edge (bb, EXIT_BLOCK_PTR, 0); + add_bb_to_loop (bb, ENTRY_BLOCK_PTR->loop_father); return bb; } @@ -1452,6 +1459,9 @@ assemble_thunk (struct cgraph_node *node then_bb = create_basic_block (NULL, (void *) 0, bb); return_bb = create_basic_block (NULL, (void *) 0, then_bb); else_bb = create_basic_block (NULL, (void *) 0, else_bb); + add_bb_to_loop (then_bb, bb->loop_father); + add_bb_to_loop (return_bb, bb->loop_father); + add_bb_to_loop (else_bb, bb->loop_father); remove_edge (single_succ_edge (bb)); true_label = gimple_block_label (then_bb); stmt = gimple_build_cond (NE_EXPR, restmp,