From 2e33cac51d19b0ae422cd030cc9a0184b1bc0748 Mon Sep 17 00:00:00 2001 From: rakdver Date: Thu, 16 Feb 2006 15:59:00 +0000 Subject: [PATCH] * loop-invariant.c (invariant_for_use, check_dependencies): Fail for read-write uses. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@111141 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ChangeLog | 5 +++++ gcc/loop-invariant.c | 9 ++++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index d01a0490d8d5..953abf6cadd5 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,10 @@ 2006-02-16 Zdenek Dvorak + * loop-invariant.c (invariant_for_use, check_dependencies): Fail for + read-write uses. + +2006-02-16 Zdenek Dvorak + PR rtl-optimization/26296 * Makefile.in (loop-invariant.c): Add except.h dependency. * loop-invariant.c: Include except.h. diff --git a/gcc/loop-invariant.c b/gcc/loop-invariant.c index 03a0c34e6cba..04531a0e05fc 100644 --- a/gcc/loop-invariant.c +++ b/gcc/loop-invariant.c @@ -233,6 +233,9 @@ invariant_for_use (struct df_ref *use) struct df_ref *def; basic_block bb = BLOCK_FOR_INSN (use->insn), def_bb; + if (use->flags & DF_REF_READ_WRITE) + return NULL; + defs = DF_REF_CHAIN (use); if (!defs || defs->next) return NULL; @@ -682,7 +685,8 @@ record_use (struct def *def, rtx *use, rtx insn) } /* Finds the invariants INSN depends on and store them to the DEPENDS_ON - bitmap. */ + bitmap. Returns true if all dependencies of INSN are known to be + loop invariants, false otherwise. */ static bool check_dependencies (rtx insn, bitmap depends_on) @@ -695,6 +699,9 @@ check_dependencies (rtx insn, bitmap depends_on) for (use = DF_INSN_GET (df, insn)->uses; use; use = use->next_ref) { + if (use->flags & DF_REF_READ_WRITE) + return false; + defs = DF_REF_CHAIN (use); if (!defs) continue; -- 2.11.4.GIT