* tree-ssa-structalias.c (get_constraint_for_component_ref):
Use ranges_overlap_p.
(offset_overlaps_with_access): Rename
to ranges_overlap_p and move ...
* tree-flow-inline.h (ranges_overlap_p): ... here.
* tree.h (get_inner_reference, handled_component_p): Update
comments.
* tree.h (record_component_aliases, get_alias_set,
alias_sets_conflict_p, alias_sets_must_conflict_p,
objects_must_conflict_p): Move declarations ...
* alias.h (record_component_aliases, get_alias_set,
alias_sets_conflict_p, alias_sets_must_conflict_p,
objects_must_conflict_p): ... here.
Include coretypes.h.
* Makefile.in (ALIAS_H): Add coretypes.h dependency.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@132950
138bc75d-0d04-0410-961f-
82ee72b054a4
+2008-03-05 Richard Guenther <rguenther@suse.de>
+
+ * tree-ssa-structalias.c (get_constraint_for_component_ref):
+ Use ranges_overlap_p.
+ (offset_overlaps_with_access): Rename
+ to ranges_overlap_p and move ...
+ * tree-flow-inline.h (ranges_overlap_p): ... here.
+
+ * tree.h (get_inner_reference, handled_component_p): Update
+ comments.
+
+ * tree.h (record_component_aliases, get_alias_set,
+ alias_sets_conflict_p, alias_sets_must_conflict_p,
+ objects_must_conflict_p): Move declarations ...
+ * alias.h (record_component_aliases, get_alias_set,
+ alias_sets_conflict_p, alias_sets_must_conflict_p,
+ objects_must_conflict_p): ... here.
+ Include coretypes.h.
+ * Makefile.in (ALIAS_H): Add coretypes.h dependency.
+
2008-03-05 Aldy Hernandez <aldyh@redhat.com>
* cfg.c: Include tree-flow.h.
COVERAGE_H = coverage.h $(GCOV_IO_H)
DEMANGLE_H = $(srcdir)/../include/demangle.h
RECOG_H = recog.h
-ALIAS_H = alias.h
+ALIAS_H = alias.h coretypes.h
EMIT_RTL_H = emit-rtl.h
FLAGS_H = flags.h options.h
FUNCTION_H = function.h $(TREE_H) $(HASHTAB_H)
#ifndef GCC_ALIAS_H
#define GCC_ALIAS_H
+#include "coretypes.h"
+
/* The type of an alias set. */
typedef HOST_WIDE_INT alias_set_type;
extern alias_set_type new_alias_set (void);
+extern alias_set_type get_alias_set (tree);
extern alias_set_type get_varargs_alias_set (void);
extern alias_set_type get_frame_alias_set (void);
extern bool component_uses_parent_alias_set (const_tree);
extern bool alias_set_subset_of (alias_set_type, alias_set_type);
+extern void record_component_aliases (tree);
+extern int alias_sets_conflict_p (alias_set_type, alias_set_type);
+extern int alias_sets_must_conflict_p (alias_set_type, alias_set_type);
+extern int objects_must_conflict_p (tree, tree);
extern int nonoverlapping_memrefs_p (const_rtx, const_rtx);
/* This alias set can be used to force a memory to conflict with all
return false;
}
-
+
+/* Return true, if the two ranges [POS1, SIZE1] and [POS2, SIZE2]
+ overlap. SIZE1 and/or SIZE2 can be (unsigned)-1 in which case the
+ range is open-ended. Otherwise return false. */
+
+static inline bool
+ranges_overlap_p (unsigned HOST_WIDE_INT pos1,
+ unsigned HOST_WIDE_INT size1,
+ unsigned HOST_WIDE_INT pos2,
+ unsigned HOST_WIDE_INT size2)
+{
+ if (pos1 >= pos2
+ && (size2 == (unsigned HOST_WIDE_INT)-1
+ || pos1 < (pos2 + size2)))
+ return true;
+ if (pos2 >= pos1
+ && (size1 == (unsigned HOST_WIDE_INT)-1
+ || pos2 < (pos1 + size1)))
+ return true;
+
+ return false;
+}
+
+
/* Return true if OFFSET and SIZE define a range that overlaps with some
portion of the range of SV, a subvar. If there was an exact overlap,
*EXACT will be set to true upon return. */
}
-/* Return true if an access to [ACCESSPOS, ACCESSSIZE]
- overlaps with a field at [FIELDPOS, FIELDSIZE] */
-
-static bool
-offset_overlaps_with_access (const unsigned HOST_WIDE_INT fieldpos,
- const unsigned HOST_WIDE_INT fieldsize,
- const unsigned HOST_WIDE_INT accesspos,
- const unsigned HOST_WIDE_INT accesssize)
-{
- if (fieldpos == accesspos && fieldsize == accesssize)
- return true;
- if (accesspos >= fieldpos && accesspos < (fieldpos + fieldsize))
- return true;
- if (accesspos < fieldpos && (accesspos + accesssize > fieldpos))
- return true;
-
- return false;
-}
-
/* Given a COMPONENT_REF T, return the constraint_expr for it. */
static void
varinfo_t curr;
for (curr = get_varinfo (result->var); curr; curr = curr->next)
{
- if (offset_overlaps_with_access (curr->offset, curr->size,
- result->offset, bitmaxsize))
+ if (ranges_overlap_p (curr->offset, curr->size,
+ result->offset, bitmaxsize))
{
result->var = curr->id;
break;
extern tree get_narrower (tree, int *);
-/* Given an expression EXP that may be a COMPONENT_REF or an ARRAY_REF,
- look for nested component-refs or array-refs at constant positions
- and find the ultimate containing object, which is returned. */
+/* Return true if T is an expression that get_inner_reference handles. */
+
+extern int handled_component_p (const_tree);
+
+/* Given an expression EXP that is a handled_component_p,
+ look for the ultimate containing object, which is returned and specify
+ the access position and size. */
extern tree get_inner_reference (tree, HOST_WIDE_INT *, HOST_WIDE_INT *,
tree *, enum machine_mode *, int *, int *,
extern bool contains_packed_reference (const_tree exp);
-/* Return 1 if T is an expression that get_inner_reference handles. */
-
-extern int handled_component_p (const_tree);
-
/* Return a tree of sizetype representing the size, in bytes, of the element
of EXP, an ARRAY_REF. */
/* In convert.c */
extern tree strip_float_extensions (tree);
-/* In alias.c */
-extern void record_component_aliases (tree);
-extern alias_set_type get_alias_set (tree);
-extern int alias_sets_conflict_p (alias_set_type, alias_set_type);
-extern int alias_sets_must_conflict_p (alias_set_type, alias_set_type);
-extern int objects_must_conflict_p (tree, tree);
-
/* In tree.c */
extern int really_constant_p (const_tree);
extern int int_fits_type_p (const_tree, const_tree);