From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17294 invoked by alias); 2 Jun 2011 21:53:28 -0000 Received: (qmail 17285 invoked by uid 22791); 2 Jun 2011 21:53:27 -0000 X-SWARE-Spam-Status: No, hits=-1.9 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from mel.act-europe.fr (HELO mel.act-europe.fr) (194.98.77.210) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 02 Jun 2011 21:53:13 +0000 Received: from localhost (localhost [127.0.0.1]) by filtered-smtp.eu.adacore.com (Postfix) with ESMTP id 94016CB0289 for ; Thu, 2 Jun 2011 23:53:11 +0200 (CEST) Received: from mel.act-europe.fr ([127.0.0.1]) by localhost (smtp.eu.adacore.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id CLLsHePohklg for ; Thu, 2 Jun 2011 23:53:08 +0200 (CEST) Received: from [192.168.1.2] (bon31-9-83-155-120-49.fbx.proxad.net [83.155.120.49]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mel.act-europe.fr (Postfix) with ESMTP id 8B783CB0283 for ; Thu, 2 Jun 2011 23:53:08 +0200 (CEST) From: Eric Botcazou To: gcc-patches@gcc.gnu.org Subject: Re: Remove SETJMP_VIA_SAVE_AREA support Date: Thu, 02 Jun 2011 21:53:00 -0000 User-Agent: KMail/1.9.9 References: <201106021241.49426.ebotcazou@adacore.com> In-Reply-To: <201106021241.49426.ebotcazou@adacore.com> MIME-Version: 1.0 Content-Type: Multipart/Mixed; boundary="Boundary-00=_oYA6NLm5cdVh7RK" Message-Id: <201106022352.40100.ebotcazou@adacore.com> 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: 2011-06/txt/msg00193.txt.bz2 --Boundary-00=_oYA6NLm5cdVh7RK Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Content-length: 894 > This exposed a couple of similar bugs in cse.c and postreload-gcse.c: the > code was effectively treating a basic block with a single, abnormal > incoming edge as if the edge was normal. I've installed the following refined fix, after testing on i586-suse-linux and sparc-sun-solaris2.10. Most EDGE_ABNORMAL edges can very likely be treated normally here, for example EH edges when call-saved registers are considered. The only really problematic ones are EDGE_ABNORMAL_CALL edges when there is a non-local label in the function, because even call-saved registers are not guaranteed to be preserved in this case. 2011-06-02 Eric Botcazou * cse.c (cse_find_path): Refine change to exclude EDGE_ABNORMAL_CALL edges only, when there is a non-local label in the function. * postreload-gcse.c (bb_has_well_behaved_predecessors): Likewise. -- Eric Botcazou --Boundary-00=_oYA6NLm5cdVh7RK Content-Type: text/x-diff; charset="iso 8859-15"; name="p.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="p.diff" Content-length: 1376 Index: cse.c =================================================================== --- cse.c (revision 174564) +++ cse.c (working copy) @@ -6193,7 +6193,7 @@ cse_find_path (basic_block first_bb, str e = NULL; if (e - && (e->flags & EDGE_ABNORMAL) == 0 + && !((e->flags & EDGE_ABNORMAL_CALL) && cfun->has_nonlocal_label) && e->dest != EXIT_BLOCK_PTR && single_pred_p (e->dest) /* Avoid visiting basic blocks twice. The large comment Index: postreload-gcse.c =================================================================== --- postreload-gcse.c (revision 174564) +++ postreload-gcse.c (working copy) @@ -912,12 +912,10 @@ get_avail_load_store_reg (rtx insn) static bool bb_has_well_behaved_predecessors (basic_block bb) { - unsigned int edge_count = EDGE_COUNT (bb->preds); edge pred; edge_iterator ei; - if (edge_count == 0 - || (edge_count == 1 && (single_pred_edge (bb)->flags & EDGE_ABNORMAL))) + if (EDGE_COUNT (bb->preds) == 0) return false; FOR_EACH_EDGE (pred, ei, bb->preds) @@ -925,6 +923,9 @@ bb_has_well_behaved_predecessors (basic_ if ((pred->flags & EDGE_ABNORMAL) && EDGE_CRITICAL_P (pred)) return false; + if ((pred->flags & EDGE_ABNORMAL_CALL) && cfun->has_nonlocal_label) + return false; + if (JUMP_TABLE_DATA_P (BB_END (pred->src))) return false; } --Boundary-00=_oYA6NLm5cdVh7RK--