From patchwork Wed Jun 16 22:31:30 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [PR44503] Fixes "control flow in the middle of basic block" with -fprefetch-loop-arrays Date: Wed, 16 Jun 2010 12:31:30 -0000 From: Fang, Changpeng X-Patchwork-Id: 55950 Message-Id: To: Zdenek Dvorak , "dnovillo@google.com" Cc: "gcc-patches@gcc.gnu.org" , "rguenther@suse.de" , "sebpop@gmail.com" Resend the patch adding Diego. Diego: What do you think that we consider _builtin_prefetch does not alter the control flow? Is this patch OK to commit now? Thanks, Changpeng >From a5ee46bc858991c3ebe1abac680e0fe862dc98a1 Mon Sep 17 00:00:00 2001 From: Changpeng Fang Date: Tue, 15 Jun 2010 14:34:09 -0700 Subject: [PATCH] pr44503 builtin_prefetch does not change control flow *gcc/tree-cfg.c (is_ctrl_altering_stmt): Return false if the gimple_call is _builtin_prefetch. --- gcc/tree-cfg.c | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-) diff --git a/gcc/tree-cfg.c b/gcc/tree-cfg.c index eca3ed0..76b7f56 100644 --- a/gcc/tree-cfg.c +++ b/gcc/tree-cfg.c @@ -2259,6 +2259,10 @@ is_ctrl_altering_stmt (gimple t) { int flags = gimple_call_flags (t); + /* BUILT_IN_PREFETCH would never alter the control flow. */ + if (gimple_call_builtin_p (t, BUILT_IN_PREFETCH)) + return false; + /* A non-pure/const call alters flow control if the current function has nonlocal labels. */ if (!(flags & (ECF_CONST | ECF_PURE)) && cfun->has_nonlocal_label) -- 1.6.3.3