summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gcc/ChangeLog7
-rw-r--r--gcc/df.c3
-rw-r--r--gcc/df.h1
-rw-r--r--gcc/sched-deps.c14
4 files changed, 23 insertions, 2 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 1d595301e73..5c57777d974 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,10 @@
+2003-03-11 Hartmut Penner <hpenner@de.ibm.com>
+
+ * df.c (read_modify_subreg_p): Change from static to global.
+ * df.h (read_modify_subreg_p): Add prototype.
+ * sched-deps.c (sched_analyze_1): Generate true dependency for
+ strict_low_part, certain subregs and zero/sign_extract.
+
2003-03-11 Neil Booth <neil@daikokuya.co.uk>
* Makefile.in: Update.
diff --git a/gcc/df.c b/gcc/df.c
index 740f2ccad1c..4c9598566e6 100644
--- a/gcc/df.c
+++ b/gcc/df.c
@@ -307,7 +307,6 @@ static void hybrid_search_sbitmap PARAMS ((basic_block, sbitmap *, sbitmap *,
enum df_confluence_op,
transfer_function_sbitmap,
sbitmap, sbitmap, void *));
-static inline bool read_modify_subreg_p PARAMS ((rtx));
/* Local memory allocation/deallocation routines. */
@@ -885,7 +884,7 @@ df_ref_record (df, reg, loc, insn, ref_type, ref_flags)
/* Return non-zero if writes to paradoxical SUBREGs, or SUBREGs which
are too narrow, are read-modify-write. */
-static inline bool
+bool
read_modify_subreg_p (x)
rtx x;
{
diff --git a/gcc/df.h b/gcc/df.h
index a294843c6cb..2191ab5e9dd 100644
--- a/gcc/df.h
+++ b/gcc/df.h
@@ -353,3 +353,4 @@ extern void iterative_dataflow_bitmap PARAMS ((bitmap *, bitmap *, bitmap *,
enum df_confluence_op,
transfer_function_bitmap,
int *, void *));
+extern bool read_modify_subreg_p PARAMS ((rtx));
diff --git a/gcc/sched-deps.c b/gcc/sched-deps.c
index b3c619df51d..874ebc26c7a 100644
--- a/gcc/sched-deps.c
+++ b/gcc/sched-deps.c
@@ -42,6 +42,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "sched-int.h"
#include "params.h"
#include "cselib.h"
+#include "df.h"
extern char *reg_known_equiv_p;
extern rtx *reg_known_value;
@@ -468,6 +469,19 @@ sched_analyze_1 (deps, x, insn)
while (GET_CODE (dest) == STRICT_LOW_PART || GET_CODE (dest) == SUBREG
|| GET_CODE (dest) == ZERO_EXTRACT || GET_CODE (dest) == SIGN_EXTRACT)
{
+ if (GET_CODE (dest) == STRICT_LOW_PART
+ || GET_CODE (dest) == ZERO_EXTRACT
+ || GET_CODE (dest) == SIGN_EXTRACT
+ || read_modify_subreg_p (dest))
+ {
+ /* These both read and modify the result. We must handle
+ them as writes to get proper dependencies for following
+ instructions. We must handle them as reads to get proper
+ dependencies from this to previous instructions.
+ Thus we need to call sched_analyze_2. */
+
+ sched_analyze_2 (deps, XEXP (dest, 0), insn);
+ }
if (GET_CODE (dest) == ZERO_EXTRACT || GET_CODE (dest) == SIGN_EXTRACT)
{
/* The second and third arguments are values read by this insn. */