summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkenner <kenner@138bc75d-0d04-0410-961f-82ee72b054a4>2000-05-20 16:03:41 +0000
committerkenner <kenner@138bc75d-0d04-0410-961f-82ee72b054a4>2000-05-20 16:03:41 +0000
commit5badbbc0da1d5c60a05efbcf1699048f345c3ac0 (patch)
tree36883636db7072f8b0eb62a5d29d93634fa5ac1c
parent71d9e995e9958a32cd31c31198426f78a9762c5a (diff)
downloadgcc-5badbbc0da1d5c60a05efbcf1699048f345c3ac0.tar.gz
* alias.c: Clarify some comments.
(record_base_value): REGNO is unsigned. * rtl.h (record_base_value): Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@34051 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ChangeLog4
-rw-r--r--gcc/alias.c64
-rw-r--r--gcc/rtl.h2
3 files changed, 37 insertions, 33 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 6f8d3966b79..18e8dfb6787 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,9 @@
Sat May 20 09:30:55 2000 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
+ * alias.c: Clarify some comments.
+ (record_base_value): REGNO is unsigned.
+ * rtl.h (record_base_value): Likewise.
+
* alias.c (aliases_everything_p): Don't special-case QImode here.
* c-common.c (c_get_alias_set): Do it here.
Handle BIT_FIELD_REF by getting alias info for arg.
diff --git a/gcc/alias.c b/gcc/alias.c
index 897c27d08af..2f0392b8388 100644
--- a/gcc/alias.c
+++ b/gcc/alias.c
@@ -38,8 +38,8 @@ Boston, MA 02111-1307, USA. */
/* The alias sets assigned to MEMs assist the back-end in determining
which MEMs can alias which other MEMs. In general, two MEMs in
- different alias sets to not alias each other. There is one
- exception, however. Consider something like:
+ different alias sets cannot alias each other, with one important
+ exception. Consider something like:
struct S {int i; double d; };
@@ -53,12 +53,14 @@ Boston, MA 02111-1307, USA. */
|/_ _\|
int double
- (The arrows are directed and point downwards.) If, when comparing
- two alias sets, we can hold one set fixed, trace the other set
- downwards, and at some point find the first set, the two MEMs can
- alias one another. In this situation we say the alias set for
- `struct S' is the `superset' and that those for `int' and `double'
- are `subsets'.
+ (The arrows are directed and point downwards.)
+ In this situation we say the alias set for `struct S' is the
+ `superset' and that those for `int' and `double' are `subsets'.
+
+ To see whether two alias sets can point to the same memory, we must go
+ down the list of decendents of each and see if there is some alias set
+ in common. We need not trace past immediate decendents, however, since
+ we propagate all grandchildren up one level.
Alias set zero is implicitly a superset of all other alias sets.
However, this is no actual entry for alias set zero. It is an
@@ -70,7 +72,7 @@ typedef struct alias_set_entry
int alias_set;
/* The children of the alias set. These are not just the immediate
- children, but, in fact, all children. So, if we have:
+ children, but, in fact, all decendents. So, if we have:
struct T { struct S s; float f; }
@@ -111,9 +113,7 @@ static int nonlocal_reference_p PARAMS ((rtx));
mems_in_disjoint_alias_sets_p (MEM1, MEM2)
/* Cap the number of passes we make over the insns propagating alias
- information through set chains.
-
- 10 is a completely arbitrary choice. */
+ information through set chains. 10 is a completely arbitrary choice. */
#define MAX_ALIAS_LOOP_PASSES 10
/* reg_base_value[N] gives an address to which register N is related.
@@ -164,25 +164,24 @@ static unsigned int reg_known_value_size;
/* Vector recording for each reg_known_value whether it is due to a
REG_EQUIV note. Future passes (viz., reload) may replace the
pseudo with the equivalent expression and so we account for the
- dependences that would be introduced if that happens. */
-/* ??? This is a problem only on the Convex. The REG_EQUIV notes created in
- assign_parms mention the arg pointer, and there are explicit insns in the
- RTL that modify the arg pointer. Thus we must ensure that such insns don't
- get scheduled across each other because that would invalidate the REG_EQUIV
- notes. One could argue that the REG_EQUIV notes are wrong, but solving
- the problem in the scheduler will likely give better code, so we do it
- here. */
+ dependences that would be introduced if that happens.
+
+ The REG_EQUIV notes created in assign_parms may mention the arg
+ pointer, and there are explicit insns in the RTL that modify the
+ arg pointer. Thus we must ensure that such insns don't get
+ scheduled across each other because that would invalidate the
+ REG_EQUIV notes. One could argue that the REG_EQUIV notes are
+ wrong, but solving the problem in the scheduler will likely give
+ better code, so we do it here. */
char *reg_known_equiv_p;
/* True when scanning insns from the start of the rtl to the
NOTE_INSN_FUNCTION_BEG note. */
-
static int copying_arguments;
/* The splay-tree used to store the various alias set entries. */
-
static splay_tree alias_sets;
-
+
/* Returns a pointer to the alias set entry for ALIAS_SET, if there is
such an entry, or NULL otherwise. */
@@ -196,8 +195,8 @@ get_alias_set_entry (alias_set)
return sn != 0 ? ((alias_set_entry) sn->value) : 0;
}
-/* Returns nonzero value if the alias sets for MEM1 and MEM2 are such
- that the two MEMs cannot alias each other. */
+/* Returns nonzero if the alias sets for MEM1 and MEM2 are such that
+ the two MEMs cannot alias each other. */
static int
mems_in_disjoint_alias_sets_p (mem1, mem2)
@@ -515,26 +514,27 @@ record_set (dest, set, data)
reg_seen[regno] = 1;
}
-/* Called from loop optimization when a new pseudo-register is created. */
+/* Called from loop optimization when a new pseudo-register is
+ created. It indicates that REGNO is being set to VAL. f INVARIANT
+ is true then this value also describes an invariant relationship
+ which can be used to deduce that two registers with unknown values
+ are different. */
void
record_base_value (regno, val, invariant)
- int regno;
+ unsigned int regno;
rtx val;
int invariant;
{
- if ((unsigned) regno >= reg_base_value_size)
+ if (regno >= reg_base_value_size)
return;
- /* If INVARIANT is true then this value also describes an invariant
- relationship which can be used to deduce that two registers with
- unknown values are different. */
if (invariant && alias_invariant)
alias_invariant[regno] = val;
if (GET_CODE (val) == REG)
{
- if ((unsigned) REGNO (val) < reg_base_value_size)
+ if (REGNO (val) < reg_base_value_size)
reg_base_value[regno] = reg_base_value[REGNO (val)];
return;
diff --git a/gcc/rtl.h b/gcc/rtl.h
index 853fd391d2a..2de4b0ed300 100644
--- a/gcc/rtl.h
+++ b/gcc/rtl.h
@@ -1823,7 +1823,7 @@ extern void init_alias_once PARAMS ((void));
extern void init_alias_analysis PARAMS ((void));
extern void end_alias_analysis PARAMS ((void));
-extern void record_base_value PARAMS ((int, rtx, int));
+extern void record_base_value PARAMS ((unsigned int, rtx, int));
extern void record_alias_subset PARAMS ((int, int));
extern rtx addr_side_effect_eval PARAMS ((rtx, int, int));