aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRichard Henderson <rth@gcc.gnu.org>2002-04-22 11:17:06 -0700
committerRichard Henderson <rth@gcc.gnu.org>2002-04-22 11:17:06 -0700
commit0fe854a7e085766e646a8347362add815ad9c489 (patch)
tree44312bb45a57f13062f0c55c4052ae1c95e01c6b /gcc
parentaf0d16cdec59d270a017f82ac209c44dfa748ea3 (diff)
downloadgcc-0fe854a7e085766e646a8347362add815ad9c489.zip
gcc-0fe854a7e085766e646a8347362add815ad9c489.tar.gz
gcc-0fe854a7e085766e646a8347362add815ad9c489.tar.bz2
alias.c (canon_true_dependence): Special case (mem:blk (scratch)).
* alias.c (canon_true_dependence): Special case (mem:blk (scratch)). * gcse.c (free_insn_expr_list_list): New. (clear_modify_mem_tables): Use it. Fix bit set usage. (canon_list_insert): Use EXPR_LISTs for expressions. (record_last_mem_set_info): Factor BLOCK_NUM (insn). From-SVN: r52624
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog22
-rw-r--r--gcc/alias.c7
-rw-r--r--gcc/gcse.c58
3 files changed, 64 insertions, 23 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 8d9bb2c..0ab697d 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,13 @@
+2002-04-22 Richard Henderson <rth@redhat.com>
+
+ PR c/6344
+ * alias.c (canon_true_dependence): Special case (mem:blk (scratch)).
+
+ * gcse.c (free_insn_expr_list_list): New.
+ (clear_modify_mem_tables): Use it. Fix bit set usage.
+ (canon_list_insert): Use EXPR_LISTs for expressions.
+ (record_last_mem_set_info): Factor BLOCK_NUM (insn).
+
2002-04-22 Neil Booth <neil@daikokuya.demon.co.uk>
* cppfiles.c (_cpp_pop_file_buffer): Return void. Move
@@ -15,12 +25,12 @@
2002-04-22 Aldy Hernandez <aldyh@redhat.com>
- * config/rs6000/altivec.h (vec_xor): Add variant for both args
- being vector signed int.
- (vec_andc): Same.
- (vec_xor): Add variant for both args being vector signed char.
- Remove redundant variant.
- (vec_andc): Same.
+ * config/rs6000/altivec.h (vec_xor): Add variant for both args
+ being vector signed int.
+ (vec_andc): Same.
+ (vec_xor): Add variant for both args being vector signed char.
+ Remove redundant variant.
+ (vec_andc): Same.
2002-04-21 David S. Miller <davem@redhat.com>
diff --git a/gcc/alias.c b/gcc/alias.c
index 29da8ff..24874f4 100644
--- a/gcc/alias.c
+++ b/gcc/alias.c
@@ -2121,6 +2121,13 @@ canon_true_dependence (mem, mem_mode, mem_addr, x, varies)
if (MEM_VOLATILE_P (x) && MEM_VOLATILE_P (mem))
return 1;
+ /* (mem:BLK (scratch)) is a special mechanism to conflict with everything.
+ This is used in epilogue deallocation functions. */
+ if (GET_MODE (x) == BLKmode && GET_CODE (XEXP (x, 0)) == SCRATCH)
+ return 1;
+ if (GET_MODE (mem) == BLKmode && GET_CODE (XEXP (mem, 0)) == SCRATCH)
+ return 1;
+
if (DIFFERENT_ALIAS_SETS_P (x, mem))
return 0;
diff --git a/gcc/gcse.c b/gcc/gcse.c
index ba83712..56c26a4 100644
--- a/gcc/gcse.c
+++ b/gcc/gcse.c
@@ -697,6 +697,7 @@ static void delete_store PARAMS ((struct ls_expr *,
basic_block));
static void free_store_memory PARAMS ((void));
static void store_motion PARAMS ((void));
+static void free_insn_expr_list_list PARAMS ((rtx *));
static void clear_modify_mem_tables PARAMS ((void));
static void free_modify_mem_tables PARAMS ((void));
@@ -2387,6 +2388,7 @@ canon_list_insert (dest, unused1, v_insn)
void * v_insn;
{
rtx dest_addr, insn;
+ int bb;
while (GET_CODE (dest) == SUBREG
|| GET_CODE (dest) == ZERO_EXTRACT
@@ -2404,12 +2406,13 @@ canon_list_insert (dest, unused1, v_insn)
dest_addr = get_addr (XEXP (dest, 0));
dest_addr = canon_rtx (dest_addr);
insn = (rtx) v_insn;
+ bb = BLOCK_NUM (insn);
- canon_modify_mem_list[BLOCK_NUM (insn)] =
- alloc_INSN_LIST (dest_addr, canon_modify_mem_list[BLOCK_NUM (insn)]);
- canon_modify_mem_list[BLOCK_NUM (insn)] =
- alloc_INSN_LIST (dest, canon_modify_mem_list[BLOCK_NUM (insn)]);
- bitmap_set_bit (canon_modify_mem_list_set, BLOCK_NUM (insn));
+ canon_modify_mem_list[bb] =
+ alloc_EXPR_LIST (VOIDmode, dest_addr, canon_modify_mem_list[bb]);
+ canon_modify_mem_list[bb] =
+ alloc_EXPR_LIST (VOIDmode, dest, canon_modify_mem_list[bb]);
+ bitmap_set_bit (canon_modify_mem_list_set, bb);
}
/* Record memory modification information for INSN. We do not actually care
@@ -2420,23 +2423,24 @@ static void
record_last_mem_set_info (insn)
rtx insn;
{
+ int bb = BLOCK_NUM (insn);
+
/* load_killed_in_block_p will handle the case of calls clobbering
everything. */
- modify_mem_list[BLOCK_NUM (insn)] =
- alloc_INSN_LIST (insn, modify_mem_list[BLOCK_NUM (insn)]);
- bitmap_set_bit (modify_mem_list_set, BLOCK_NUM (insn));
+ modify_mem_list[bb] = alloc_INSN_LIST (insn, modify_mem_list[bb]);
+ bitmap_set_bit (modify_mem_list_set, bb);
if (GET_CODE (insn) == CALL_INSN)
{
/* Note that traversals of this loop (other than for free-ing)
will break after encountering a CALL_INSN. So, there's no
need to insert a pair of items, as canon_list_insert does. */
- canon_modify_mem_list[BLOCK_NUM (insn)] =
- alloc_INSN_LIST (insn, canon_modify_mem_list[BLOCK_NUM (insn)]);
- bitmap_set_bit (canon_modify_mem_list_set, BLOCK_NUM (insn));
+ canon_modify_mem_list[bb] =
+ alloc_INSN_LIST (insn, canon_modify_mem_list[bb]);
+ bitmap_set_bit (canon_modify_mem_list_set, bb);
}
else
- note_stores (PATTERN (insn), canon_list_insert, (void*) insn );
+ note_stores (PATTERN (insn), canon_list_insert, (void*) insn);
}
/* Called from compute_hash_table via note_stores to handle one
@@ -2712,6 +2716,27 @@ next_set (regno, expr)
return expr;
}
+/* Like free_INSN_LIST_list or free_EXPR_LIST_list, except that the node
+ types may be mixed. */
+
+static void
+free_insn_expr_list_list (listp)
+ rtx *listp;
+{
+ rtx list, next;
+
+ for (list = *listp; list ; list = next)
+ {
+ next = XEXP (list, 1);
+ if (GET_CODE (list) == EXPR_LIST)
+ free_EXPR_LIST_node (list);
+ else
+ free_INSN_LIST_node (list);
+ }
+
+ *listp = NULL;
+}
+
/* Clear canon_modify_mem_list and modify_mem_list tables. */
static void
clear_modify_mem_tables ()
@@ -2719,14 +2744,13 @@ clear_modify_mem_tables ()
int i;
EXECUTE_IF_SET_IN_BITMAP
- (canon_modify_mem_list_set, 0, i,
- free_INSN_LIST_list (modify_mem_list + i));
- bitmap_clear (canon_modify_mem_list_set);
+ (modify_mem_list_set, 0, i, free_INSN_LIST_list (modify_mem_list + i));
+ bitmap_clear (modify_mem_list_set);
EXECUTE_IF_SET_IN_BITMAP
(canon_modify_mem_list_set, 0, i,
- free_INSN_LIST_list (canon_modify_mem_list + i));
- bitmap_clear (modify_mem_list_set);
+ free_insn_expr_list_list (canon_modify_mem_list + i));
+ bitmap_clear (canon_modify_mem_list_set);
}
/* Release memory used by modify_mem_list_set and canon_modify_mem_list_set. */