diff mbox

[PR44503] Fixes "control flow in the middle of basic block" with -fprefetch-loop-arrays

Message ID D4C76825A6780047854A11E93CDE84D02F7748@SAUSEXMBP01.amd.com
State New
Headers show

Commit Message

Fang, Changpeng June 16, 2010, 10:31 p.m. UTC
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
diff mbox

Patch

From a5ee46bc858991c3ebe1abac680e0fe862dc98a1 Mon Sep 17 00:00:00 2001
From: Changpeng Fang <chfang@pathscale.(none)>
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