From 8115f0afdaff380da01d555b0584cd0fceb789b8 Mon Sep 17 00:00:00 2001 From: rguenth Date: Mon, 29 Jun 2009 12:20:39 +0000 Subject: 2009-06-29 Richard Guenther PR middle-end/38212 * alias.c (find_base_decl): Remove. (get_deref_alias_set_1): Remove restrict handling. * c-common.c (c_apply_type_quals_to_decl): Do not set DECL_POINTER_ALIAS_SET. * gimplify.c (find_single_pointer_decl_1): Remove. (find_single_pointer_decl): Likewise. (internal_get_tmp_var): Remove restrict handling. (gimple_regimplify_operands): Likewise. * omp-low.c (expand_omp_atomic_pipeline): Do not set DECL_POINTER_ALIAS_SET. Use ref-all pointers. * print-tree.c (print_node): Do not print DECL_POINTER_ALIAS_SET. * tree.c (restrict_base_for_decl): Remove. (init_ttree): Do not allocate it. (make_node_stat): Do not set DECL_POINTER_ALIAS_SET. Set LABEL_DECL_UID for label decls. (copy_node_stat): Do not copy restrict information. (decl_restrict_base_lookup): Remove. (decl_restrict_base_insert): Likewise. (print_restrict_base_statistics): Likewise. (dump_tree_statistics): Do not call print_restrict_base_statistics. * tree.h (DECL_POINTER_ALIAS_SET): Remove. (DECL_POINTER_ALIAS_SET_KNOWN_P): Likewise. (struct tree_decl_common): Rename pointer_alias_set to label_decl_uid. (LABEL_DECL_UID): Adjust. (DECL_BASED_ON_RESTRICT_P): Remove. (DECL_GET_RESTRICT_BASE): Likewise. (SET_DECL_RESTRICT_BASE): Likewise. (struct tree_decl_with_vis): Remove based_on_restrict_p flag. * config/i386/i386.c (ix86_gimplify_va_arg): Use ref-all pointers instead of DECL_POINTER_ALIAS_SET. * config/rs6000/rs6000.c (rs6000_gimplify_va_arg): Likewise. * config/s390/s390.c (s390_gimplify_va_arg): Likewise. * config/spu/spu.c (spu_gimplify_va_arg_expr): Likewise. * gcc.c-torture/execute/pr38212.c: New testcase. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@149047 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/alias.c | 103 ++---------------------------------------------------------- 1 file changed, 2 insertions(+), 101 deletions(-) (limited to 'gcc/alias.c') diff --git a/gcc/alias.c b/gcc/alias.c index 7d9faf2c920..248600179f8 100644 --- a/gcc/alias.c +++ b/gcc/alias.c @@ -155,7 +155,6 @@ static int base_alias_check (rtx, rtx, enum machine_mode, static rtx find_base_value (rtx); static int mems_in_disjoint_alias_sets_p (const_rtx, const_rtx); static int insert_subset_children (splay_tree_node, void*); -static tree find_base_decl (tree); static alias_set_entry get_alias_set_entry (alias_set_type); static const_rtx fixed_scalar_and_varying_struct_p (const_rtx, const_rtx, rtx, rtx, bool (*) (const_rtx, bool)); @@ -422,57 +421,6 @@ objects_must_conflict_p (tree t1, tree t2) return alias_sets_must_conflict_p (set1, set2); } -/* T is an expression with pointer type. Find the DECL on which this - expression is based. (For example, in `a[i]' this would be `a'.) - If there is no such DECL, or a unique decl cannot be determined, - NULL_TREE is returned. */ - -static tree -find_base_decl (tree t) -{ - tree d0, d1; - - if (t == 0 || t == error_mark_node || ! POINTER_TYPE_P (TREE_TYPE (t))) - return 0; - - if (TREE_CODE (t) == SSA_NAME) - t = SSA_NAME_VAR (t); - - /* If this is a declaration, return it. If T is based on a restrict - qualified decl, return that decl. */ - if (DECL_P (t)) - { - if (TREE_CODE (t) == VAR_DECL && DECL_BASED_ON_RESTRICT_P (t)) - t = DECL_GET_RESTRICT_BASE (t); - return t; - } - - /* Handle general expressions. It would be nice to deal with - COMPONENT_REFs here. If we could tell that `a' and `b' were the - same, then `a->f' and `b->f' are also the same. */ - switch (TREE_CODE_CLASS (TREE_CODE (t))) - { - case tcc_unary: - return find_base_decl (TREE_OPERAND (t, 0)); - - case tcc_binary: - /* Return 0 if found in neither or both are the same. */ - d0 = find_base_decl (TREE_OPERAND (t, 0)); - d1 = find_base_decl (TREE_OPERAND (t, 1)); - if (d0 == d1) - return d0; - else if (d0 == 0) - return d1; - else if (d1 == 0) - return d0; - else - return 0; - - default: - return 0; - } -} - /* Return true if all nested component references handled by get_inner_reference in T are such that we should use the alias set provided by the object at the heart of T. @@ -532,56 +480,9 @@ get_deref_alias_set_1 (tree t) if (!flag_strict_aliasing) return 0; + /* All we care about is the type. */ if (! TYPE_P (t)) - { - tree decl = find_base_decl (t); - - if (decl && DECL_POINTER_ALIAS_SET_KNOWN_P (decl)) - { - /* If we haven't computed the actual alias set, do it now. */ - if (DECL_POINTER_ALIAS_SET (decl) == -2) - { - tree pointed_to_type = TREE_TYPE (TREE_TYPE (decl)); - - /* No two restricted pointers can point at the same thing. - However, a restricted pointer can point at the same thing - as an unrestricted pointer, if that unrestricted pointer - is based on the restricted pointer. So, we make the - alias set for the restricted pointer a subset of the - alias set for the type pointed to by the type of the - decl. */ - alias_set_type pointed_to_alias_set - = get_alias_set (pointed_to_type); - - if (pointed_to_alias_set == 0) - /* It's not legal to make a subset of alias set zero. */ - DECL_POINTER_ALIAS_SET (decl) = 0; - else if (AGGREGATE_TYPE_P (pointed_to_type)) - /* For an aggregate, we must treat the restricted - pointer the same as an ordinary pointer. If we - were to make the type pointed to by the - restricted pointer a subset of the pointed-to - type, then we would believe that other subsets - of the pointed-to type (such as fields of that - type) do not conflict with the type pointed to - by the restricted pointer. */ - DECL_POINTER_ALIAS_SET (decl) - = pointed_to_alias_set; - else - { - DECL_POINTER_ALIAS_SET (decl) = new_alias_set (); - record_alias_subset (pointed_to_alias_set, - DECL_POINTER_ALIAS_SET (decl)); - } - } - - /* We use the alias set indicated in the declaration. */ - return DECL_POINTER_ALIAS_SET (decl); - } - - /* Now all we care about is the type. */ - t = TREE_TYPE (t); - } + t = TREE_TYPE (t); /* If we have an INDIRECT_REF via a void pointer, we don't know anything about what that might alias. Likewise if the -- cgit v1.2.1 From 3a4438438e8c85036b3cf79cbbf030f0d726db88 Mon Sep 17 00:00:00 2001 From: rguenth Date: Tue, 14 Jul 2009 09:59:18 +0000 Subject: 2009-07-14 Richard Guenther Andrey Belevantsev * tree-ssa-alias.h (refs_may_alias_p_1): Declare. (pt_solution_set): Likewise. * tree-ssa-alias.c (refs_may_alias_p_1): Export. * tree-ssa-structalias.c (pt_solution_set): New function. * final.c (rest_of_clean_state): Free SSA data structures. * print-rtl.c (print_decl_name): Remove. (print_mem_expr): Implement in terms of print_generic_expr. * alias.c (ao_ref_from_mem): New function. (rtx_refs_may_alias_p): Likewise. (true_dependence): Query alias-export info. (canon_true_dependence): Likewise. (write_dependence_p): Likewise. * tree-dfa.c (get_ref_base_and_extent): For void types leave size unknown. * emit-rtl.c (component_ref_for_mem_expr): Remove. (mem_expr_equal_p): Use operand_equal_p. (set_mem_attributes_minus_bitpos): Do not use component_ref_for_mem_expr. * cfgexpand.c (add_partitioned_vars_to_ptset): New function. (update_alias_info_with_stack_vars): Likewise. (partition_stack_vars): Call update_alias_info_with_stack_vars. * tree-ssa.c (delete_tree_ssa): Do not release SSA names explicitly nor clear stmt operands. Free the decl-to-pointer map. * tree-optimize.c (execute_free_datastructures): Do not free SSA data structures here. * tree-flow.h (struct gimple_df): Add decls_to_pointers member. * Makefile.in (emit-rtl.o): Add pointer-set.h dependency. (alias.o): Add tree-ssa-alias.h, pointer-set.h and $(TREE_FLOW_H) dependencies. (print-rtl.o): Add $(DIAGNOSTIC_H) dependency. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@149624 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/alias.c | 114 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 108 insertions(+), 6 deletions(-) (limited to 'gcc/alias.c') diff --git a/gcc/alias.c b/gcc/alias.c index 248600179f8..e9cc2d85f96 100644 --- a/gcc/alias.c +++ b/gcc/alias.c @@ -46,6 +46,9 @@ along with GCC; see the file COPYING3. If not see #include "tree-pass.h" #include "ipa-type-escape.h" #include "df.h" +#include "tree-ssa-alias.h" +#include "pointer-set.h" +#include "tree-flow.h" /* The aliasing API provided here solves related but different problems: @@ -249,6 +252,98 @@ DEF_VEC_ALLOC_P(alias_set_entry,gc); /* The splay-tree used to store the various alias set entries. */ static GTY (()) VEC(alias_set_entry,gc) *alias_sets; +/* Build a decomposed reference object for querying the alias-oracle + from the MEM rtx and store it in *REF. + Returns false if MEM is not suitable for the alias-oracle. */ + +static bool +ao_ref_from_mem (ao_ref *ref, const_rtx mem) +{ + tree expr = MEM_EXPR (mem); + tree base; + + if (!expr) + return false; + + ao_ref_init (ref, expr); + + /* Get the base of the reference and see if we have to reject or + adjust it. */ + base = ao_ref_base (ref); + if (base == NULL_TREE) + return false; + + /* If this is a pointer dereference of a non-SSA_NAME punt. + ??? We could replace it with a pointer to anything. */ + if (INDIRECT_REF_P (base) + && TREE_CODE (TREE_OPERAND (base, 0)) != SSA_NAME) + return false; + + /* If this is a reference based on a partitioned decl replace the + base with an INDIRECT_REF of the pointer representative we + created during stack slot partitioning. */ + if (TREE_CODE (base) == VAR_DECL + && ! TREE_STATIC (base) + && cfun->gimple_df->decls_to_pointers != NULL) + { + void *namep; + namep = pointer_map_contains (cfun->gimple_df->decls_to_pointers, base); + if (namep) + { + ref->base_alias_set = get_alias_set (base); + ref->base = build1 (INDIRECT_REF, TREE_TYPE (base), *(tree *)namep); + } + } + + ref->ref_alias_set = MEM_ALIAS_SET (mem); + + /* For NULL MEM_OFFSET the MEM_EXPR may have been stripped arbitrarily + without recording offset or extent adjustments properly. */ + if (MEM_OFFSET (mem) == NULL_RTX) + { + ref->offset = 0; + ref->max_size = -1; + } + else + { + ref->offset += INTVAL (MEM_OFFSET (mem)) * BITS_PER_UNIT; + } + + /* NULL MEM_SIZE should not really happen with a non-NULL MEM_EXPR, + but just play safe here. The size may have been adjusted together + with the offset, so we need to take it if it is set and not rely + on MEM_EXPR here (which has the size determining parts potentially + stripped anyway). We lose precision for max_size which is only + available from the remaining MEM_EXPR. */ + if (MEM_SIZE (mem) == NULL_RTX) + { + ref->size = -1; + ref->max_size = -1; + } + else + { + ref->size = INTVAL (MEM_SIZE (mem)) * BITS_PER_UNIT; + } + + return true; +} + +/* Query the alias-oracle on whether the two memory rtx X and MEM may + alias. If TBAA_P is set also apply TBAA. Returns true if the + two rtxen may alias, false otherwise. */ + +static bool +rtx_refs_may_alias_p (const_rtx x, const_rtx mem, bool tbaa_p) +{ + ao_ref ref1, ref2; + + if (!ao_ref_from_mem (&ref1, x) + || !ao_ref_from_mem (&ref2, mem)) + return true; + + return refs_may_alias_p_1 (&ref1, &ref2, tbaa_p); +} + /* Returns a pointer to the alias set entry for ALIAS_SET, if there is such an entry, or NULL otherwise. */ @@ -2191,8 +2286,10 @@ true_dependence (const_rtx mem, enum machine_mode mem_mode, const_rtx x, if (mem_mode == BLKmode || GET_MODE (x) == BLKmode) return 1; - return ! fixed_scalar_and_varying_struct_p (mem, x, mem_addr, x_addr, - varies); + if (fixed_scalar_and_varying_struct_p (mem, x, mem_addr, x_addr, varies)) + return 0; + + return rtx_refs_may_alias_p (x, mem, true); } /* Canonical true dependence: X is read after store in MEM takes place. @@ -2255,8 +2352,10 @@ canon_true_dependence (const_rtx mem, enum machine_mode mem_mode, rtx mem_addr, if (mem_mode == BLKmode || GET_MODE (x) == BLKmode) return 1; - return ! fixed_scalar_and_varying_struct_p (mem, x, mem_addr, x_addr, - varies); + if (fixed_scalar_and_varying_struct_p (mem, x, mem_addr, x_addr, varies)) + return 0; + + return rtx_refs_may_alias_p (x, mem, true); } /* Returns nonzero if a write to X might alias a previous read from @@ -2316,8 +2415,11 @@ write_dependence_p (const_rtx mem, const_rtx x, int writep) = fixed_scalar_and_varying_struct_p (mem, x, mem_addr, x_addr, rtx_addr_varies_p); - return (!(fixed_scalar == mem && !aliases_everything_p (x)) - && !(fixed_scalar == x && !aliases_everything_p (mem))); + if ((fixed_scalar == mem && !aliases_everything_p (x)) + || (fixed_scalar == x && !aliases_everything_p (mem))) + return 0; + + return rtx_refs_may_alias_p (x, mem, false); } /* Anti dependence: X is written after read in MEM takes place. */ -- cgit v1.2.1 From 0f2b32ac0e69e8d98668ec6582b59e653c9fe1ae Mon Sep 17 00:00:00 2001 From: rguenth Date: Wed, 15 Jul 2009 09:25:34 +0000 Subject: 2009-07-15 Richard Guenther PR middle-end/40753 * alias.c (ao_ref_from_mem): Reject FUNCTION_DECL and LABEL_DECL bases. * gcc.c-torture/compile/pr40753.c: New testcase. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@149664 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/alias.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'gcc/alias.c') diff --git a/gcc/alias.c b/gcc/alias.c index e9cc2d85f96..fc259b8ef2d 100644 --- a/gcc/alias.c +++ b/gcc/alias.c @@ -279,6 +279,11 @@ ao_ref_from_mem (ao_ref *ref, const_rtx mem) && TREE_CODE (TREE_OPERAND (base, 0)) != SSA_NAME) return false; + /* The tree oracle doesn't like to have these. */ + if (TREE_CODE (base) == FUNCTION_DECL + || TREE_CODE (base) == LABEL_DECL) + return false; + /* If this is a reference based on a partitioned decl replace the base with an INDIRECT_REF of the pointer representative we created during stack slot partitioning. */ -- cgit v1.2.1 From b95fdaae1b09febf9c76d7e68e34ee682bc90da9 Mon Sep 17 00:00:00 2001 From: abel Date: Wed, 12 Aug 2009 11:50:22 +0000 Subject: 2009-08-12 Andrey Belevantsev PR rtl-optimization/41033 * alias.c (nonoverlapping_component_refs_p): Punt if strict aliasing is disabled. 2009-08-12 Richard Guenther PR rtl-optimization/41033 * gcc.dg/pr41033.c: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@150680 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/alias.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'gcc/alias.c') diff --git a/gcc/alias.c b/gcc/alias.c index fc259b8ef2d..442be827a75 100644 --- a/gcc/alias.c +++ b/gcc/alias.c @@ -1980,6 +1980,9 @@ nonoverlapping_component_refs_p (const_tree x, const_tree y) { const_tree fieldx, fieldy, typex, typey, orig_y; + if (!flag_strict_aliasing) + return false; + do { /* The comparison has to be done at a common type, since we don't -- cgit v1.2.1 From dfe8e806805d4f3b1b396b195f7ecfba089b9b1a Mon Sep 17 00:00:00 2001 From: rguenth Date: Wed, 12 Aug 2009 15:10:47 +0000 Subject: 2009-08-12 Richard Guenther * alias.c (get_alias_set): Honor TYPE_STRUCTURAL_EQUALITY_P. * gimplify.c (gimplify_modify_expr): Do not use lang_hooks.types_compatible_p. * tree-ssa.c (useless_type_conversion_p): For aggregates just return false if the canonical types differ. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@150695 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/alias.c | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) (limited to 'gcc/alias.c') diff --git a/gcc/alias.c b/gcc/alias.c index 442be827a75..eaa127ec8e5 100644 --- a/gcc/alias.c +++ b/gcc/alias.c @@ -680,11 +680,20 @@ get_alias_set (tree t) } /* Variant qualifiers don't affect the alias set, so get the main - variant. Always use the canonical type as well. - If this is a type with a known alias set, return it. */ + variant. */ t = TYPE_MAIN_VARIANT (t); - if (TYPE_CANONICAL (t)) - t = TYPE_CANONICAL (t); + + /* Always use the canonical type as well. If this is a type that + requires structural comparisons to identify compatible types + use alias set zero. */ + if (TYPE_STRUCTURAL_EQUALITY_P (t)) + return 0; + t = TYPE_CANONICAL (t); + /* Canonical types shouldn't form a tree nor should the canonical + type require structural equality checks. */ + gcc_assert (!TYPE_STRUCTURAL_EQUALITY_P (t) && TYPE_CANONICAL (t) == t); + + /* If this is a type with a known alias set, return it. */ if (TYPE_ALIAS_SET_KNOWN_P (t)) return TYPE_ALIAS_SET (t); -- cgit v1.2.1 From eb241fe973b9160a1e25228289aee69476677da6 Mon Sep 17 00:00:00 2001 From: rguenth Date: Wed, 23 Sep 2009 15:40:55 +0000 Subject: 2009-09-23 Richard Guenther * alias.c (ao_ref_from_mem): Correct for negative MEM_OFFSET produced for bigendian targets with promoted subregs. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@152083 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/alias.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'gcc/alias.c') diff --git a/gcc/alias.c b/gcc/alias.c index eaa127ec8e5..6bb051e62b5 100644 --- a/gcc/alias.c +++ b/gcc/alias.c @@ -309,6 +309,18 @@ ao_ref_from_mem (ao_ref *ref, const_rtx mem) ref->offset = 0; ref->max_size = -1; } + else if (INTVAL (MEM_OFFSET (mem)) < 0 + && MEM_EXPR (mem) != get_spill_slot_decl (false)) + { + /* Negative MEM_OFFSET happens for promoted subregs on bigendian + targets. We need to compensate both the size and the offset here, + which get_ref_base_and_extent will have done based on the MEM_EXPR + already. */ + gcc_assert (((INTVAL (MEM_SIZE (mem)) + INTVAL (MEM_OFFSET (mem))) + * BITS_PER_UNIT) + == ref->size); + return true; + } else { ref->offset += INTVAL (MEM_OFFSET (mem)) * BITS_PER_UNIT; -- cgit v1.2.1 From 3804203d6ff7f19553bfc8c80642a6d2b9a97c12 Mon Sep 17 00:00:00 2001 From: rguenth Date: Tue, 29 Sep 2009 14:29:10 +0000 Subject: 2009-09-29 Richard Guenther * alias.c (ao_ref_from_mem): Properly deal with off decl accesses resulting from stack temporaries on STRICT_ALIGNMENT targets. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@152278 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/alias.c | 68 +++++++++++++++++++++++++++---------------------------------- 1 file changed, 30 insertions(+), 38 deletions(-) (limited to 'gcc/alias.c') diff --git a/gcc/alias.c b/gcc/alias.c index 6bb051e62b5..694498ab55a 100644 --- a/gcc/alias.c +++ b/gcc/alias.c @@ -265,6 +265,11 @@ ao_ref_from_mem (ao_ref *ref, const_rtx mem) if (!expr) return false; + /* If MEM_OFFSET or MEM_SIZE are NULL punt. */ + if (!MEM_OFFSET (mem) + || !MEM_SIZE (mem)) + return false; + ao_ref_init (ref, expr); /* Get the base of the reference and see if we have to reject or @@ -302,45 +307,32 @@ ao_ref_from_mem (ao_ref *ref, const_rtx mem) ref->ref_alias_set = MEM_ALIAS_SET (mem); - /* For NULL MEM_OFFSET the MEM_EXPR may have been stripped arbitrarily - without recording offset or extent adjustments properly. */ - if (MEM_OFFSET (mem) == NULL_RTX) - { - ref->offset = 0; - ref->max_size = -1; - } - else if (INTVAL (MEM_OFFSET (mem)) < 0 - && MEM_EXPR (mem) != get_spill_slot_decl (false)) - { - /* Negative MEM_OFFSET happens for promoted subregs on bigendian - targets. We need to compensate both the size and the offset here, - which get_ref_base_and_extent will have done based on the MEM_EXPR - already. */ - gcc_assert (((INTVAL (MEM_SIZE (mem)) + INTVAL (MEM_OFFSET (mem))) - * BITS_PER_UNIT) - == ref->size); - return true; - } - else - { - ref->offset += INTVAL (MEM_OFFSET (mem)) * BITS_PER_UNIT; - } + /* If the base decl is a parameter we can have negative MEM_OFFSET in + case of promoted subregs on bigendian targets. Trust the MEM_EXPR + here. */ + if (INTVAL (MEM_OFFSET (mem)) < 0 + && ((INTVAL (MEM_SIZE (mem)) + INTVAL (MEM_OFFSET (mem))) + * BITS_PER_UNIT) == ref->size) + return true; - /* NULL MEM_SIZE should not really happen with a non-NULL MEM_EXPR, - but just play safe here. The size may have been adjusted together - with the offset, so we need to take it if it is set and not rely - on MEM_EXPR here (which has the size determining parts potentially - stripped anyway). We lose precision for max_size which is only - available from the remaining MEM_EXPR. */ - if (MEM_SIZE (mem) == NULL_RTX) - { - ref->size = -1; - ref->max_size = -1; - } - else - { - ref->size = INTVAL (MEM_SIZE (mem)) * BITS_PER_UNIT; - } + ref->offset += INTVAL (MEM_OFFSET (mem)) * BITS_PER_UNIT; + ref->size = INTVAL (MEM_SIZE (mem)) * BITS_PER_UNIT; + + /* The MEM may extend into adjacent fields, so adjust max_size if + necessary. */ + if (ref->max_size != -1 + && ref->size > ref->max_size) + ref->max_size = ref->size; + + /* If MEM_OFFSET and MEM_SIZE get us outside of the base object of + the MEM_EXPR punt. This happens for STRICT_ALIGNMENT targets a lot. */ + if (MEM_EXPR (mem) != get_spill_slot_decl (false) + && (ref->offset < 0 + || (DECL_P (ref->base) + && (!host_integerp (DECL_SIZE (ref->base), 1) + || (TREE_INT_CST_LOW (DECL_SIZE ((ref->base))) + < (unsigned HOST_WIDE_INT)(ref->offset + ref->size)))))) + return false; return true; } -- cgit v1.2.1 From e58c17e7b132e005fd7f556135b03b1f0ef95f30 Mon Sep 17 00:00:00 2001 From: jsm28 Date: Fri, 23 Oct 2009 12:18:42 +0000 Subject: PR c/41673 * alias.c (get_alias_set): Call langhook before returning 0 for types with structural equality. * c-common.c (c_common_get_alias_set): Use alias set of element type for arrays with structural comparison. testsuite: * gcc.dg/Wstrict-aliasing-bogus-vla-1.c: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@153496 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/alias.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'gcc/alias.c') diff --git a/gcc/alias.c b/gcc/alias.c index 694498ab55a..09ec775c5d0 100644 --- a/gcc/alias.c +++ b/gcc/alias.c @@ -691,7 +691,14 @@ get_alias_set (tree t) requires structural comparisons to identify compatible types use alias set zero. */ if (TYPE_STRUCTURAL_EQUALITY_P (t)) - return 0; + { + /* Allow the language to specify another alias set for this + type. */ + set = lang_hooks.get_alias_set (t); + if (set != -1) + return set; + return 0; + } t = TYPE_CANONICAL (t); /* Canonical types shouldn't form a tree nor should the canonical type require structural equality checks. */ -- cgit v1.2.1 From bd1a81f7e1665d2e33cc824dd05dd7988da9f1a8 Mon Sep 17 00:00:00 2001 From: uweigand Date: Mon, 26 Oct 2009 21:55:59 +0000 Subject: 2009-10-26 Ben Elliston Michael Meissner Ulrich Weigand * doc/extend.texi (Named Address Spaces): New section. * coretypes.h (addr_space_t): New type. (ADDR_SPACE_GENERIC): New define. (ADDR_SPACE_GENERIC_P): New macro. * doc/tm.texi (Named Address Spaces): New section. (TARGET_ADDR_SPACE_LEGITIMATE_ADDRESS_P): Document. (TARGET_ADDR_SPACE_LEGITIMIZE_ADDRESS): Document. (TARGET_ADDR_SPACE_SUBSET_P): Document. (TARGET_ADDR_SPACE_CONVERT): Document. * target.h (struct gcc_target): Add addr_space substructure. * target-def.h (TARGET_ADDR_SPACE_LEGITIMATE_ADDRESS_P): Define. (TARGET_ADDR_SPACE_LEGITIMIZE_ADDRESS): Likewise. (TARGET_ADDR_SPACE_SUBSET_P): Likewise. (TARGET_ADDR_SPACE_CONVERT): Likewise. (TARGET_ADDR_SPACE_HOOKS): Likewise. (TARGET_INITIALIZER): Initialize addr_space hooks. * targhooks.c (default_addr_space_legitimate_address_p): New function. (default_addr_space_legitimize_address): Likewise. (default_addr_space_subset_p): Likewise. (default_addr_space_convert): Likewise. * targhooks.h (default_addr_space_legitimate_address_p): Add prototype. (default_addr_space_legitimize_address): Likewise. (default_addr_space_subset_p): Likewise. (default_addr_space_convert): Likewise. * doc/rtl.texi (MEM_ADDR_SPACE): Document. * rtl.h (mem_attrs): Add ADDRSPACE memory attribute. (MEM_ADDR_SPACE): New macro. * emit-rtl.c (get_mem_attrs): Add ADDRSPACE argument and set address space memory attribute. (mem_attrs_htab_hash): Handle address space memory attribute. (mem_attrs_htab_eq): Likewise. (set_mem_attributes_minus_bitpos): Likewise. (set_mem_alias_set): Likewise. (set_mem_align): Likewise. (set_mem_expr): Likewise. (set_mem_offset): Likewise. (set_mem_size): Likewise. (adjust_address_1): Likewise. (offset_address): Likewise. (widen_memoy_address): Likewise. (get_spill_slot_decl): Likewise. (set_mem_attrs_for_spill): Likewise. (set_mem_addr_space): New function. * emit-rtl.h (set_mem_addr_space): Add prototype. * print-rtl.c (print_rtx): Print address space memory attribute. * expr.c (expand_assignment): Set address space memory attribute of generated MEM RTXes as appropriate. (expand_expr_real_1): Likewise. * cfgexpand.c (expand_debug_expr): Likewise. * tree-ssa-loop-ivopts.c (produce_memory_decl_rtl): Likewise. * tree.h (struct tree_base): Add address_space bitfield. Reduce size of "spare" bitfield. (TYPE_ADDR_SPACE): New macro. (ENCODE_QUAL_ADDR_SPACE): Likewise. (DECODE_QUAL_ADDR_SPACE): Likewise. (CLEAR_QUAL_ADDR_SPACE): Likewise. (KEEP_QUAL_ADDR_SPACE): Likewise. (TYPE_QUALS): Encode type address space. (TYPE_QUALS_NO_ADDR_SPACE): New macro. * tree.c (set_type_quals): Set type address space. (build_array_type): Inherit array address space from element type. * print-tree.c (print_node_brief): Print type address space. (print_node): Likewise. * tree-pretty-print.c (dump_generic_node): Likewise. * explow.c (memory_address): Rename to ... (memory_address_addr_space): ... this. Add ADDRSPACE argument. Use address-space aware variants of memory address routines. * recog.c (memory_address_p): Rename to ... (memory_address_addr_space_p): ... this. Add ADDSPACE argument. Use address-space aware variants of memory address routines. (offsettable_address_p): Rename to ... (offsettable_address_addr_space_p): ... this. Add ADDRSPACE argument. Use address-space aware variants of memory address routines. * reload.c (strict_memory_address_p): Rename to ... (strict_memory_address_addr_space_p): ... this. Add ADDSPACE argument. Use address-space aware variants of memory address routines. (maybe_memory_address_p): Rename to ... (maybe_memory_address_addr_space_p): ... this. Add ADDSPACE argument. Use address-space aware variants of memory address routines. * expr.h (memory_address_addr_space): Add prototype. (memory_address): Define as macro. * recog.h (memory_address_addr_space_p): Add prototype. (memory_address_p): Define as macro. (offsettable_address_addr_space_p): Add prototype. (offsettable_address_p): Define as macro. (strict_memory_address_addr_space_p): Add prototype. (strict_memory_address_p): Define as macro. * combine.c (find_split_point): Use address-space aware variants of memory address routines. * emit-rtl.c (operand_subword): Likewise. (change_address_1): Likewise. (adjust_address_1): Likewise. (offset_address): Likewise. * expr.c (emit_move_insn): Likewise. (expand_assignment): Likewise. (expand_expr_real_1): Likewise. * recog.c (verify_changes): Likewise. (general_operand): Likewise. (offsettable_memref_p): Likewise. (offsettable_nonstrict_memref_p): Likewise. (constrain_operands): Likewise. * reload.c (get_secondary_mem): Likewise. (find_reloads_toplev): Likewise. (find_reloads_address): Likewise. (find_reloads_subreg_address): Likewise. * reload1.c (reload): Likewise. * rtlhooks.c (gen_lowpart_if_possible): Likewise. * rtl.h (address_cost): Add ADDRSPACE argument. * rtlanal.c (address_cost): Add ADDRSPACE argument. Use address-space aware variant of memory address routines. * loop-invariant.c (create_new_invariant): Update address_cost call. * tree-ssa-loop-ivopts.c (computation_cost): Likewise. * fwprop.c (should_replace_address): Add ADDRSPACE argument. Use address-space aware variant of memory address routines. (propagate_rtx_1): Update call to should_replace_address. * tree-flow.h (multiplier_allowed_in_address_p): Add ADDRSPACE argument. * tree-ssa-loop-ivopts.c (multiplier_allowed_in_address_p): Add ADDRSPACE argument. Use per-address-space instead of global cache. Use address-space aware variant of memory address routines. (get_address_cost): Likewise. (get_computation_cost_at): Update calls. * tree-ssa-address.c (valid_mem_ref_p): Add ADDRSPACE argument. Use address-space aware variant of memory address routines. (create_mem_ref_raw): Update call to valid_mem_ref_p. (most_expensive_mult_to_index): Update call to multiplier_allowed_in_address_p. * dwarf2out.c (modified_type_die): Output DW_AT_address_class attribute to indicate named address spaces. * varasm.c (get_variable_section): DECLs in named address spaces cannot be "common". * reload.c (find_reloads_address): Do not use LEGITIMIZE_RELOAD_ADDRESS for addresses in a non-generic address space. * expr.c (emit_block_move_hints): Do not use libcalls for memory in non-generic address spaces. (clear_storage_hints): Likewise. (expand_assignment): Likewise. * fold-const.c (operand_equal_p): Expressions refering to different address spaces are not equivalent. * rtl.c (rtx_equal_p_cb): MEMs refering to different address spaces are not equivalent. (rtx_equal_p): Likewise. * cse.c (exp_equiv_p): Likewise. * jump.c (rtx_renumbered_equal_p): Likewise. * reload.c (operands_match_p): Likewise. * alias.c (nonoverlapping_memrefs_p): MEMs refering to different address spaces may alias. (true_dependence): Likewise. (canon_true_dependence): Likewise. (write_dependence_p): Likewise. * dse.c (canon_address): Handle named address spaces. * ifcvt.c (noce_try_cmove_arith): Likewise. * tree.def (ADDR_SPACE_CONVERT_EXPR): New tree code. * expr.c (expand_expr_real_2): Expand ADDR_SPACE_CONVERT_EXPR. * convert.c (convert_to_pointer): Generate ADDR_SPACE_CONVERT_EXPR to handle conversions between different address spaces. * fold-const.c (fold_convert_loc): Likewise. (fold_unary_loc): Handle ADDR_SPACE_CONVERT_EXPR. * tree-pretty-print.c (dump_generic_node): Likewise. * gimple-pretty-print.c (dump_unary_rhs): Likewise. * tree-cfg.c (verify_gimple_assign_unary): Likewise. * tree-inline.c (estimate_operator_cost): Likewise. * tree-ssa.c (useless_type_conversion_p): Conversions between pointers to different address spaces are not useless. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@153572 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/alias.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'gcc/alias.c') diff --git a/gcc/alias.c b/gcc/alias.c index 09ec775c5d0..b6d0b7eccc5 100644 --- a/gcc/alias.c +++ b/gcc/alias.c @@ -2188,6 +2188,13 @@ nonoverlapping_memrefs_p (const_rtx x, const_rtx y) && ! rtx_equal_p (rtlx, rtly)) return 1; + /* If we have MEMs refering to different address spaces (which can + potentially overlap), we cannot easily tell from the addresses + whether the references overlap. */ + if (MEM_P (rtlx) && MEM_P (rtly) + && MEM_ADDR_SPACE (rtlx) != MEM_ADDR_SPACE (rtly)) + return 0; + /* Get the base and offsets of both decls. If either is a register, we know both are and are the same, so use that as the base. The only we can avoid overlap is if we can deduce that they are nonoverlapping @@ -2279,6 +2286,12 @@ true_dependence (const_rtx mem, enum machine_mode mem_mode, const_rtx x, if (nonoverlapping_memrefs_p (mem, x)) return 0; + /* If we have MEMs refering to different address spaces (which can + potentially overlap), we cannot easily tell from the addresses + whether the references overlap. */ + if (MEM_ADDR_SPACE (mem) != MEM_ADDR_SPACE (x)) + return 1; + if (mem_mode == VOIDmode) mem_mode = GET_MODE (mem); @@ -2356,6 +2369,12 @@ canon_true_dependence (const_rtx mem, enum machine_mode mem_mode, rtx mem_addr, if (nonoverlapping_memrefs_p (x, mem)) return 0; + /* If we have MEMs refering to different address spaces (which can + potentially overlap), we cannot easily tell from the addresses + whether the references overlap. */ + if (MEM_ADDR_SPACE (mem) != MEM_ADDR_SPACE (x)) + return 1; + if (! x_addr) x_addr = get_addr (XEXP (x, 0)); @@ -2416,6 +2435,12 @@ write_dependence_p (const_rtx mem, const_rtx x, int writep) if (nonoverlapping_memrefs_p (x, mem)) return 0; + /* If we have MEMs refering to different address spaces (which can + potentially overlap), we cannot easily tell from the addresses + whether the references overlap. */ + if (MEM_ADDR_SPACE (mem) != MEM_ADDR_SPACE (x)) + return 1; + x_addr = get_addr (XEXP (x, 0)); mem_addr = get_addr (XEXP (mem, 0)); -- cgit v1.2.1 From 98155838dbd82b97bb7bb16dfcbf98fa2ab27ca9 Mon Sep 17 00:00:00 2001 From: uweigand Date: Mon, 26 Oct 2009 21:57:10 +0000 Subject: 2009-10-26 Ben Elliston Michael Meissner Ulrich Weigand * doc/tm.texi (TARGET_ADDR_SPACE_POINTER_MODE): Document. (TARGET_ADDR_SPACE_ADDRESS_MODE): Likewise. (TARGET_ADDR_SPACE_VALID_POINTER_MODE): Likewise. * target.h (struct target_def): Add pointer_mode, address_mode, and valid_pointer_mode to addr_space substructure. * target-def.h (TARGET_ADDR_SPACE_POINTER_MODE): Define. (TARGET_ADDR_SPACE_ADDRESS_MODE): Likewise. (TARGET_ADDR_SPACE_VALID_POINTER_MODE): Likewise. (TARGET_ADDR_SPACE_HOOKS): Add them. * targhooks.c (target_default_pointer_address_modes_p): New function. * target.h (target_default_pointer_address_modes_p): Add prototype. * targhooks.c (default_addr_space_pointer_mode): New function. (default_addr_space_address_mode): Likewise. (default_addr_space_valid_pointer_mode): Likewise. * targhooks.h (default_addr_space_pointer_mode): Add prototype. (default_addr_space_address_mode): Likewise. (default_addr_space_valid_pointer_mode): Likewise. * output.h (default_valid_pointer_mode): Move to ... * targhooks.h (default_valid_pointer_mode): ... here. * varasm.c (default_valid_pointer_mode): Move to ... * targhooks.c (default_valid_pointer_mode): ... here. * varasm.c (output_constant): Use targetm.addr_space.valid_pointer_mode instead of targetm.valid_pointer_mode. * fold-const.c (fit_double_type): Use int_or_pointer_precision. * tree.c (integer_pow2p): Likewise. (tree_log2): Likewise. (tree_floor_log2): Likewise. (signed_or_unsigned_type_for): Support pointer type of different size. (int_or_pointer_precision): New function. * tree.h (int_or_pointer_precision): Add prototype. * stor-layout.c (layout_type): Set TYPE_PRECISION for offset types. * varasm.c (initializer_constant_valid_p): Use TYPE_PRECISION of incoming pointer type instead of POINTER_SIZE. * tree.c (build_pointer_type): Use appropriate pointer mode instead of ptr_mode. (build_reference_type): Likewise. * expr.c (store_expr): Likewise. (expand_expr_addr_expr): Likewise. * tree-vect-data-refs.c (vect_create_data_ref_ptr): Likewise. * cfgexpand.c (expand_debug_expr): Likewise. * auto-inc-dec.c: Include "target.h". (try_merge): Use appropriate address mode instead of Pmode. (find_inc): Likewise. * combine.c (find_split_point): Likewise. * cselib.c (cselib_record_sets): Likewise. * dse.c (replace_inc_dec): Likewise. (canon_address): Likewise. * var-tracking.c (replace_expr_with_values): Likewise. (count_uses): Likewise. (add_uses): Likewise. (add_stores): Likewise. * emit-rtl.c: Include "target.h". (adjust_address_1): Use appropriate address mode instead of Pmode. (offset_address): Likewise. * explow.c (break_out_memory_refs): Likewise. (memory_address_addr_space): Likewise. (promote_mode): Likewise. * expr.c (move_by_pieces): Likewise. (emit_block_move_via_loop): Likewise. (store_by_pieces): Likewise. (store_by_pieces_1): Likewise. (expand_assignment): Likewise. (store_constructor): Likewise. (expand_expr_addr_expr): Likewise. (expand_expr_real_1): Likewise. * cfgexpand.c (expand_debug_expr): Likewise. * ifcvt.c (noce_try_cmove_arith): Likewise. * regcprop.c (kill_autoinc_value): Likewise. * regmove.c (try_auto_increment): Likewise. * reload.c (find_reloads): Likewise. (find_reloads_address): Likewise. (find_reloads_address_1): Likewise. * sched-deps.c: Include "target.h". (sched_analyze_1): Use appropriate address mode instead of Pmode. (sched_analyze_2): Likewise. * sel-sched-dump.c: Include "target.h". (debug_mem_addr_value): Use appropriate address mode instead of Pmode. * stor-layout.c (layout_type): Likewise. * tree-ssa-loop-ivopts.c (produce_memory_decl_rtl): Likewise. (multiplier_allowed_in_address_p): Likewise. (get_address_cost): Likewise. * varasm.c (make_decl_rtl): Likewise. * expr.c (expand_assignment): Always convert offsets to appropriate address mode. (store_expr): Likewise. (store_constructor): Likewise. (expand_expr_real_1): Likewise. * reload.h (form_sum): Add MODE argument. * reload.c (form_sum): Add MODE argument, use it instead of Pmode. Update recursive calls. (subst_indexed_address): Update calls to form_sum. * tree-flow.h (addr_for_mem_ref): Add ADDRSPACE argument. * tree-ssa-address.c: Include "target.h". (templates): Replace by ... (mem_addr_template_list): ... this new vector. (TEMPL_IDX): Handle address space numbers. (gen_addr_rtx): Add address mode argument, use it instead of Pmode. (addr_for_mem_ref): Add ADDRSPACE argument. Use per-address-space instead of global cache. Update call to gen_addr_rtx. (valid_mem_ref_p): Update call to addr_for_mem_ref. * expr.c (expand_expr_real_1): Update call to addr_for_mem_ref. * rtl.h (convert_memory_address_addr_space): Add prototype. (convert_memory_address): Define as macro. * explow.c (convert_memory_address): Rename to ... (convert_memory_address_addr_space): ... this. Add ADDRSPACE argument. Use appropriate pointer and address modes instead of ptr_mode / Pmode. Update recursive calls. (memory_address_addr_space): Call convert_memory_address_addr_space. * expmed.c (make_tree): Likewise. * expr.c (expand_assignment): Likewise. (expand_expr_addr_expr_1): Likewise. Also, add ADDRSPACE argument. (expand_expr_addr_expr): Likewise. Also, update call. * alias.c (find_base_value): Guard pointer size optimizations. (find_base_term): Likewise. * rtlanal.c (nonzero_bits1): Likewise. (num_sign_bit_copies1): Likewise. * simplify-rtx.c (simplify_unary_operation_1): Likewise. * Makefile.in (tree-ssa-address.o): Add $(TARGET_H) dependency. (emit-rtl.o): Likewise. (auto-inc-dec.o): Likewise. (sched-deps.o): Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@153573 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/alias.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'gcc/alias.c') diff --git a/gcc/alias.c b/gcc/alias.c index b6d0b7eccc5..40226f26b17 100644 --- a/gcc/alias.c +++ b/gcc/alias.c @@ -1060,6 +1060,11 @@ find_base_value (rtx src) return 0; case TRUNCATE: + /* As we do not know which address space the pointer is refering to, we can + handle this only if the target does not support different pointer or + address modes depending on the address space. */ + if (!target_default_pointer_address_modes_p ()) + break; if (GET_MODE_SIZE (GET_MODE (src)) < GET_MODE_SIZE (Pmode)) break; /* Fall through. */ @@ -1074,6 +1079,12 @@ find_base_value (rtx src) case ZERO_EXTEND: case SIGN_EXTEND: /* used for NT/Alpha pointers */ + /* As we do not know which address space the pointer is refering to, we can + handle this only if the target does not support different pointer or + address modes depending on the address space. */ + if (!target_default_pointer_address_modes_p ()) + break; + { rtx temp = find_base_value (XEXP (src, 0)); @@ -1466,6 +1477,11 @@ find_base_term (rtx x) return REG_BASE_VALUE (x); case TRUNCATE: + /* As we do not know which address space the pointer is refering to, we can + handle this only if the target does not support different pointer or + address modes depending on the address space. */ + if (!target_default_pointer_address_modes_p ()) + return 0; if (GET_MODE_SIZE (GET_MODE (x)) < GET_MODE_SIZE (Pmode)) return 0; /* Fall through. */ @@ -1480,6 +1496,12 @@ find_base_term (rtx x) case ZERO_EXTEND: case SIGN_EXTEND: /* Used for Alpha/NT pointers */ + /* As we do not know which address space the pointer is refering to, we can + handle this only if the target does not support different pointer or + address modes depending on the address space. */ + if (!target_default_pointer_address_modes_p ()) + return 0; + { rtx temp = find_base_term (XEXP (x, 0)); -- cgit v1.2.1 From 119147d12d323bafa652a1dff5962c9a1b800bd7 Mon Sep 17 00:00:00 2001 From: rguenth Date: Wed, 28 Oct 2009 13:28:32 +0000 Subject: 2009-10-28 Richard Guenther PR middle-end/41855 * tree-ssa-alias.c (refs_may_alias_p_1): Deal with CONST_DECLs (ref_maybe_used_by_call_p_1): Fix bcopy handling. (call_may_clobber_ref_p_1): Likewise. * tree-ssa-structalias.c (find_func_aliases): Likewise. * alias.c (nonoverlapping_memrefs_p): Deal with CONST_DECLs. * gfortran.dg/lto/20091028-1_0.f90: New testcase. * gfortran.dg/lto/20091028-1_1.c: Likewise. * gfortran.dg/lto/20091028-2_0.f90: Likewise. * gfortran.dg/lto/20091028-2_1.c: Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@153655 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/alias.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'gcc/alias.c') diff --git a/gcc/alias.c b/gcc/alias.c index 40226f26b17..1d4290f7848 100644 --- a/gcc/alias.c +++ b/gcc/alias.c @@ -2200,6 +2200,13 @@ nonoverlapping_memrefs_p (const_rtx x, const_rtx y) if (! DECL_P (exprx) || ! DECL_P (expry)) return 0; + /* With invalid code we can end up storing into the constant pool. + Bail out to avoid ICEing when creating RTL for this. + See gfortran.dg/lto/20091028-2_0.f90. */ + if (TREE_CODE (exprx) == CONST_DECL + || TREE_CODE (expry) == CONST_DECL) + return 1; + rtlx = DECL_RTL (exprx); rtly = DECL_RTL (expry); -- cgit v1.2.1 From 38e63987977ef34bd0f598c7f35d4cc35c04ba81 Mon Sep 17 00:00:00 2001 From: ebotcazou Date: Sun, 1 Nov 2009 22:12:07 +0000 Subject: * tree.def (TARGET_MEM_REF): Update comment. * alias.c (get_alias_set): Retrieve the original memory reference for a TARGET_MEM_REF before proceeding. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@153796 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/alias.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'gcc/alias.c') diff --git a/gcc/alias.c b/gcc/alias.c index 1d4290f7848..cdfa6d2d3ac 100644 --- a/gcc/alias.c +++ b/gcc/alias.c @@ -640,7 +640,7 @@ get_alias_set (tree t) aren't types. */ if (! TYPE_P (t)) { - tree inner = t; + tree inner; /* Remove any nops, then give the language a chance to do something with this tree before we look at it. */ @@ -649,8 +649,13 @@ get_alias_set (tree t) if (set != -1) return set; + /* Retrieve the original memory reference if needed. */ + if (TREE_CODE (t) == TARGET_MEM_REF) + t = TMR_ORIGINAL (t); + /* First see if the actual object referenced is an INDIRECT_REF from a restrict-qualified pointer or a "void *". */ + inner = t; while (handled_component_p (inner)) { inner = TREE_OPERAND (inner, 0); -- cgit v1.2.1 From 48e1416a24d50cacbb2a5e06a9ee61dd8cbee313 Mon Sep 17 00:00:00 2001 From: hjl Date: Wed, 25 Nov 2009 10:55:54 +0000 Subject: Remove trailing white spaces. 2009-11-25 H.J. Lu * alias.c: Remove trailing white spaces. * alloc-pool.c: Likewise. * alloc-pool.h: Likewise. * attribs.c: Likewise. * auto-inc-dec.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * bt-load.c: Likewise. * builtins.c: Likewise. * builtins.def: Likewise. * c-common.c: Likewise. * c-common.h: Likewise. * c-cppbuiltin.c: Likewise. * c-decl.c: Likewise. * c-format.c: Likewise. * c-lex.c: Likewise. * c-omp.c: Likewise. * c-opts.c: Likewise. * c-parser.c: Likewise. * c-pretty-print.c: Likewise. * c-tree.h: Likewise. * c-typeck.c: Likewise. * caller-save.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfglayout.c: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphbuild.c: Likewise. * cgraphunit.c: Likewise. * cif-code.def: Likewise. * collect2.c: Likewise. * combine.c: Likewise. * convert.c: Likewise. * coverage.c: Likewise. * crtstuff.c: Likewise. * cse.c: Likewise. * cselib.c: Likewise. * dbgcnt.c: Likewise. * dbgcnt.def: Likewise. * dbgcnt.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * ddg.c: Likewise. * ddg.h: Likewise. * defaults.h: Likewise. * df-byte-scan.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * df.h: Likewise. * dfp.c: Likewise. * diagnostic.c: Likewise. * diagnostic.h: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * double-int.c: Likewise. * double-int.h: Likewise. * dse.c: Likewise. * dwarf2asm.c: Likewise. * dwarf2asm.h: Likewise. * dwarf2out.c: Likewise. * ebitmap.c: Likewise. * ebitmap.h: Likewise. * emit-rtl.c: Likewise. * et-forest.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expmed.c: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * flags.h: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcov-dump.c: Likewise. * gcov-io.c: Likewise. * gcov-io.h: Likewise. * gcov.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genchecksum.c: Likewise. * genconfig.c: Likewise. * genflags.c: Likewise. * gengtype-parse.c: Likewise. * gengtype.c: Likewise. * gengtype.h: Likewise. * genmddeps.c: Likewise. * genmodes.c: Likewise. * genopinit.c: Likewise. * genpreds.c: Likewise. * gensupport.c: Likewise. * ggc-common.c: Likewise. * ggc-page.c: Likewise. * ggc-zone.c: Likewise. * ggc.h: Likewise. * gimple-iterator.c: Likewise. * gimple-low.c: Likewise. * gimple-pretty-print.c: Likewise. * gimple.c: Likewise. * gimple.def: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graphds.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * gthr-nks.h: Likewise. * gthr-posix.c: Likewise. * gthr-posix.h: Likewise. * gthr-posix95.h: Likewise. * gthr-single.h: Likewise. * gthr-tpf.h: Likewise. * gthr-vxworks.h: Likewise. * gthr.h: Likewise. * haifa-sched.c: Likewise. * hard-reg-set.h: Likewise. * hooks.c: Likewise. * hooks.h: Likewise. * hosthooks.h: Likewise. * hwint.h: Likewise. * ifcvt.c: Likewise. * incpath.c: Likewise. * init-regs.c: Likewise. * integrate.c: Likewise. * ipa-cp.c: Likewise. * ipa-inline.c: Likewise. * ipa-prop.c: Likewise. * ipa-pure-const.c: Likewise. * ipa-reference.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-struct-reorg.h: Likewise. * ipa-type-escape.c: Likewise. * ipa-type-escape.h: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-conflicts.c: Likewise. * ira-costs.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira-lives.c: Likewise. * ira.c: Likewise. * jump.c: Likewise. * lambda-code.c: Likewise. * lambda-mat.c: Likewise. * lambda-trans.c: Likewise. * lambda.h: Likewise. * langhooks.c: Likewise. * lcm.c: Likewise. * libgcov.c: Likewise. * lists.c: Likewise. * loop-doloop.c: Likewise. * loop-init.c: Likewise. * loop-invariant.c: Likewise. * loop-iv.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lto-cgraph.c: Likewise. * lto-compress.c: Likewise. * lto-opts.c: Likewise. * lto-section-in.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * lto-wpa-fixup.c: Likewise. * matrix-reorg.c: Likewise. * mcf.c: Likewise. * mode-switching.c: Likewise. * modulo-sched.c: Likewise. * omega.c: Likewise. * omega.h: Likewise. * omp-low.c: Likewise. * optabs.c: Likewise. * optabs.h: Likewise. * opts-common.c: Likewise. * opts.c: Likewise. * params.def: Likewise. * params.h: Likewise. * passes.c: Likewise. * plugin.c: Likewise. * postreload-gcse.c: Likewise. * postreload.c: Likewise. * predict.c: Likewise. * predict.def: Likewise. * pretty-print.c: Likewise. * pretty-print.h: Likewise. * print-rtl.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * read-rtl.c: Likewise. * real.c: Likewise. * recog.c: Likewise. * reg-stack.c: Likewise. * regcprop.c: Likewise. * reginfo.c: Likewise. * regmove.c: Likewise. * regrename.c: Likewise. * regs.h: Likewise. * regstat.c: Likewise. * reload.c: Likewise. * reload1.c: Likewise. * resource.c: Likewise. * rtl.c: Likewise. * rtl.def: Likewise. * rtl.h: Likewise. * rtlanal.c: Likewise. * sbitmap.c: Likewise. * sched-deps.c: Likewise. * sched-ebb.c: Likewise. * sched-int.h: Likewise. * sched-rgn.c: Likewise. * sched-vis.c: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-dump.h: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sel-sched.h: Likewise. * sese.c: Likewise. * sese.h: Likewise. * simplify-rtx.c: Likewise. * stack-ptr-mod.c: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * stringpool.c: Likewise. * stub-objc.c: Likewise. * sync-builtins.def: Likewise. * target-def.h: Likewise. * target.h: Likewise. * targhooks.c: Likewise. * targhooks.h: Likewise. * timevar.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * toplev.h: Likewise. * tracer.c: Likewise. * tree-affine.c: Likewise. * tree-affine.h: Likewise. * tree-browser.def: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-dump.c: Likewise. * tree-dump.h: Likewise. * tree-eh.c: Likewise. * tree-flow-inline.h: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-into-ssa.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-loop-linear.c: Likewise. * tree-mudflap.c: Likewise. * tree-nested.c: Likewise. * tree-nomudflap.c: Likewise. * tree-nrv.c: Likewise. * tree-object-size.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-pass.h: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-profile.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-copy.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-dse.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-operands.h: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sink.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-tailcall.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.def: Likewise. * tree.h: Likewise. * treestruct.def: Likewise. * unwind-compat.c: Likewise. * unwind-dw2-fde-glibc.c: Likewise. * unwind-dw2.c: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vec.c: Likewise. * vec.h: Likewise. * vmsdbgout.c: Likewise. * web.c: Likewise. * xcoffout.c: Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@154645 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/alias.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'gcc/alias.c') diff --git a/gcc/alias.c b/gcc/alias.c index cdfa6d2d3ac..41a2f2318f7 100644 --- a/gcc/alias.c +++ b/gcc/alias.c @@ -452,8 +452,8 @@ walk_mems_2 (rtx *x, rtx mem) { if (alias_sets_conflict_p (MEM_ALIAS_SET(*x), MEM_ALIAS_SET(mem))) return 1; - - return -1; + + return -1; } return 0; } @@ -467,7 +467,7 @@ walk_mems_1 (rtx *x, rtx *pat) if (for_each_rtx (pat, (rtx_function) walk_mems_2, *x)) /* Indicate that dependence was determined and stop traversal. */ return 1; - + return -1; } return 0; -- cgit v1.2.1 From 40f9e245ee4986ab7dd13df3c0a480437a564810 Mon Sep 17 00:00:00 2001 From: rguenth Date: Tue, 16 Feb 2010 10:01:51 +0000 Subject: 2010-02-16 Richard Guenther * alias.c (memrefs_conflict_p): Distinguish must-alias from don't know. (true_dependence): If memrefs_conflict_p computes must-alias trust it. Move TBAA check after offset-based disambiguation. (canon_true_dependence): Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@156797 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/alias.c | 73 ++++++++++++++++++++++++++++++++++++------------------------- 1 file changed, 43 insertions(+), 30 deletions(-) (limited to 'gcc/alias.c') diff --git a/gcc/alias.c b/gcc/alias.c index 41a2f2318f7..71a34a29265 100644 --- a/gcc/alias.c +++ b/gcc/alias.c @@ -1759,8 +1759,12 @@ addr_side_effect_eval (rtx addr, int size, int n_refs) return addr; } -/* Return nonzero if X and Y (memory addresses) could reference the - same location in memory. C is an offset accumulator. When +/* Return one if X and Y (memory addresses) reference the + same location in memory or if the references overlap. + Return zero if they do not overlap, else return + minus one in which case they still might reference the same location. + + C is an offset accumulator. When C is nonzero, we are testing aliases between X and Y + C. XSIZE is the size in bytes of the X reference, similarly YSIZE is the size in bytes for Y. @@ -1775,7 +1779,11 @@ addr_side_effect_eval (rtx addr, int size, int n_refs) align memory references, as is done on the Alpha. Nice to notice that varying addresses cannot conflict with fp if no - local variables had their addresses taken, but that's too hard now. */ + local variables had their addresses taken, but that's too hard now. + + ??? Contrary to the tree alias oracle this does not return + one for X + non-constant and Y + non-constant when X and Y are equal. + If that is fixed the TBAA hack for union type-punning can be removed. */ static int memrefs_conflict_p (int xsize, rtx x, int ysize, rtx y, HOST_WIDE_INT c) @@ -1841,7 +1849,7 @@ memrefs_conflict_p (int xsize, rtx x, int ysize, rtx y, HOST_WIDE_INT c) else if (CONST_INT_P (y1)) return memrefs_conflict_p (xsize, x, ysize, y0, c + INTVAL (y1)); - return 1; + return -1; } else if (CONST_INT_P (x1)) return memrefs_conflict_p (xsize, x0, ysize, y, c - INTVAL (x1)); @@ -1856,7 +1864,7 @@ memrefs_conflict_p (int xsize, rtx x, int ysize, rtx y, HOST_WIDE_INT c) if (CONST_INT_P (y1)) return memrefs_conflict_p (xsize, x, ysize, y0, c + INTVAL (y1)); else - return 1; + return -1; } if (GET_CODE (x) == GET_CODE (y)) @@ -1871,7 +1879,7 @@ memrefs_conflict_p (int xsize, rtx x, int ysize, rtx y, HOST_WIDE_INT c) rtx x1 = canon_rtx (XEXP (x, 1)); rtx y1 = canon_rtx (XEXP (y, 1)); if (! rtx_equal_for_memref_p (x1, y1)) - return 1; + return -1; x0 = canon_rtx (XEXP (x, 0)); y0 = canon_rtx (XEXP (y, 0)); if (rtx_equal_for_memref_p (x0, y0)) @@ -1880,7 +1888,7 @@ memrefs_conflict_p (int xsize, rtx x, int ysize, rtx y, HOST_WIDE_INT c) /* Can't properly adjust our sizes. */ if (!CONST_INT_P (x1)) - return 1; + return -1; xsize /= INTVAL (x1); ysize /= INTVAL (x1); c /= INTVAL (x1); @@ -1939,9 +1947,10 @@ memrefs_conflict_p (int xsize, rtx x, int ysize, rtx y, HOST_WIDE_INT c) || (rtx_equal_for_memref_p (x, y) && ((c >= 0 && xsize > c) || (c < 0 && ysize+c > 0)))); - return 1; + return -1; } - return 1; + + return -1; } /* Functions to compute memory dependencies. @@ -2294,6 +2303,7 @@ true_dependence (const_rtx mem, enum machine_mode mem_mode, const_rtx x, { rtx x_addr, mem_addr; rtx base; + int ret; if (MEM_VOLATILE_P (x) && MEM_VOLATILE_P (mem)) return 1; @@ -2308,18 +2318,12 @@ true_dependence (const_rtx mem, enum machine_mode mem_mode, const_rtx x, || MEM_ALIAS_SET (mem) == ALIAS_SET_MEMORY_BARRIER) return 1; - if (DIFFERENT_ALIAS_SETS_P (x, mem)) - return 0; - /* Read-only memory is by definition never modified, and therefore can't conflict with anything. We don't expect to find read-only set on MEM, but stupid user tricks can produce them, so don't die. */ if (MEM_READONLY_P (x)) return 0; - if (nonoverlapping_memrefs_p (mem, x)) - return 0; - /* If we have MEMs refering to different address spaces (which can potentially overlap), we cannot easily tell from the addresses whether the references overlap. */ @@ -2344,8 +2348,14 @@ true_dependence (const_rtx mem, enum machine_mode mem_mode, const_rtx x, x_addr = canon_rtx (x_addr); mem_addr = canon_rtx (mem_addr); - if (! memrefs_conflict_p (GET_MODE_SIZE (mem_mode), mem_addr, - SIZE_FOR_MODE (x), x_addr, 0)) + if ((ret = memrefs_conflict_p (GET_MODE_SIZE (mem_mode), mem_addr, + SIZE_FOR_MODE (x), x_addr, 0)) != -1) + return ret; + + if (DIFFERENT_ALIAS_SETS_P (x, mem)) + return 0; + + if (nonoverlapping_memrefs_p (mem, x)) return 0; if (aliases_everything_p (x)) @@ -2378,6 +2388,8 @@ int canon_true_dependence (const_rtx mem, enum machine_mode mem_mode, rtx mem_addr, const_rtx x, rtx x_addr, bool (*varies) (const_rtx, bool)) { + int ret; + if (MEM_VOLATILE_P (x) && MEM_VOLATILE_P (mem)) return 1; @@ -2391,18 +2403,12 @@ canon_true_dependence (const_rtx mem, enum machine_mode mem_mode, rtx mem_addr, || MEM_ALIAS_SET (mem) == ALIAS_SET_MEMORY_BARRIER) return 1; - if (DIFFERENT_ALIAS_SETS_P (x, mem)) - return 0; - /* Read-only memory is by definition never modified, and therefore can't conflict with anything. We don't expect to find read-only set on MEM, but stupid user tricks can produce them, so don't die. */ if (MEM_READONLY_P (x)) return 0; - if (nonoverlapping_memrefs_p (x, mem)) - return 0; - /* If we have MEMs refering to different address spaces (which can potentially overlap), we cannot easily tell from the addresses whether the references overlap. */ @@ -2416,8 +2422,14 @@ canon_true_dependence (const_rtx mem, enum machine_mode mem_mode, rtx mem_addr, return 0; x_addr = canon_rtx (x_addr); - if (! memrefs_conflict_p (GET_MODE_SIZE (mem_mode), mem_addr, - SIZE_FOR_MODE (x), x_addr, 0)) + if ((ret = memrefs_conflict_p (GET_MODE_SIZE (mem_mode), mem_addr, + SIZE_FOR_MODE (x), x_addr, 0)) != -1) + return ret; + + if (DIFFERENT_ALIAS_SETS_P (x, mem)) + return 0; + + if (nonoverlapping_memrefs_p (x, mem)) return 0; if (aliases_everything_p (x)) @@ -2448,6 +2460,7 @@ write_dependence_p (const_rtx mem, const_rtx x, int writep) rtx x_addr, mem_addr; const_rtx fixed_scalar; rtx base; + int ret; if (MEM_VOLATILE_P (x) && MEM_VOLATILE_P (mem)) return 1; @@ -2466,9 +2479,6 @@ write_dependence_p (const_rtx mem, const_rtx x, int writep) if (!writep && MEM_READONLY_P (mem)) return 0; - if (nonoverlapping_memrefs_p (x, mem)) - return 0; - /* If we have MEMs refering to different address spaces (which can potentially overlap), we cannot easily tell from the addresses whether the references overlap. */ @@ -2494,8 +2504,11 @@ write_dependence_p (const_rtx mem, const_rtx x, int writep) x_addr = canon_rtx (x_addr); mem_addr = canon_rtx (mem_addr); - if (!memrefs_conflict_p (SIZE_FOR_MODE (mem), mem_addr, - SIZE_FOR_MODE (x), x_addr, 0)) + if ((ret = memrefs_conflict_p (SIZE_FOR_MODE (mem), mem_addr, + SIZE_FOR_MODE (x), x_addr, 0)) != -1) + return ret; + + if (nonoverlapping_memrefs_p (x, mem)) return 0; fixed_scalar -- cgit v1.2.1 From 7cf0dbf3e5eee1286c76c26a836622c9c9974736 Mon Sep 17 00:00:00 2001 From: steven Date: Fri, 2 Apr 2010 19:54:46 +0000 Subject: * ada/gcc-interface/Make-lang.in, alias.c, attribs.c, auto-inc-dec.c, basic-block.h, bb-reorder.c, calls.c, c-common.c, cgraph.h, collect2.h, config/alpha/alpha.c, config/alpha/alpha.md, config/alpha/predicates.md, config/arm/arm.md, config/arm/lib1funcs.asm, config/arm/neon-schedgen.ml, config/avr/avr.c, config/avr/avr.md, config/bfin/bfin.c, config/darwin9.h, config/darwin.c, config/darwin.h, config/h8300/h8300.c, config/i386/cpuid.h, config/i386/cygming.h, config/i386/cygwin.h, config/i386/mingw32.h, config/i386/msformat-c.c, config/i386/sol2-10.h, config/i386/xopintrin.h, config/ia64/ia64.c, config/ia64/ia64.md, config/ia64/sync.md, config/mep/mep.c, config/mips/mips.md, config/mn10300/mn10300.c, config/mn10300/mn10300.h, config/pa/pa.c, config/pa/pa.md, config/rs6000/aix.h, config/rs6000/dfp.md, config/rs6000/rs6000-builtin.def, config/rs6000/rs6000-c.c, config/rs6000/vector.md, config/rtems.h, config/rx/rx.md, config/s390/s390.md, config/sol2-c.c, config/sparc/sol2-bi.h, config/sparc/sol2-gas.h, config/sparc/sparc.h, config/sparc/sparc.md, config/sparc/sparc-protos.h, config/spu/spu.c, config/spu/spu-c.c, config/t-darwin, convert.c, c.opt, c-opts.c, cp/Make-lang.in, c-pretty-print.c, c-typeck.c, df-core.c, df-scan.c, diagnostic.c, diagnostic.h, doc/cppopts.texi, doc/cpp.texi, doc/extend.texi, doc/gimple.texi, doc/languages.texi, doc/plugins.texi, doc/rtl.texi, doc/standards.texi, doc/tree-ssa.texi, doc/trouble.texi, dominance.c, fold-const.c, fortran/Make-lang.in, fwprop.c, gcc-plugin.h, gensupport.c, gimple.h, gimple-iterator.c, graphite.c, graphite-clast-to-gimple.c, graphite-clast-to-gimple.h, graphite-dependences.c, graphite-poly.c, graphite-poly.h, graphite-ppl.c, graphite-ppl.h, graphite-scop-detection.c, graphite-sese-to-poly.c, graphite-sese-to-poly.h, ifcvt.c, intl.c, intl.h, ipa.c, ipa-cp.c, ipa-inline.c, ipa-prop.c, ipa-prop.h, ipa-pure-const.c, ipa-reference.c, ipa-type-escape.c, ira-color.c, ira-conflicts.c, ira-lives.c, java/Make-lang.in, lambda-code.c, loop-invariant.c, lto/Make-lang.in, lto-streamer.h, lto-streamer-in.c, objc/Make-lang.in, objcp/Make-lang.in, omp-low.c, optc-gen.awk, opt-functions.awk, opth-gen.awk, params.def, passes.c, postreload-gcse.c, print-tree.c, recog.c, regrename.c, reload.h, rtl.def, sched-int.h, sched-rgn.c, sel-sched-dump.c, sese.c, sese.h, store-motion.c, stor-layout.c, tree-cfgcleanup.c, tree-chrec.c, tree-complex.c, tree-data-ref.c, tree.def, tree-eh.c, tree-flow.h, tree-flow-inline.h, tree.h, tree-loop-distribution.c, tree-outof-ssa.c, tree-parloops.c, tree-pass.h, tree-predcom.c, tree-profile.c, tree-scalar-evolution.c, tree-ssa-address.c, tree-ssa-alias.c, tree-ssa-coalesce.c, tree-ssa-copy.c, tree-ssa-dce.c, tree-ssa-dom.c, tree-ssa-dse.c, tree-ssa-loop-im.c, tree-ssa-loop-ivcanon.c, tree-ssa-loop-manip.c, tree-ssa-math-opts.c, tree-ssa-operands.c, tree-ssa-pre.c, tree-ssa-sccvn.c, tree-ssa-structalias.c, tree-ssa-uncprop.c, tree-tailcall.c, tree-vect-data-refs.c, tree-vect-loop.c, tree-vectorizer.h, tree-vect-slp.c, tree-vrp.c, unwind-dw2-fde-darwin.c, varpool.c: Update copyright years. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@157950 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/alias.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gcc/alias.c') diff --git a/gcc/alias.c b/gcc/alias.c index 71a34a29265..317aeba5503 100644 --- a/gcc/alias.c +++ b/gcc/alias.c @@ -1,6 +1,6 @@ /* Alias analysis for GNU C Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, - 2007, 2008, 2009 Free Software Foundation, Inc. + 2007, 2008, 2009, 2010 Free Software Foundation, Inc. Contributed by John Carr (jfc@mit.edu). This file is part of GCC. -- cgit v1.2.1 From c6b80e5d0234fd1852219d2b629172d39eebe3d0 Mon Sep 17 00:00:00 2001 From: rguenth Date: Sat, 3 Apr 2010 17:14:44 +0000 Subject: 2010-04-03 Richard Guenther PR middle-end/42509 * alias.c (nonoverlapping_memrefs_p): For spill-slot accesses require a non-NULL MEM_OFFSET. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@157954 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/alias.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'gcc/alias.c') diff --git a/gcc/alias.c b/gcc/alias.c index 317aeba5503..cd7e2a06bdb 100644 --- a/gcc/alias.c +++ b/gcc/alias.c @@ -2147,6 +2147,13 @@ nonoverlapping_memrefs_p (const_rtx x, const_rtx y) if (exprx == 0 || expry == 0) return 0; + /* For spill-slot accesses make sure we have valid offsets. */ + if ((exprx == get_spill_slot_decl (false) + && ! MEM_OFFSET (x)) + || (expry == get_spill_slot_decl (false) + && ! MEM_OFFSET (y))) + return 0; + /* If both are field references, we may be able to determine something. */ if (TREE_CODE (exprx) == COMPONENT_REF && TREE_CODE (expry) == COMPONENT_REF -- cgit v1.2.1 From 1f1e1860379dd2300f78ad371c56209a72cac447 Mon Sep 17 00:00:00 2001 From: rguenth Date: Wed, 7 Apr 2010 10:14:17 +0000 Subject: 2010-04-07 Richard Guenther PR middle-end/42617 * alias.c (ao_ref_from_mem): Without MEM_OFFSET or MEM_SIZE preserve points-to related information. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@158046 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/alias.c | 27 +++++++++++++++++---------- 1 file changed, 17 insertions(+), 10 deletions(-) (limited to 'gcc/alias.c') diff --git a/gcc/alias.c b/gcc/alias.c index cd7e2a06bdb..19a8292b454 100644 --- a/gcc/alias.c +++ b/gcc/alias.c @@ -265,11 +265,6 @@ ao_ref_from_mem (ao_ref *ref, const_rtx mem) if (!expr) return false; - /* If MEM_OFFSET or MEM_SIZE are NULL punt. */ - if (!MEM_OFFSET (mem) - || !MEM_SIZE (mem)) - return false; - ao_ref_init (ref, expr); /* Get the base of the reference and see if we have to reject or @@ -278,17 +273,17 @@ ao_ref_from_mem (ao_ref *ref, const_rtx mem) if (base == NULL_TREE) return false; + /* The tree oracle doesn't like to have these. */ + if (TREE_CODE (base) == FUNCTION_DECL + || TREE_CODE (base) == LABEL_DECL) + return false; + /* If this is a pointer dereference of a non-SSA_NAME punt. ??? We could replace it with a pointer to anything. */ if (INDIRECT_REF_P (base) && TREE_CODE (TREE_OPERAND (base, 0)) != SSA_NAME) return false; - /* The tree oracle doesn't like to have these. */ - if (TREE_CODE (base) == FUNCTION_DECL - || TREE_CODE (base) == LABEL_DECL) - return false; - /* If this is a reference based on a partitioned decl replace the base with an INDIRECT_REF of the pointer representative we created during stack slot partitioning. */ @@ -307,6 +302,18 @@ ao_ref_from_mem (ao_ref *ref, const_rtx mem) ref->ref_alias_set = MEM_ALIAS_SET (mem); + /* If MEM_OFFSET or MEM_SIZE are NULL we have to punt. + Keep points-to related information though. */ + if (!MEM_OFFSET (mem) + || !MEM_SIZE (mem)) + { + ref->ref = NULL_TREE; + ref->offset = 0; + ref->size = -1; + ref->max_size = -1; + return true; + } + /* If the base decl is a parameter we can have negative MEM_OFFSET in case of promoted subregs on bigendian targets. Trust the MEM_EXPR here. */ -- cgit v1.2.1 From e190b18ac32db326922c8974b011e8054a9fafa4 Mon Sep 17 00:00:00 2001 From: rguenth Date: Wed, 7 Apr 2010 13:08:24 +0000 Subject: 2010-04-07 Richard Guenther * doc/invoke.texi (-fargument-alias, -fargument-noalias, -fargument-noalias-global, -fargument-noalias-anything): Remove. * common.opt: Likewise. * tree-ssa-structalias.c (intra_create_variable_infos): Adjust comment. * alias.c (base_alias_check): Remove flag_argument_noalias handling. (nonoverlapping_memrefs_p): Likewise. * emit-rtl.c (set_mem_attributes_minus_bitpos): Likewise. * opts.c (common_handle_option): Handle OPT_fargument_alias, OPT_fargument_noalias, OPT_fargument_noalias_anything and OPT_fargument_noalias_global for backward compatibility. fortran/ * options.c (gfc_init_options): Do not set. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@158060 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/alias.c | 23 +---------------------- 1 file changed, 1 insertion(+), 22 deletions(-) (limited to 'gcc/alias.c') diff --git a/gcc/alias.c b/gcc/alias.c index 19a8292b454..c10b971e3df 100644 --- a/gcc/alias.c +++ b/gcc/alias.c @@ -1691,14 +1691,7 @@ base_alias_check (rtx x, rtx y, enum machine_mode x_mode, || (GET_CODE (y_base) == ADDRESS && GET_MODE (y_base) == Pmode)) return 0; - if (! flag_argument_noalias) - return 1; - - if (flag_argument_noalias > 1) - return 0; - - /* Weak noalias assertion (arguments are distinct, but may match globals). */ - return ! (GET_MODE (x_base) == VOIDmode && GET_MODE (y_base) == VOIDmode); + return 1; } /* Convert the address X into something we can use. This is done by returning @@ -2189,13 +2182,6 @@ nonoverlapping_memrefs_p (const_rtx x, const_rtx y) exprx = t; } } - else if (INDIRECT_REF_P (exprx)) - { - exprx = TREE_OPERAND (exprx, 0); - if (flag_argument_noalias < 2 - || TREE_CODE (exprx) != PARM_DECL) - return 0; - } moffsety = MEM_OFFSET (y); if (TREE_CODE (expry) == COMPONENT_REF) @@ -2217,13 +2203,6 @@ nonoverlapping_memrefs_p (const_rtx x, const_rtx y) expry = t; } } - else if (INDIRECT_REF_P (expry)) - { - expry = TREE_OPERAND (expry, 0); - if (flag_argument_noalias < 2 - || TREE_CODE (expry) != PARM_DECL) - return 0; - } if (! DECL_P (exprx) || ! DECL_P (expry)) return 0; -- cgit v1.2.1 From a5b373b8c1e3ad6ff13078ccbf6199431354b1cf Mon Sep 17 00:00:00 2001 From: rguenth Date: Thu, 15 Apr 2010 15:30:17 +0000 Subject: 2010-04-15 Richard Guenther * alias.c (alias_set_subset_of): Handle alias-set zero child properly. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@158380 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/alias.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gcc/alias.c') diff --git a/gcc/alias.c b/gcc/alias.c index c10b971e3df..4be708561ef 100644 --- a/gcc/alias.c +++ b/gcc/alias.c @@ -413,7 +413,7 @@ alias_set_subset_of (alias_set_type set1, alias_set_type set2) /* Otherwise, check if set1 is a subset of set2. */ ase = get_alias_set_entry (set2); if (ase != 0 - && ((ase->has_zero_child && set1 == 0) + && (ase->has_zero_child || splay_tree_lookup (ase->children, (splay_tree_key) set1))) return true; -- cgit v1.2.1 From 6f9688ce13fbcb6e20676cf821b3824f8d052a0b Mon Sep 17 00:00:00 2001 From: jakub Date: Fri, 16 Apr 2010 09:26:43 +0000 Subject: * alias.c (memrefs_conflict_p): If x and y are the same VALUE, don't call get_addr on both. If one expression is a VALUE and the other a REG, check VALUE's locs if the REG isn't among them. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@158401 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/alias.c | 34 ++++++++++++++++++++++++++++++++-- 1 file changed, 32 insertions(+), 2 deletions(-) (limited to 'gcc/alias.c') diff --git a/gcc/alias.c b/gcc/alias.c index 4be708561ef..6ec51ec2967 100644 --- a/gcc/alias.c +++ b/gcc/alias.c @@ -1789,9 +1789,39 @@ static int memrefs_conflict_p (int xsize, rtx x, int ysize, rtx y, HOST_WIDE_INT c) { if (GET_CODE (x) == VALUE) - x = get_addr (x); + { + if (REG_P (y)) + { + struct elt_loc_list *l; + for (l = CSELIB_VAL_PTR (x)->locs; l; l = l->next) + if (REG_P (l->loc) && rtx_equal_for_memref_p (l->loc, y)) + break; + if (l) + x = y; + else + x = get_addr (x); + } + /* Don't call get_addr if y is the same VALUE. */ + else if (x != y) + x = get_addr (x); + } if (GET_CODE (y) == VALUE) - y = get_addr (y); + { + if (REG_P (x)) + { + struct elt_loc_list *l; + for (l = CSELIB_VAL_PTR (y)->locs; l; l = l->next) + if (REG_P (l->loc) && rtx_equal_for_memref_p (l->loc, x)) + break; + if (l) + y = x; + else + y = get_addr (y); + } + /* Don't call get_addr if x is the same VALUE. */ + else if (y != x) + y = get_addr (y); + } if (GET_CODE (x) == HIGH) x = XEXP (x, 0); else if (GET_CODE (x) == LO_SUM) -- cgit v1.2.1 From 4e15f806dd1505d3808ece2059cba74318b43b18 Mon Sep 17 00:00:00 2001 From: jakub Date: Fri, 16 Apr 2010 21:43:36 +0000 Subject: PR bootstrap/43767 * alias.c (memrefs_conflict_p): Don't crash if CSELIB_VAL_PTR is NULL. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@158450 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/alias.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) (limited to 'gcc/alias.c') diff --git a/gcc/alias.c b/gcc/alias.c index 6ec51ec2967..a1e12fba44e 100644 --- a/gcc/alias.c +++ b/gcc/alias.c @@ -1792,10 +1792,11 @@ memrefs_conflict_p (int xsize, rtx x, int ysize, rtx y, HOST_WIDE_INT c) { if (REG_P (y)) { - struct elt_loc_list *l; - for (l = CSELIB_VAL_PTR (x)->locs; l; l = l->next) - if (REG_P (l->loc) && rtx_equal_for_memref_p (l->loc, y)) - break; + struct elt_loc_list *l = NULL; + if (CSELIB_VAL_PTR (x)) + for (l = CSELIB_VAL_PTR (x)->locs; l; l = l->next) + if (REG_P (l->loc) && rtx_equal_for_memref_p (l->loc, y)) + break; if (l) x = y; else @@ -1809,10 +1810,11 @@ memrefs_conflict_p (int xsize, rtx x, int ysize, rtx y, HOST_WIDE_INT c) { if (REG_P (x)) { - struct elt_loc_list *l; - for (l = CSELIB_VAL_PTR (y)->locs; l; l = l->next) - if (REG_P (l->loc) && rtx_equal_for_memref_p (l->loc, x)) - break; + struct elt_loc_list *l = NULL; + if (CSELIB_VAL_PTR (y)) + for (l = CSELIB_VAL_PTR (y)->locs; l; l = l->next) + if (REG_P (l->loc) && rtx_equal_for_memref_p (l->loc, x)) + break; if (l) y = x; else -- cgit v1.2.1 From 3f9da5596a39ec1c557502bf3f559aaeaf48fc0d Mon Sep 17 00:00:00 2001 From: steven Date: Fri, 30 Apr 2010 11:58:49 +0000 Subject: gcc/ChangeLog: * toplev.c: Include varray.h for statistics dumping. * tree.h: Do not declare varray_head_tag. * tree-into-ssa.c, tree-ssa-uninit.c, tree-phinodes.c, omega.c, regs.h, lto-cgraph.c, tree-ssa-loop-ivopts.c, tree-nomudflap.c, c-objc-common.c, lto-streamer-out.c, tree-ssa-propagate.c, gimple-low.c, c-semantics.c, dwarf2out.c, lto-streamer-in.c, lto-section-in.c, alias.c, tree-if-conv.c, gimplify.c, ggc-zone.c, tree-ssa.c, tree-ssa-loop-prefetch.c, integrate.h, c-gimplify.c, c-common.c, c-common.h, reg-stack.c, basic-block.h, tree-ssa-structalias.c, lto-section-out.c, tree-ssanames.c: Do not include varray.h. * Makefile.in: Update for abovementioned changes. objc/ChangeLog: * objc-act.c: Do not include varray.h. objcp/ChangeLog: * objcp-decl.c: Do not include varray.h. cp/ChangeLog: * optimize.c, parser.c,mangle.c, cp-tree.h: DO not include varray.h. * Make-lang.in: Don't include varray.h dependency in CXX_TREE_H. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@158933 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/alias.c | 1 - 1 file changed, 1 deletion(-) (limited to 'gcc/alias.c') diff --git a/gcc/alias.c b/gcc/alias.c index a1e12fba44e..baf0a62971e 100644 --- a/gcc/alias.c +++ b/gcc/alias.c @@ -42,7 +42,6 @@ along with GCC; see the file COPYING3. If not see #include "timevar.h" #include "target.h" #include "cgraph.h" -#include "varray.h" #include "tree-pass.h" #include "ipa-type-escape.h" #include "df.h" -- cgit v1.2.1 From 288debedbc2f37b6da383fa3579749eebb865846 Mon Sep 17 00:00:00 2001 From: hjl Date: Tue, 4 May 2010 15:47:25 +0000 Subject: Handle the same VALUE for true dependence. gcc/ 2010-05-04 H.J. Lu PR middle-end/43671 * alias.c (true_dependence): Handle the same VALUE in x and mem. (canon_true_dependence): Likewise. (write_dependence_p): Likewise. gcc/testsuite/ 2010-05-04 H.J. Lu PR middle-end/43671 * gcc.target/i386/pr43671.c: New. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@159033 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/alias.c | 39 ++++++++++++++++++++++++++++++++++----- 1 file changed, 34 insertions(+), 5 deletions(-) (limited to 'gcc/alias.c') diff --git a/gcc/alias.c b/gcc/alias.c index baf0a62971e..1d69d9da603 100644 --- a/gcc/alias.c +++ b/gcc/alias.c @@ -2357,8 +2357,18 @@ true_dependence (const_rtx mem, enum machine_mode mem_mode, const_rtx x, if (mem_mode == VOIDmode) mem_mode = GET_MODE (mem); - x_addr = get_addr (XEXP (x, 0)); - mem_addr = get_addr (XEXP (mem, 0)); + x_addr = XEXP (x, 0); + mem_addr = XEXP (mem, 0); + if (!((GET_CODE (x_addr) == VALUE + && GET_CODE (mem_addr) != VALUE + && reg_mentioned_p (x_addr, mem_addr)) + || (GET_CODE (x_addr) != VALUE + && GET_CODE (mem_addr) == VALUE + && reg_mentioned_p (mem_addr, x_addr)))) + { + x_addr = get_addr (x_addr); + mem_addr = get_addr (mem_addr); + } base = find_base_term (x_addr); if (base && (GET_CODE (base) == LABEL_REF @@ -2440,7 +2450,16 @@ canon_true_dependence (const_rtx mem, enum machine_mode mem_mode, rtx mem_addr, return 1; if (! x_addr) - x_addr = get_addr (XEXP (x, 0)); + { + x_addr = XEXP (x, 0); + if (!((GET_CODE (x_addr) == VALUE + && GET_CODE (mem_addr) != VALUE + && reg_mentioned_p (x_addr, mem_addr)) + || (GET_CODE (x_addr) != VALUE + && GET_CODE (mem_addr) == VALUE + && reg_mentioned_p (mem_addr, x_addr)))) + x_addr = get_addr (x_addr); + } if (! base_alias_check (x_addr, mem_addr, GET_MODE (x), mem_mode)) return 0; @@ -2509,8 +2528,18 @@ write_dependence_p (const_rtx mem, const_rtx x, int writep) if (MEM_ADDR_SPACE (mem) != MEM_ADDR_SPACE (x)) return 1; - x_addr = get_addr (XEXP (x, 0)); - mem_addr = get_addr (XEXP (mem, 0)); + x_addr = XEXP (x, 0); + mem_addr = XEXP (mem, 0); + if (!((GET_CODE (x_addr) == VALUE + && GET_CODE (mem_addr) != VALUE + && reg_mentioned_p (x_addr, mem_addr)) + || (GET_CODE (x_addr) != VALUE + && GET_CODE (mem_addr) == VALUE + && reg_mentioned_p (mem_addr, x_addr)))) + { + x_addr = get_addr (x_addr); + mem_addr = get_addr (mem_addr); + } if (! writep) { -- cgit v1.2.1 From b50c6e49e283fcbd0fb6c916ab65dc6accf889b0 Mon Sep 17 00:00:00 2001 From: rguenth Date: Sun, 16 May 2010 17:15:30 +0000 Subject: 2010-05-16 Richard Guenther * alias.c (nonoverlapping_memrefs_p): Remove use of IPA type-escape information. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@159460 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/alias.c | 42 ++++++++++-------------------------------- 1 file changed, 10 insertions(+), 32 deletions(-) (limited to 'gcc/alias.c') diff --git a/gcc/alias.c b/gcc/alias.c index 1d69d9da603..a4083a1a13b 100644 --- a/gcc/alias.c +++ b/gcc/alias.c @@ -2196,43 +2196,21 @@ nonoverlapping_memrefs_p (const_rtx x, const_rtx y) moffsetx = MEM_OFFSET (x); if (TREE_CODE (exprx) == COMPONENT_REF) { - if (TREE_CODE (expry) == VAR_DECL - && POINTER_TYPE_P (TREE_TYPE (expry))) - { - tree field = TREE_OPERAND (exprx, 1); - tree fieldcontext = DECL_FIELD_CONTEXT (field); - if (ipa_type_escape_field_does_not_clobber_p (fieldcontext, - TREE_TYPE (field))) - return 1; - } - { - tree t = decl_for_component_ref (exprx); - if (! t) - return 0; - moffsetx = adjust_offset_for_component_ref (exprx, moffsetx); - exprx = t; - } + tree t = decl_for_component_ref (exprx); + if (! t) + return 0; + moffsetx = adjust_offset_for_component_ref (exprx, moffsetx); + exprx = t; } moffsety = MEM_OFFSET (y); if (TREE_CODE (expry) == COMPONENT_REF) { - if (TREE_CODE (exprx) == VAR_DECL - && POINTER_TYPE_P (TREE_TYPE (exprx))) - { - tree field = TREE_OPERAND (expry, 1); - tree fieldcontext = DECL_FIELD_CONTEXT (field); - if (ipa_type_escape_field_does_not_clobber_p (fieldcontext, - TREE_TYPE (field))) - return 1; - } - { - tree t = decl_for_component_ref (expry); - if (! t) - return 0; - moffsety = adjust_offset_for_component_ref (expry, moffsety); - expry = t; - } + tree t = decl_for_component_ref (expry); + if (! t) + return 0; + moffsety = adjust_offset_for_component_ref (expry, moffsety); + expry = t; } if (! DECL_P (exprx) || ! DECL_P (expry)) -- cgit v1.2.1 From ba72912a012b97cad825eebee3f5f22253d0afe4 Mon Sep 17 00:00:00 2001 From: lauras Date: Tue, 8 Jun 2010 07:25:24 +0000 Subject: gcc/ada: 2010-06-08 Laurynas Biveinis * gcc-interface/utils.c (init_gnat_to_gnu): Use typed GC allocation. (init_dummy_type): Likewise. (gnat_pushlevel): Likewise. * gcc-interface/trans.c (Attribute_to_gnu): Likewise. (Subprogram_Body_to_gnu): Likewise. (Compilation_Unit_to_gnu): Likewise. (start_stmt_group): Likewise. (extract_encoding): Likewise. (decode_name): Likewise. * gcc-interface/misc.c (gnat_printable_name): Likewise. * gcc-interface/decl.c (annotate_value): Likewise. * gcc-interface/ada-tree.h (struct lang_type): Add variable_size GTY option. (struct lang_decl): Likewise. (SET_TYPE_LANG_SPECIFIC): Use typed GC allocation. (SET_DECL_LANG_SPECIFIC): Likewise. gcc/c-family: 2010-06-08 Laurynas Biveinis * c-pragma.c (push_alignment): Use typed GC allocation. (handle_pragma_push_options): Likewise. * c-common.c (parse_optimize_options): Likewise. * c-common.h (struct sorted_fields_type): Add variable_size GTY option. gcc/cp: 2010-06-08 Laurynas Biveinis * typeck2.c (abstract_virtuals_error): Likewise. * pt.c (maybe_process_partial_specialization): Likewise. (register_specialization): Likewise. (add_pending_template): Likewise. (lookup_template_class): Likewise. (push_tinst_level): Likewise. * parser.c (cp_lexer_new_main): Likewise. (cp_lexer_new_from_tokens): Likewise. (cp_token_cache_new): Likewise. (cp_parser_context_new): Likewise. (cp_parser_new): Likewise. (cp_parser_nested_name_specifier_opt): Likewise. (cp_parser_template_id): Likewise. * name-lookup.c (binding_entry_make): Likewise. (binding_table_construct): Likewise. (binding_table_new): Likewise. (cxx_binding_make): Likewise. (pushdecl_maybe_friend): Likewise. (begin_scope): Likewise. (push_to_top_level): Likewise. * lex.c (init_reswords): Likewise. (retrofit_lang_decl): Likewise. (cxx_dup_lang_specific_decl): Likewise. (copy_lang_type): Likewise. (cxx_make_type): Likewise. * decl.c (make_label_decl): Likewise. (check_goto): Likewise. (start_preparsed_function): Likewise. (save_function_data): Likewise. * cp-tree.h (TYPE_SET_PTRMEMFUNC_TYPE): Likewise. * cp-objcp-common.c (decl_shadowed_for_var_insert): Likewise. * class.c (finish_struct_1): Likewise. * cp-tree.h (struct lang_type): Add variable_size GTY option. (struct lang_decl): Likewise. * parser.c (cp_parser_new): Update comment to not reference ggc_alloc. gcc/fortran: 2010-06-08 Laurynas Biveinis * trans-types.c (gfc_get_nodesc_array_type): Use typed GC allocation. (gfc_get_array_type_bounds): Likewise. * trans-decl.c (gfc_allocate_lang_decl): Likewise. (gfc_find_module): Likewise. * f95-lang.c (pushlevel): Likewise. * trans.h (struct lang_type): Add variable_size GTY option. (struct lang_decl): Likewise. gcc/java: 2010-06-08 Laurynas Biveinis * jcf-reader.c (jcf_parse_constant_pool): Use typed GC allocation. * jcf-parse.c (java_parse_file): Likewise. (process_zip_dir): Likewise. * java-tree.h (MAYBE_CREATE_VAR_LANG_DECL_SPECIFIC): Likewise. (MAYBE_CREATE_TYPE_TYPE_LANG_SPECIFIC): Likewise. * expr.c (add_type_assertion): Likewise. * decl.c (make_binding_level): Likewise. (java_dup_lang_specific_decl): Likewise. * constants.c (set_constant_entry): Likewise. (cpool_for_class): Likewise. * class.c (add_method_1): Likewise. (java_treetreehash_new): Likewise. * java-tree.h (struct lang_type): Add variable_size GTY option. (struct lang_decl): Likewise. * jch.h (struct cpool_entry): Likewise. * java-tree.h (java_treetreehash_create): Remove parameter ggc. * except.c (prepare_eh_table_type): Update java_treetreehash_create call. * class.c (add_method_1): Update java_treetreehash_create call. (java_treetreehash_create): Remove parameter gc. Use htab_create_ggc. gcc/lto: 2010-06-08 Laurynas Biveinis * lto.c (lto_read_in_decl_state): Use typed GC allocation. (lto_file_read): Likewise. (new_partition): Likewise. (read_cgraph_and_symbols): Likewise. gcc/objc: 2010-06-08 Laurynas Biveinis * objc-act.h (ALLOC_OBJC_TYPE_LANG_SPECIFIC): Use typed GC allocation. * objc-act.c (objc_volatilize_decl): Likewise. (objc_build_string_object): Likewise. (hash_init): Likewise. (hash_enter): Likewise. (hash_add_attr): Likewise. (add_class): Likewise. (start_class): Likewise. gcc/objcp: 2010-06-08 Laurynas Biveinis * objcp-decl.h (ALLOC_OBJC_TYPE_LANG_SPECIFIC): Use typed GC allocation. gcc: 2010-06-08 Laurynas Biveinis * doc/tm.texi (Per-Function Data): Do not reference ggc_alloc. * doc/gty.texi (GTY Options): Document typed GC allocation and variable_size GTY option. * ggc-internal.h: New. * ggc.h: Update copyright year. (digit_string): Move to stringpool.c. (ggc_mark_stringpool, ggc_purge_stringpool, ggc_mark_roots) (gt_pch_save_stringpool, gt_pch_fixup_stringpool) (gt_pach_restore_stringpool, gt_pch_p_S, gt_pch_note_object) (init_ggc_pch, ggc_pch_count_object, ggc_pch_total_size) (ggc_pch_this_base, ggc_pch_alloc_object, ggc_pch_prepare_write) (ggc_pch_write_object, ggc_pch_finish, ggc_pch_read) (ggc_force_collect, ggc_get_size, ggc_statistics) (ggc_print_common_statistics): Move to ggc-internal.h. (digit_vector, new_ggc_zone, destroy_ggc_zone, ggc_alloc_stat) (ggc_alloc, ggc_alloc_cleared, ggc_realloc, ggc_calloc, GGC_NEW) (GGC_CNEW, GGC_NEWVEC, GGC_CNEWVEC, GGC_NEWVAR, ggc_alloc_rtvec) (ggc_alloc_tree, gt_pch_save, ggc_min_expand_heuristic) (ggc_min_heapsize_heuristic, ggc_alloc_zone) (ggc_alloc_zone_pass_stat): Remove. (ggc_internal_alloc_stat, ggc_internal_alloc) (ggc_internal_cleared_alloc_stat): New. (GGC_RESIZEVEC, GGC_RESIZEVAR): Redefine. (ggc_internal_vec_alloc_stat) (ggc_internal_cleared_vec_alloc_stat) (ggc_internal_vec_alloc_stat, ggc_internal_cleared_vec_alloc) (ggc_alloc_atomic_stat, ggc_alloc_atomic) (ggc_alloc_cleared_atomic, ggc_cleared_alloc_htab_ignore_args) (ggc_cleared_alloc_ptr_array_two_args): New. (htab_create_ggc, splay_tree_new_ggc): Redefine. (ggc_splay_alloc): Change the type of the first argument to enum gt_types_enum. (ggc_alloc_string): Make macro. (ggc_alloc_string_stat): New. (ggc_strdup): Redefine. (rtl_zone, tree_zone, tree_id_zone): Declare unconditionally. (ggc_alloc_rtvec_sized): New. (ggc_alloc_zone_stat): Rename to ggc_internal_alloc_zone_stat. (ggc_internal_alloc_zone_pass_stat, ggc_internal_alloc_zone_stat) (ggc_internal_cleared_alloc_zone_stat) (ggc_internal_zone_alloc_stat) (ggc_internal_zone_cleared_alloc_stat) (ggc_internal_zone_vec_alloc_stat) (ggc_alloc_zone_rtx_def_stat) (ggc_alloc_zone_tree_node_stat) (ggc_alloc_zone_cleared_tree_node_stat) (ggc_alloc_cleared_gimple_statement_d_stat): New. * ggc-common.c: Include ggc-internal.h. (ggc_internal_cleared_alloc_stat): Rename from ggc_alloc_cleared_stat. (ggc_realloc_stat): Use ggc_internal_alloc_stat. (ggc_calloc): Remove. (ggc_cleared_alloc_htab_ignore_args): New. (ggc_cleared_alloc_ptr_array_two_args): New. (ggc_splay_alloc): Add obj_type parameter. (init_ggc_heuristics): Formatting fixes. * ggc-none.c: Update copyright year. (ggc_alloc_stat): Rename to ggc_alloc_stat. (ggc_alloc_cleared_stat): Rename to ggc_internal_cleared_alloc_stat. (struct alloc_zone, rtl_zone, tree_zone, tree_id_zone): New. * ggc-page.c: Update copyright year. Include ggc-internal.h. Remove references to ggc_alloc in comments. (ggc_alloc_typed_stat): Call ggc_internal_alloc_stat. (ggc_alloc_stat): Rename to ggc_internal_alloc_stat. (new_ggc_zone, destroy_ggc_zone): Remove. (struct alloc_zone, rtl_zone, tree_zone, tree_id_zone): New. * ggc-zone.c: Include ggc-internal.h. Remove references to ggc_alloc in comments. (ggc_alloc_zone_stat): ggc_internal_alloc_zone_stat. (ggc_internal_alloc_zone_pass_stat): New. (ggc_internal_cleared_alloc_zone_stat): New. (ggc_alloc_typed_stat): Use ggc_internal_alloc_zone_pass_stat. (ggc_alloc_stat): Rename ggc_internal_alloc_stat. (new_ggc_zone, destroy_ggc_zone): Remove. * stringpool.c: Update copyright year. Include ggc-internal.h (digit_vector): Make static. (digit_string): Moved from ggc.h. (stringpool_ggc_alloc): Use ggc_alloc_atomic. (ggc_alloc_string): Rename to ggc_alloc_string_stat. * Makefile.in (GGC_INTERNAL_H): New. (ggc_common.o, ggc-page.o, ggc-zone.o, stringpool.o): Add $(GGC_INTERNAL_H) to dependencies. * gentype.c: Update copyright year. (walk_type): Accept variable_size GTY option. (USED_BY_TYPED_GC_P): New macro. (write_enum_defn): Use USED_BY_TYPED_GC_P. Do not output whitespace at the end of strings. (get_type_specifier, variable_size_p): New functions. (alloc_quantity, alloc_zone): New enums. (write_typed_alloc_def): New function. (write_typed_struct_alloc_def): Likewise. (write_typed_typed_typedef_alloc_def): Likewise. (write_typed_alloc_defns): Likewise. (output_typename, write_splay_tree_allocator_def): Likewise. (write_splay_tree_allocators): Likewise. (main): Call write_typed_alloc_defns and write_splay_tree_allocators. * lto-streamer.h (lto_file_decl_data_ptr): New. * passes.c (order): Define using cgraph_node_ptr. * strinpool.c (struct string_pool_data): Declare nested_ptr using ht_identifier_ptr. * gimple.h (union gimple_statement_d): Likewise. * rtl.h (struct rtx_def): Likewise. (struct rtvec_def): Likewise. * tree.h (union tree_node): Likewise. * tree-ssa-operands.h (struct ssa_operand_memory_d): Likewise. * cfgloop.c (record_loop_exits): Use htab_create_ggc. * tree-scalar-evolution.c (scev_initialize): Likewise. * alias.c (record_alias_subset): Update splay_tree_new_ggc call. * dwarf2asm.c (dw2_force_const_mem): Likewise. * omp-low.c (lower_omp_critical): Likewise. * bitmap.h (struct bitmap_head_def): Update comment to not reference ggc_alloc. * config/pa/pa.c (get_deferred_label): Use GGC_RESIZEVEC. * ira.c (fix_reg_equiv_init): Use GGC_RESIZEVEC. * ipa-prop.c (duplicate_ggc_array): Rename to duplicate_ipa_jump_func_array. Use typed GC allocation. (ipa_edge_duplication_hook): Call duplicate_ipa_jump_func_array. * gimple.c (gimple_alloc_stat): Use ggc_alloc_cleared_gimple_statement_d_stat. * varasm.c (create_block_symbol): Use ggc_alloc_zone_rtx_def. * tree.c (make_node_stat): Use ggc_alloc_zone_cleared_tree_node_stat. (make_tree_vec_stat): Likewise. (build_vl_exp_stat): Likewise. (copy_node_stat): Use ggc_alloc_zone_tree_node_stat. (make_tree_binfo_stat): Likewise. (tree_cons_stat): Likewise. * rtl.c (rtx_alloc_stat): Use ggc_alloc_zone_rtx_def_stat. (shallow_copy_rtx_stat): Likewise. (make_node_stat): Likewise. * lto-symtab.c: Fix comment. * tree-cfg.c (create_bb): Update comment to not reference ggc_alloc_cleared. * tree-ssa-structalias.c (struct heapvar_for_stmt): Fix param_is value. * varpool.c (varpool_node): Use typed GC allocation. (varpool_extra_name_alias): Likewise. * varasm.c (emutls_decl): Likewise. (get_unnamed_section): Likewise. (get_noswitch_section): Likewise. (get_section): Likewise. (get_block_for_section): Likewise. (build_constant_desc): Likewise. (create_constant_pool): Likewise. (force_const_mem): Likewise. * tree.c (build_vl_exp_stat): Likewise. (build_real): Likewise. (build_string): Likewise. (decl_debug_expr_insert): Likewise. (decl_value_expr_insert): Likewise. (type_hash_add): Likewise. (build_omp_clause): Likewise. * tree-ssanames.c (duplicate_ssa_name_ptr_info): Likewise. * tree-ssa.c (init_tree_ssa): Likewise. * tree-ssa-structalias.c (heapvar_insert): Likewise. * tree-ssa-operands.c (ssa_operand_alloc): Likewise. * tree-ssa-loop-niter.c (record_estimate): Likewise. * tree-ssa-alias.c (get_ptr_info): Likewise. * tree-scalar-evolution.c (new_scev_info_str): Likewise. * tree-phinodes.c (allocate_phi_node): Likewise. * tree-iterator.c (tsi_link_before): Likewise. (tsi_link_after): Likewise. * tree-eh.c (add_stmt_to_eh_lp_fn): Likewise. * tree-dfa.c (create_var_ann): Likewise. * tree-cfg.c (create_bb): Likewise. * toplev.c (alloc_for_identifier_to_locale): Likewise. (general_init): Likewise. * stringpool.c (stringpool_ggc_alloc): Likewise. (gt_pch_save_stringpool): Likewise. * sese.c (if_region_set_false_region): Likewise. * passes.c (do_per_function_toporder): Likewise. * optabs.c (set_optab_libfunc): Likewise. (set_conv_libfunc): Likewise. * lto-symtab.c (lto_symtab_register_decl): Likewise. * lto-streamer-in.c (lto_input_eh_catch_list): Likewise. (input_eh_region): Likewise. (input_eh_lp): Likewise. (make_new_block): Likewise. (unpack_ts_real_cst_value_fields): Likewise. * lto-section-in.c (lto_new_in_decl_state): Likewise. * lto-cgraph.c (input_node_opt_summary): Likewise. * loop-init.c (loop_optimizer_init): Likewise. * lambda.h (lambda_vector_new): Likewise. * lambda-code.c (replace_uses_equiv_to_x_with_y): Likewise. * ira.c (update_equiv_regs): Likewise. * ipa.c (cgraph_node_set_new): Likewise. (cgraph_node_set_add): Likewise. (varpool_node_set_new): Likewise. (varpool_node_set_add): Likewise. * ipa-prop.c (ipa_compute_jump_functions_for_edge): Likewise. (duplicate_ipa_jump_func_array): Likewise. (ipa_read_node_info): Likewise. * ipa-cp.c (ipcp_create_replace_map): Likewise. * integrate.c (get_hard_reg_initial_val): Likewise. * gimple.c (gimple_alloc_stat): Likewise. (gimple_build_omp_for): Likewise. (gimple_seq_alloc): Likewise. (gimple_copy): Likewise. * gimple-iterator.c (gsi_insert_before_without_update): Likewise. (gsi_insert_after_without_update): Likewise. * function.c (add_frame_space): Likewise. (insert_temp_slot_address): Likewise. (assign_stack_temp_for_type): Likewise. (allocate_struct_function): Likewise. (types_used_by_var_decl_insert): Likewise. * except.c (init_eh_for_function): Likewise. (gen_eh_region): Likewise. (gen_eh_region_catch): Likewise. (gen_eh_landing_pad): Likewise. (add_call_site): Likewise. * emit-rtl.c (get_mem_attrs): Likewise. (get_reg_attrs): Likewise. (start_sequence): Likewise. (init_emit): Likewise. * dwarf2out.c (new_cfi): Likewise. (queue_reg_save): Likewise. (dwarf2out_frame_init): Likewise. (new_loc_descr): Likewise. (find_AT_string): Likewise. (new_die): Likewise. (add_var_loc_to_decl): Likewise. (clone_die): Likewise. (clone_as_declaration): Likewise. (break_out_comdat_types): Likewise. (new_loc_list): Likewise. (loc_descriptor): Likewise. (add_loc_descr_to_each): Likewise. (add_const_value_attribute): Likewise. (tree_add_const_value_attribute): Likewise. (add_comp_dir_attribute): Likewise. (add_name_and_src_coords_attributes): Likewise. (lookup_filename): Likewise. (store_vcall_insn): Likewise. (dwarf2out_init): Likewise. * dbxout.c (dbxout_init): Likewise. * config/xtensa/xtensa.c (xtensa_init_machine_status): Likewise. * config/sparc/sparc.c (sparc_init_machine_status): Likewise. * config/score/score7.c (score7_output_external): Likewise. * config/score/score3.c (score3_output_external): Likewise. * config/s390/s390.c (s390_init_machine_status): Likewise. * config/rs6000/rs6000.c (builtin_function_type): Likewise. (rs6000_init_machine_status): Likewise. (output_toc): Likewise. * config/pa/pa.c (pa_init_machine_status): Likewise. (get_deferred_plabel): Likewise. * config/moxie/moxie.c (moxie_init_machine_status): Likewise. * config/mmix/mmix.c (mmix_init_machine_status): Likewise. * config/mips/mips.c (mflip_mips16_use_mips16_p): Likewise. * config/mep/mep.c (mep_init_machine_status): Likewise. (mep_note_pragma_flag): Likewise. * config/m32c/m32c.c (m32c_init_machine_status): Likewise. * config/iq2000/iq2000.c (iq2000_init_machine_status): Likewise. * config/ia64/ia64.c (ia64_init_machine_status): Likewise. * config/i386/winnt.c (i386_pe_record_external_function): Likewise. (i386_pe_maybe_record_exported_symbol): Likewise. * config/i386/i386.c (get_dllimport_decl): Likewise. (ix86_init_machine_status): Likewise. (assign_386_stack_local): Likewise. * config/frv/frv.c (frv_init_machine_status): Likewise. * config/darwin.c (machopic_indirection_name): Likewise. * config/cris/cris.c (cris_init_machine_status): Likewise. * config/bfin/bfin.c (bfin_init_machine_status): Likewise. * config/avr/avr.c (avr_init_machine_status): Likewise. * config/arm/arm.c (arm_init_machine_status): Likewise. * config/alpha/alpha.c (alpha_init_machine_status): Likewise. (alpha_need_linkage): Likewise. (alpha_use_linkage): Likewise. * cgraph.c (cgraph_allocate_node): Likewise. (cgraph_create_edge_1): Likewise. (cgraph_create_indirect_edge): Likewise. (cgraph_add_asm_node): Likewise. * cfgrtl.c (init_rtl_bb_info): Likewise. * cfgloop.c (alloc_loop): Likewise. (rescan_loop_exit): Likewise. * cfg.c (init_flow): Likewise. (alloc_block): Likewise. (unchecked_make_edge): Likewise. * c-parser.c (c_parse_init): Likewise. (c_parse_file): Likewise. * c-decl.c (bind): Likewise. (record_inline_static): Likewise. (push_scope): Likewise. (make_label): Likewise. (lookup_label_for_goto): Likewise. (finish_struct): Likewise. (finish_enum): Likewise. (c_push_function_context): Likewise. * bitmap.c (bitmap_element_allocate): Likewise. (bitmap_gc_alloc_stat): Likewise. * alias.c (record_alias_subset): Likewise. (init_alias_analysis): Likewise. include: 2010-06-08 Laurynas Biveinis * splay-tree.h: Update copyright years. (splay_tree_s): Document fields. (splay_tree_new_typed_alloc): New. * hashtab.h: Update copyright years. (htab_create_typed_alloc): New. libcpp: 2010-06-08 Laurynas Biveinis * include/symtab.h (ht_identifier_ptr): New. libiberty: 2010-06-08 Laurynas Biveinis * splay-tree.c: Update copyright years. (splay_tree_new_typed_alloc): New. (splay_tree_new_with_allocator): Use it. * hashtab.c: Update copyright years. (htab_create_typed_alloc): New. (htab_create_alloc): Use it. * functions.texi: Regenerate. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@160425 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/alias.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'gcc/alias.c') diff --git a/gcc/alias.c b/gcc/alias.c index a4083a1a13b..38209316118 100644 --- a/gcc/alias.c +++ b/gcc/alias.c @@ -823,10 +823,12 @@ record_alias_subset (alias_set_type superset, alias_set_type subset) { /* Create an entry for the SUPERSET, so that we have a place to attach the SUBSET. */ - superset_entry = GGC_NEW (struct alias_set_entry_d); + superset_entry = ggc_alloc_cleared_alias_set_entry_d (); superset_entry->alias_set = superset; superset_entry->children - = splay_tree_new_ggc (splay_tree_compare_ints); + = splay_tree_new_ggc (splay_tree_compare_ints, + ggc_alloc_splay_tree_scalar_scalar_splay_tree_s, + ggc_alloc_splay_tree_scalar_scalar_splay_tree_node_s); superset_entry->has_zero_child = 0; VEC_replace (alias_set_entry, alias_sets, superset, superset_entry); } @@ -2639,7 +2641,7 @@ init_alias_analysis (void) timevar_push (TV_ALIAS_ANALYSIS); reg_known_value_size = maxreg - FIRST_PSEUDO_REGISTER; - reg_known_value = GGC_CNEWVEC (rtx, reg_known_value_size); + reg_known_value = ggc_alloc_cleared_vec_rtx (reg_known_value_size); reg_known_equiv_p = XCNEWVEC (bool, reg_known_value_size); /* If we have memory allocated from the previous run, use it. */ -- cgit v1.2.1 From 0ea2d350e936eed6a5a6d0b755ac918effa054d6 Mon Sep 17 00:00:00 2001 From: hubicka Date: Sun, 13 Jun 2010 14:50:26 +0000 Subject: * bitmap.c (bitmap_and, bitmap_and_into, bitmap_and_compl, bitmap_and_compl_into, bitmap_compl_and_into, bitmap_ior, bitmap_ior_into, bitmap_xor, bitmap_xor_into, bitmap_ior_and_compl, bitmap_ior_and_compl): Turn internal datastructure checks into checking asserts. * rtlanal.c (find_reg_note): Use gcc_checking_assert. * tree-ssa-sccvn.c (VN_INFO): Likewise. * df-scan.c (df_reorganize_refs_by_reg_by_reg, df_install_ref, df_ref_create_structure): Likewise. * alloc-pool.c (create_alloc_pool, empty_alloc_pool, pool_alloc, pool_free): Use gcc_checking_assert. * alias.c (get_alias_set): Likewise. * var-tracking.c (variable_htab_free, shared_hash_copy, canonicalize_values_mark, variable_merge_over_cur): Likewise. * lto-streamer.c (bp_unpack_value): Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@160681 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/alias.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'gcc/alias.c') diff --git a/gcc/alias.c b/gcc/alias.c index 38209316118..08c38bf6616 100644 --- a/gcc/alias.c +++ b/gcc/alias.c @@ -713,7 +713,7 @@ get_alias_set (tree t) t = TYPE_CANONICAL (t); /* Canonical types shouldn't form a tree nor should the canonical type require structural equality checks. */ - gcc_assert (!TYPE_STRUCTURAL_EQUALITY_P (t) && TYPE_CANONICAL (t) == t); + gcc_checking_assert (!TYPE_STRUCTURAL_EQUALITY_P (t) && TYPE_CANONICAL (t) == t); /* If this is a type with a known alias set, return it. */ if (TYPE_ALIAS_SET_KNOWN_P (t)) @@ -1136,7 +1136,7 @@ record_set (rtx dest, const_rtx set, void *data ATTRIBUTE_UNUSED) regno = REGNO (dest); - gcc_assert (regno < VEC_length (rtx, reg_base_value)); + gcc_checking_assert (regno < VEC_length (rtx, reg_base_value)); /* If this spans multiple hard registers, then we must indicate that every register has an unusable value. */ -- cgit v1.2.1 From 182cf5a9a415f31df0f9a10e46faed1221484a35 Mon Sep 17 00:00:00 2001 From: rguenth Date: Thu, 1 Jul 2010 08:49:19 +0000 Subject: 2010-07-01 Richard Guenther PR middle-end/42834 PR middle-end/44468 * doc/gimple.texi (is_gimple_mem_ref_addr): Document. * doc/generic.texi (References to storage): Document MEM_REF. * tree-pretty-print.c (dump_generic_node): Handle MEM_REF. (print_call_name): Likewise. * tree.c (recompute_tree_invariant_for_addr_expr): Handle MEM_REF. (build_simple_mem_ref_loc): New function. (mem_ref_offset): Likewise. * tree.h (build_simple_mem_ref_loc): Declare. (build_simple_mem_ref): Define. (mem_ref_offset): Declare. * fold-const.c: Include tree-flow.h. (operand_equal_p): Handle MEM_REF. (build_fold_addr_expr_with_type_loc): Likewise. (fold_comparison): Likewise. (fold_unary_loc): Fold VIEW_CONVERT_EXPR > to MEM_REF . (fold_binary_loc): Fold MEM[&MEM[p, CST1], CST2] to MEM[p, CST1 + CST2], fold MEM[&a.b, CST2] to MEM[&a, offsetof (a, b) + CST2]. * tree-ssa-alias.c (ptr_deref_may_alias_decl_p): Handle MEM_REF. (ptr_deref_may_alias_ref_p_1): Likewise. (ao_ref_base_alias_set): Properly differentiate base object for offset and TBAA. (ao_ref_init_from_ptr_and_size): Use MEM_REF. (indirect_ref_may_alias_decl_p): Handle MEM_REFs properly. (indirect_refs_may_alias_p): Likewise. (refs_may_alias_p_1): Likewise. Remove pointer SSA name def chasing code. (ref_maybe_used_by_call_p_1): Handle MEM_REF. (call_may_clobber_ref_p_1): Likewise. * dwarf2out.c (loc_list_from_tree): Handle MEM_REF. * expr.c (expand_assignment): Handle MEM_REF. (store_expr): Handle MEM_REFs from STRING_CSTs. (store_field): If expanding a MEM_REF of a non-addressable decl use bitfield operations. (get_inner_reference): Handle MEM_REF. (expand_expr_addr_expr_1): Likewise. (expand_expr_real_1): Likewise. * tree-eh.c (tree_could_trap_p): Handle MEM_REF. * alias.c (ao_ref_from_mem): Handle MEM_REF. (get_alias_set): Likewise. Properly handle VIEW_CONVERT_EXPRs. * tree-data-ref.c (dr_analyze_innermost): Handle MEM_REF. (dr_analyze_indices): Likewise. (dr_analyze_alias): Likewise. (object_address_invariant_in_loop_p): Likewise. * gimplify.c (mark_addressable): Handle MEM_REF. (gimplify_cond_expr): Build MEM_REFs. (gimplify_modify_expr_to_memcpy): Likewise. (gimplify_init_ctor_preeval_1): Handle MEM_REF. (gimple_fold_indirect_ref): Adjust. (gimplify_expr): Handle MEM_REF. Gimplify INDIRECT_REF to MEM_REF. * tree.def (MEM_REF): New tree code. * tree-dfa.c: Include toplev.h. (get_ref_base_and_extent): Handle MEM_REF. (get_addr_base_and_unit_offset): New function. * emit-rtl.c (set_mem_attributes_minus_bitpos): Handle MEM_REF. * gimple-fold.c (may_propagate_address_into_dereference): Handle MEM_REF. (maybe_fold_offset_to_array_ref): Allow possibly out-of bounds accesses if the array has just one dimension. Remove always true parameter. Do not require type compatibility here. (maybe_fold_offset_to_component_ref): Remove. (maybe_fold_stmt_indirect): Remove. (maybe_fold_reference): Remove INDIRECT_REF handling. Fold back to non-MEM_REF. (maybe_fold_offset_to_address): Simplify. Deal with type mismatches here. (maybe_fold_reference): Likewise. (maybe_fold_stmt_addition): Likewise. Also handle &ARRAY + I in addition to &ARRAY[0] + I. (fold_gimple_assign): Handle ADDR_EXPR of MEM_REFs. (gimple_get_relevant_ref_binfo): Handle MEM_REF. * cfgexpand.c (expand_debug_expr): Handle MEM_REF. * tree-ssa.c (useless_type_conversion_p): Make most pointer conversions useless. (warn_uninitialized_var): Handle MEM_REF. (maybe_rewrite_mem_ref_base): New function. (execute_update_addresses_taken): Implement re-writing of MEM_REFs to SSA form. * tree-inline.c (remap_gimple_op_r): Handle MEM_REF, remove INDIRECT_REF handling. (copy_tree_body_r): Handle MEM_REF. * gimple.c (is_gimple_addressable): Adjust. (is_gimple_address): Likewise. (is_gimple_invariant_address): ADDR_EXPRs of MEM_REFs with invariant base are invariant. (is_gimple_min_lval): Adjust. (is_gimple_mem_ref_addr): New function. (get_base_address): Handle MEM_REF. (count_ptr_derefs): Likewise. (get_base_loadstore): Likewise. * gimple.h (is_gimple_mem_ref_addr): Declare. (gimple_call_fndecl): Handle invariant MEM_REF addresses. * tree-cfg.c (verify_address): New function, split out from ... (verify_expr): ... here. Use for verifying ADDR_EXPRs and the address operand of MEM_REFs. Verify MEM_REFs. Reject INDIRECT_REFs. (verify_types_in_gimple_min_lval): Handle MEM_REF. Disallow INDIRECT_REF. Allow conversions. (verify_types_in_gimple_reference): Verify VIEW_CONVERT_EXPR of a register does not change its size. (verify_types_in_gimple_reference): Verify MEM_REF. (verify_gimple_assign_single): Disallow INDIRECT_REF. Handle MEM_REF. * tree-ssa-operands.c (opf_non_addressable, opf_not_non_addressable): New. (mark_address_taken): Handle MEM_REF. (get_indirect_ref_operands): Pass through opf_not_non_addressable. (get_asm_expr_operands): Pass opf_not_non_addressable. (get_expr_operands): Handle opf_[not_]non_addressable. Handle MEM_REF. Remove INDIRECT_REF handling. * tree-vrp.c: (check_array_ref): Handle MEM_REF. (search_for_addr_array): Likewise. (check_array_bounds): Likewise. (vrp_stmt_computes_nonzero): Adjust for MEM_REF. * tree-ssa-loop-im.c (for_each_index): Handle MEM_REF. (ref_always_accessed_p): Likewise. (gen_lsm_tmp_name): Likewise. Handle ADDR_EXPR. * tree-complex.c (extract_component): Do not handle INDIRECT_REF. Handle MEM_REF. * cgraphbuild.c (mark_load): Properly check for NULL result from get_base_address. (mark_store): Likewise. * tree-ssa-loop-niter.c (array_at_struct_end_p): Handle MEM_REF. * tree-loop-distribution.c (generate_builtin): Exchange INDIRECT_REF handling for MEM_REF. * tree-scalar-evolution.c (follow_ssa_edge_expr): Handle &MEM[ptr + CST] similar to POINTER_PLUS_EXPR. * builtins.c (stabilize_va_list_loc): Use the function ABI valist type if we couldn't canonicalize the argument type. Always dereference with the canonical va-list type. (maybe_emit_free_warning): Handle MEM_REF. (fold_builtin_memory_op): Simplify and handle MEM_REFs in folding memmove to memcpy. * builtins.c (fold_builtin_memory_op): Use ref-all types for all memcpy foldings. * omp-low.c (build_receiver_ref): Adjust for MEM_REF. (build_outer_var_ref): Likewise. (scan_omp_1_op): Likewise. (lower_rec_input_clauses): Likewise. (lower_lastprivate_clauses): Likewise. (lower_reduction_clauses): Likewise. (lower_copyprivate_clauses): Likewise. (expand_omp_atomic_pipeline): Likewise. (expand_omp_atomic_mutex): Likewise. (create_task_copyfn): Likewise. * tree-ssa-sccvn.c (copy_reference_ops_from_ref): Handle MEM_REF. Remove old union trick. Initialize constant offsets. (ao_ref_init_from_vn_reference): Likewise. Do not handle INDIRECT_REF. Init base_alias_set properly. (vn_reference_lookup_3): Replace INDIRECT_REF handling with MEM_REF. (vn_reference_fold_indirect): Adjust for MEM_REFs. (valueize_refs): Fold MEM_REFs. Re-evaluate constant offset for ARRAY_REFs. (may_insert): Remove. (visit_reference_op_load): Do not test may_insert. (run_scc_vn): Remove parameter, do not fiddle with may_insert. * tree-ssa-sccvn.h (struct vn_reference_op_struct): Add a field to store the constant offset this op applies. (run_scc_vn): Adjust prototype. * cgraphunit.c (thunk_adjust): Adjust for MEM_REF. * tree-ssa-ccp.c (ccp_fold): Replace INDIRECT_REF folding with MEM_REF. Propagate &foo + CST as &MEM[&foo, CST]. Do not bother about volatile qualifiers on pointers. (fold_const_aggregate_ref): Handle MEM_REF, do not handle INDIRECT_REF. * tree-ssa-loop-ivopts.c * tree-ssa-loop-ivopts.c (determine_base_object): Adjust for MEM_REF. (strip_offset_1): Likewise. (find_interesting_uses_address): Replace INDIRECT_REF handling with MEM_REF handling. (get_computation_cost_at): Likewise. * ipa-pure-const.c (check_op): Handle MEM_REF. * tree-stdarg.c (check_all_va_list_escapes): Adjust for MEM_REF. * tree-ssa-sink.c (is_hidden_global_store): Handle MEM_REF and constants. * ipa-inline.c (likely_eliminated_by_inlining_p): Handle MEM_REF. * tree-parloops.c (take_address_of): Adjust for MEM_REF. (eliminate_local_variables_1): Likewise. (create_call_for_reduction_1): Likewise. (create_loads_for_reductions): Likewise. (create_loads_and_stores_for_name): Likewise. * matrix-reorg.c (may_flatten_matrices_1): Sanitize. (ssa_accessed_in_tree): Handle MEM_REF. (ssa_accessed_in_assign_rhs): Likewise. (update_type_size): Likewise. (analyze_accesses_for_call_stmt): Likewise. (analyze_accesses_for_assign_stmt): Likewise. (transform_access_sites): Likewise. (transform_allocation_sites): Likewise. * tree-affine.c (tree_to_aff_combination): Handle MEM_REF. * tree-vect-data-refs.c (vect_create_addr_base_for_vector_ref): Do not handle INDIRECT_REF. * tree-ssa-phiopt.c (add_or_mark_expr): Handle MEM_REF. (cond_store_replacement): Likewise. * tree-ssa-pre.c (create_component_ref_by_pieces_1): Handle MEM_REF, no not handle INDIRECT_REFs. (insert_into_preds_of_block): Properly initialize avail. (phi_translate_1): Fold MEM_REFs. Re-evaluate constant offset for ARRAY_REFs. Properly handle reference lookups that require a bit re-interpretation. (can_PRE_operation): Do not handle INDIRECT_REF. Handle MEM_REF. * tree-sra.c * tree-sra.c (build_access_from_expr_1): Handle MEM_REF. (build_ref_for_offset_1): Remove. (build_ref_for_offset): Build MEM_REFs. (gate_intra_sra): Disable for now. (sra_ipa_modify_expr): Handle MEM_REF. (ipa_early_sra_gate): Disable for now. * tree-sra.c (create_access): Swap INDIRECT_REF handling for MEM_REF handling. (disqualify_base_of_expr): Likewise. (ptr_parm_has_direct_uses): Swap INDIRECT_REF handling for MEM_REF handling. (sra_ipa_modify_expr): Remove INDIRECT_REF handling. Use mem_ref_offset. Remove bogus folding. (build_access_from_expr_1): Properly handle MEM_REF for non IPA-SRA. (make_fancy_name_1): Add support for MEM_REF. * tree-predcom.c (ref_at_iteration): Handle MEM_REFs. * tree-mudflap.c (mf_xform_derefs_1): Adjust for MEM_REF. * ipa-prop.c (compute_complex_assign_jump_func): Handle MEM_REF. (compute_complex_ancestor_jump_func): Likewise. (ipa_analyze_virtual_call_uses): Likewise. * tree-ssa-forwprop.c (forward_propagate_addr_expr_1): Replace INDIRECT_REF folding with more generalized MEM_REF folding. (tree_ssa_forward_propagate_single_use_vars): Adjust accordingly. (forward_propagate_addr_into_variable_array_index): Also handle &ARRAY + I in addition to &ARRAY[0] + I. * tree-ssa-dce.c (ref_may_be_aliased): Handle MEM_REF. * tree-ssa-ter.c (find_replaceable_in_bb): Avoid TER if that creates assignments with overlap. * tree-nested.c (get_static_chain): Adjust for MEM_REF. (get_frame_field): Likewise. (get_nonlocal_debug_decl): Likewise. (convert_nonlocal_reference_op): Likewise. (struct nesting_info): Add mem_refs pointer-set. (create_nesting_tree): Allocate it. (convert_local_reference_op): Insert to be folded mem-refs. (fold_mem_refs): New function. (finalize_nesting_tree_1): Perform defered folding of mem-refs (free_nesting_tree): Free the pointer-set. * tree-vect-stmts.c (vectorizable_store): Adjust for MEM_REF. (vectorizable_load): Likewise. * tree-ssa-phiprop.c (phiprop_insert_phi): Adjust for MEM_REF. (propagate_with_phi): Likewise. * tree-object-size.c (addr_object_size): Handle MEM_REFs instead of INDIRECT_REFs. (compute_object_offset): Handle MEM_REF. (plus_stmt_object_size): Handle MEM_REF. (collect_object_sizes_for): Dispatch to plus_stmt_object_size for &MEM_REF. * tree-flow.h (get_addr_base_and_unit_offset): Declare. (symbol_marked_for_renaming): Likewise. * Makefile.in (tree-dfa.o): Add $(TOPLEV_H). (fold-const.o): Add $(TREE_FLOW_H). * tree-ssa-structalias.c (get_constraint_for_1): Handle MEM_REF. (find_func_clobbers): Likewise. * ipa-struct-reorg.c (decompose_indirect_ref_acc): Handle MEM_REF. (decompose_access): Likewise. (replace_field_acc): Likewise. (replace_field_access_stmt): Likewise. (insert_new_var_in_stmt): Likewise. (get_stmt_accesses): Likewise. (reorg_structs_drive): Disable. * config/i386/i386.c (ix86_va_start): Adjust for MEM_REF. (ix86_canonical_va_list_type): Likewise. cp/ * cp-gimplify.c (cp_gimplify_expr): Open-code the rhs predicate we are looking for, allow non-gimplified INDIRECT_REFs. testsuite/ * gcc.c-torture/execute/20100316-1.c: New testcase. * gcc.c-torture/execute/pr44468.c: Likewise. * gcc.c-torture/compile/20100609-1.c: Likewise. * gcc.dg/volatile2.c: Adjust. * gcc.dg/plugin/selfassign.c: Likewise. * gcc.dg/pr36902.c: Likewise. * gcc.dg/tree-ssa/foldaddr-2.c: Remove. * gcc.dg/tree-ssa/foldaddr-3.c: Likewise. * gcc.dg/tree-ssa/forwprop-8.c: Adjust. * gcc.dg/tree-ssa/pr17141-1.c: Likewise. * gcc.dg/tree-ssa/ssa-fre-13.c: Likewise. * gcc.dg/tree-ssa/ssa-fre-14.c: Likewise. * gcc.dg/tree-ssa/ssa-ccp-21.c: Likewise. * gcc.dg/tree-ssa/pta-ptrarith-1.c: Likewise. * gcc.dg/tree-ssa/20030807-7.c: Likewise. * gcc.dg/tree-ssa/forwprop-10.c: Likewise. * gcc.dg/tree-ssa/ssa-fre-1.c: Likewise. * gcc.dg/tree-ssa/pta-ptrarith-2.c: Likewise. * gcc.dg/tree-ssa/ssa-ccp-23.c: Likewise. * gcc.dg/tree-ssa/forwprop-1.c: Likewise. * gcc.dg/tree-ssa/forwprop-2.c: Likewise. * gcc.dg/tree-ssa/struct-aliasing-1.c: Likewise. * gcc.dg/tree-ssa/ssa-ccp-25.c: Likewise. * gcc.dg/tree-ssa/ssa-pre-26.c: Likewise. * gcc.dg/tree-ssa/struct-aliasing-2.c: Likewise. * gcc.dg/tree-ssa/ssa-ccp-26.c: Likewise. * gcc.dg/tree-ssa/ssa-sccvn-4.c: Likewise. * gcc.dg/tree-ssa/ssa-pre-7.c: Likewise. * gcc.dg/tree-ssa/forwprop-5.c: Likewise. * gcc.dg/struct/w_prof_two_strs.c: XFAIL. * gcc.dg/struct/wo_prof_escape_arg_to_local.c: Likewise. * gcc.dg/struct/wo_prof_global_var.c: Likewise. * gcc.dg/struct/wo_prof_malloc_size_var.c: Likewise. * gcc.dg/struct/w_prof_local_array.c: Likewise. * gcc.dg/struct/w_prof_single_str_global.c: Likewise. * gcc.dg/struct/wo_prof_escape_str_init.c: Likewise. * gcc.dg/struct/wo_prof_array_through_pointer.c: Likewise. * gcc.dg/struct/w_prof_global_array.c: Likewise. * gcc.dg/struct/wo_prof_array_field.c: Likewise. * gcc.dg/struct/wo_prof_single_str_local.c: Likewise. * gcc.dg/struct/w_prof_local_var.c: Likewise. * gcc.dg/struct/wo_prof_two_strs.c: Likewise. * gcc.dg/struct/wo_prof_empty_str.c: Likewise. * gcc.dg/struct/wo_prof_local_array.c: Likewise. * gcc.dg/struct/w_prof_global_var.c: Likewise. * gcc.dg/struct/wo_prof_single_str_global.c: Likewise. * gcc.dg/struct/wo_prof_escape_substr_value.c: Likewise. * gcc.dg/struct/wo_prof_global_array.c: Likewise. * gcc.dg/struct/wo_prof_escape_return.c: Likewise. * gcc.dg/struct/wo_prof_escape_substr_array.c: Likewise. * gcc.dg/struct/wo_prof_double_malloc.c: Likewise. * gcc.dg/struct/w_ratio_cold_str.c: Likewise. * gcc.dg/struct/wo_prof_escape_substr_pointer.c: Likewise. * gcc.dg/struct/wo_prof_local_var.c: Likewise. * gcc.dg/tree-prof/stringop-1.c: Adjust. * g++.dg/tree-ssa/pr31146.C: Likewise. * g++.dg/tree-ssa/copyprop-1.C: Likewise. * g++.dg/tree-ssa/pr33604.C: Likewise. * g++.dg/plugin/selfassign.c: Likewise. * gfortran.dg/array_memcpy_3.f90: Likewise. * gfortran.dg/array_memcpy_4.f90: Likewise. * c-c++-common/torture/pr42834.c: New testcase. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@161655 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/alias.c | 38 ++++++++++++++++++++++++++++---------- 1 file changed, 28 insertions(+), 10 deletions(-) (limited to 'gcc/alias.c') diff --git a/gcc/alias.c b/gcc/alias.c index 08c38bf6616..30717127be2 100644 --- a/gcc/alias.c +++ b/gcc/alias.c @@ -279,7 +279,8 @@ ao_ref_from_mem (ao_ref *ref, const_rtx mem) /* If this is a pointer dereference of a non-SSA_NAME punt. ??? We could replace it with a pointer to anything. */ - if (INDIRECT_REF_P (base) + if ((INDIRECT_REF_P (base) + || TREE_CODE (base) == MEM_REF) && TREE_CODE (TREE_OPERAND (base, 0)) != SSA_NAME) return false; @@ -293,10 +294,7 @@ ao_ref_from_mem (ao_ref *ref, const_rtx mem) void *namep; namep = pointer_map_contains (cfun->gimple_df->decls_to_pointers, base); if (namep) - { - ref->base_alias_set = get_alias_set (base); - ref->base = build1 (INDIRECT_REF, TREE_TYPE (base), *(tree *)namep); - } + ref->base = build_simple_mem_ref (*(tree *)namep); } ref->ref_alias_set = MEM_ALIAS_SET (mem); @@ -648,8 +646,8 @@ get_alias_set (tree t) { tree inner; - /* Remove any nops, then give the language a chance to do - something with this tree before we look at it. */ + /* Give the language a chance to do something with this tree + before we look at it. */ STRIP_NOPS (t); set = lang_hooks.get_alias_set (t); if (set != -1) @@ -659,21 +657,41 @@ get_alias_set (tree t) if (TREE_CODE (t) == TARGET_MEM_REF) t = TMR_ORIGINAL (t); - /* First see if the actual object referenced is an INDIRECT_REF from a - restrict-qualified pointer or a "void *". */ + /* Get the base object of the reference. */ inner = t; while (handled_component_p (inner)) { + /* If there is a VIEW_CONVERT_EXPR in the chain we cannot use + the type of any component references that wrap it to + determine the alias-set. */ + if (TREE_CODE (inner) == VIEW_CONVERT_EXPR) + t = TREE_OPERAND (inner, 0); inner = TREE_OPERAND (inner, 0); - STRIP_NOPS (inner); } + /* Handle pointer dereferences here, they can override the + alias-set. */ if (INDIRECT_REF_P (inner)) { set = get_deref_alias_set_1 (TREE_OPERAND (inner, 0)); if (set != -1) return set; } + else if (TREE_CODE (inner) == MEM_REF) + { + set = get_deref_alias_set_1 (TREE_OPERAND (inner, 1)); + if (set != -1) + return set; + } + + /* If the innermost reference is a MEM_REF that has a + conversion embedded treat it like a VIEW_CONVERT_EXPR above, + using the memory access type for determining the alias-set. */ + if (TREE_CODE (inner) == MEM_REF + && (TYPE_MAIN_VARIANT (TREE_TYPE (inner)) + != TYPE_MAIN_VARIANT + (TREE_TYPE (TREE_TYPE (TREE_OPERAND (inner, 1)))))) + return get_deref_alias_set (TREE_OPERAND (inner, 1)); /* Otherwise, pick up the outermost object that we could have a pointer to, processing conversions as above. */ -- cgit v1.2.1 From 0b205f4ca112a643f4f1b9c9886648b569e0b380 Mon Sep 17 00:00:00 2001 From: manu Date: Thu, 8 Jul 2010 04:22:54 +0000 Subject: =?UTF-8?q?2010-07-08=20=20Manuel=20L=C3=B3pez-Ib=C3=A1=C3=B1ez=20?= =?UTF-8?q?=20?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * toplev.h: Do not include diagnostic-core.h. Include diagnostic-core.h in every file that includes toplev.h. * c-tree.h: Do not include toplev.h. * pretty-print.h: Update comment. * Makefile.in: Update dependencies. * alias.c: Include diagnostic-core.h in every file that includes toplev.h. * attribs.c: Likewise. * auto-inc-dec.c: Likewise. * bb-reorder.c: Likewise. * bt-load.c: Likewise. * caller-save.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgbuild.c: Likewise. * cfgcleanup.c: Likewise. * cfghooks.c: Likewise. * cfgloop.c: Likewise. * combine.c: Likewise. * config/alpha/alpha.c: Likewise. * config/arc/arc.c: Likewise. * config/arm/arm.c: Likewise. * config/arm/pe.c: Likewise. * config/avr/avr.c: Likewise. * config/bfin/bfin.c: Likewise. * config/cris/cris.c: Likewise. * config/crx/crx.c: Likewise. * config/darwin-c.c: Likewise. * config/darwin.c: Likewise. * config/fr30/fr30.c: Likewise. * config/frv/frv.c: Likewise. * config/h8300/h8300.c: Likewise. * config/host-darwin.c: Likewise. * config/i386/i386.c: Likewise. * config/i386/netware.c: Likewise. * config/i386/nwld.c: Likewise. * config/i386/winnt-cxx.c: Likewise. * config/i386/winnt-stubs.c: Likewise. * config/i386/winnt.c: Likewise. * config/ia64/ia64-c.c: Likewise. * config/ia64/ia64.c: Likewise. * config/iq2000/iq2000.c: Likewise. * config/lm32/lm32.c: Likewise. * config/m32c/m32c-pragma.c: Likewise. * config/m32c/m32c.c: Likewise. * config/m32r/m32r.c: Likewise. * config/m68hc11/m68hc11.c: Likewise. * config/m68k/m68k.c: Likewise. * config/mcore/mcore.c: Likewise. * config/mep/mep-pragma.c: Likewise. * config/mep/mep.c: Likewise. * config/mmix/mmix.c: Likewise. * config/mn10300/mn10300.c: Likewise. * config/moxie/moxie.c: Likewise. * config/pa/pa.c: Likewise. * config/pdp11/pdp11.c: Likewise. * config/picochip/picochip.c: Likewise. * config/rs6000/rs6000-c.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/rx/rx.c: Likewise. * config/s390/s390.c: Likewise. * config/score/score.c: Likewise. * config/score/score3.c: Likewise. * config/score/score7.c: Likewise. * config/sh/sh.c: Likewise. * config/sh/symbian-base.c: Likewise. * config/sh/symbian-c.c: Likewise. * config/sh/symbian-cxx.c: Likewise. * config/sol2-c.c: Likewise. * config/sol2.c: Likewise. * config/sparc/sparc.c: Likewise. * config/spu/spu.c: Likewise. * config/stormy16/stormy16.c: Likewise. * config/v850/v850-c.c: Likewise. * config/v850/v850.c: Likewise. * config/vax/vax.c: Likewise. * config/vxworks.c: Likewise. * config/xtensa/xtensa.c: Likewise. * convert.c: Likewise. * cse.c: Likewise. * cselib.c: Likewise. * dbgcnt.c: Likewise. * dbxout.c: Likewise. * ddg.c: Likewise. * dominance.c: Likewise. * emit-rtl.c: Likewise. * explow.c: Likewise. * expmed.c: Likewise. * fixed-value.c: Likewise. * fold-const.c: Likewise. * fwprop.c: Likewise. * gcse.c: Likewise. * ggc-common.c: Likewise. * ggc-page.c: Likewise. * ggc-zone.c: Likewise. * gimple-low.c: Likewise. * gimplify.c: Likewise. * graph.c: Likewise. * haifa-sched.c: Likewise. * ifcvt.c: Likewise. * implicit-zee.c: Likewise. * integrate.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-conflicts.c: Likewise. * ira-costs.c: Likewise. * ira-lives.c: Likewise. * ira.c: Likewise. * lists.c: Likewise. * loop-doloop.c: Likewise. * loop-iv.c: Likewise. * lto-opts.c: Likewise. * lto-symtab.c: Likewise. * main.c: Likewise. * modulo-sched.c: Likewise. * optabs.c: Likewise. * params.c: Likewise. * plugin.c: Likewise. * postreload-gcse.c: Likewise. * postreload.c: Likewise. * predict.c: Likewise. * profile.c: Likewise. * real.c: Likewise. * regcprop.c: Likewise. * reginfo.c: Likewise. * regmove.c: Likewise. * reorg.c: Likewise. * resource.c: Likewise. * rtl.c: Likewise. * rtlanal.c: Likewise. * sched-deps.c: Likewise. * sched-ebb.c: Likewise. * sched-rgn.c: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-ir.c: Likewise. * simplify-rtx.c: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * targhooks.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-dump.c: Likewise. * tree-eh.c: Likewise. * tree-inline.c: Likewise. * tree-nomudflap.c: Likewise. * tree-object-size.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-phinodes.c: Likewise. * tree-profile.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-ssa.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vrp.c: Likewise. * varasm.c: Likewise. * vec.c: Likewise. * web.c: Likewise. * xcoffout.c: Likewise. c-family/ * c-common.h: Include diagnostic-core.h. Error if already included. * c-semantics.c: Do not define GCC_DIAG_STYLE here. cp/ * cp-tree.h: Do not include toplev.h. java/ * boehm.c: Include diagnostic-core.h in every file that includes toplev.h. * class.c: Likewise. * constants.c: Likewise. * decl.c: Likewise. * except.c: Likewise. * expr.c: Likewise. * jcf-parse.c: Likewise. * mangle.c: Likewise. * mangle_name.c: Likewise. * resource.c: Likewise. * typeck.c: Likewise. * verify-glue.c: Likewise. ada/ * gcc-interface/utils.c: Include diagnostic-core.h in every file that includes toplev.h. lto/ * lto-coff.c: Include diagnostic-core.h in every file that includes toplev.h. * lto-elf.c: Likewise. * lto-lang.c: Likewise. * lto-macho.c: Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@161943 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/alias.c | 1 + 1 file changed, 1 insertion(+) (limited to 'gcc/alias.c') diff --git a/gcc/alias.c b/gcc/alias.c index 30717127be2..034c4692500 100644 --- a/gcc/alias.c +++ b/gcc/alias.c @@ -34,6 +34,7 @@ along with GCC; see the file COPYING3. If not see #include "basic-block.h" #include "flags.h" #include "output.h" +#include "diagnostic-core.h" #include "toplev.h" #include "cselib.h" #include "splay-tree.h" -- cgit v1.2.1 From eb2c25b54b230c5efbaf84075ed139a8c5508883 Mon Sep 17 00:00:00 2001 From: rsandifo Date: Mon, 12 Jul 2010 18:53:49 +0000 Subject: gcc/ * rtl.h (target_rtl): Add x_static_reg_base_value. * alias.c (static_reg_base_value): Redefine as a macro. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@162092 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/alias.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'gcc/alias.c') diff --git a/gcc/alias.c b/gcc/alias.c index 034c4692500..e46c8e9741a 100644 --- a/gcc/alias.c +++ b/gcc/alias.c @@ -212,9 +212,8 @@ static rtx *new_reg_base_value; array. */ static GTY((deletable)) VEC(rtx,gc) *old_reg_base_value; -/* Static hunks of RTL used by the aliasing code; these are initialized - once per function to avoid unnecessary RTL allocations. */ -static GTY (()) rtx static_reg_base_value[FIRST_PSEUDO_REGISTER]; +#define static_reg_base_value \ + (this_target_rtl->x_static_reg_base_value) #define REG_BASE_VALUE(X) \ (REGNO (X) < VEC_length (rtx, reg_base_value) \ -- cgit v1.2.1 From 1767a056f10a2ccbc900df04d01193da73a3d272 Mon Sep 17 00:00:00 2001 From: froydnj Date: Thu, 15 Jul 2010 14:31:28 +0000 Subject: gcc/ * tree.h (DECL_CHAIN): Define. * alias.c: Carefully replace TREE_CHAIN with DECL_CHAIN. * c-decl.c: Likewise. * c-parser.c: Likewise. * c-typeck.c: Likewise. * cfgexpand.c: Likewise. * cgraph.c: Likewise. * cgraphunit.c: Likewise. * combine.c: Likewise. * config/alpha/alpha.c: Likewise. * config/arm/arm.c: Likewise. * config/frv/frv.c: Likewise. * config/i386/i386.c: Likewise. * config/i386/winnt-cxx.c: Likewise. * config/ia64/ia64.c: Likewise. * config/iq2000/iq2000.c: Likewise. * config/mep/mep.c: Likewise. * config/mips/mips.c: Likewise. * config/pa/som.h: Likewise. * config/rs6000/rs6000.c: Likewise. * config/s390/s390.c: Likewise. * config/sh/sh.c: Likewise. * config/sh/symbian-cxx.c: Likewise. * config/sparc/sparc.c: Likewise. * config/spu/spu.c: Likewise. * config/stormy16/stormy16.c: Likewise. * config/vxworks.c: Likewise. * config/xtensa/xtensa.c: Likewise. * coverage.c: Likewise. * dbxout.c: Likewise. * dwarf2out.c: Likewise. * emit-rtl.c: Likewise. * expr.c: Likewise. * function.c: Likewise. * gimple-low.c: Likewise. * gimple-pretty-print.c: Likewise. * gimplify.c: Likewise. * integrate.c: Likewise. * ipa-inline.c: Likewise. * ipa-prop.c: Likewise. * ipa-split.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-type-escape.c: Likewise. * langhooks.c: Likewise. * lto-cgraph.c: Likewise. * omp-low.c: Likewise. * stor-layout.c: Likewise. * tree-cfg.c: Likewise. * tree-complex.c: Likewise. * tree-dfa.c: Likewise. * tree-dump.c: Likewise. * tree-inline.c: Likewise. * tree-mudflap.c: Likewise. * tree-nested.c: Likewise. * tree-object-size.c: Likewise. * tree-pretty-print.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-tailcall.c: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. gcc/ada/ * gcc-interface/decl.c: Carefully replace TREE_CHAIN with DECL_CHAIN. * gcc-interface/trans.c: Likewise. * gcc-interface/utils.c: Likewise. * gcc-interface/utils2.c: Likewise. gcc/c-family/ * c-common.c: Carefully replace TREE_CHAIN with DECL_CHAIN. * c-format.c: Likewise. gcc/cp/ * cp-tree.h: Carefully replace TREE_CHAIN with DECL_CHAIN. * call.c: Likewise. * class.c: Likewise. * cp-gimplify.c: Likewise. * decl.c: Likewise. * decl2.c: Likewise. * init.c: Likewise. * mangle.c: Likewise. * name-lookup.c: Likewise. * optimize.c: Likewise. * parser.c: Likewise. * pt.c: Likewise. * rtti.c: Likewise. * search.c: Likewise. * semantics.c: Likewise. * typeck.c: Likewise. * typeck2.c: Likewise. gcc/fortran/ * f95-lang.c: Carefully replace TREE_CHAIN with DECL_CHAIN. * trans-common.c: Likewise. * trans-decl.c: Likewise. * trans-types.c: Likewise. * trans.c: Likewise. gcc/java/ * java-tree.h: Carefully replace TREE_CHAIN with DECL_CHAIN. * boehm.c: Likewise. * class.c: Likewise. * decl.c: Likewise. * expr.c: Likewise. * jcf-parse.c: Likewise. * typeck.c: Likewise. * verify-glue.c: Likewise. gcc/objc/ * objc-act.c: Carefully replace TREE_CHAIN with DECL_CHAIN. gcc/testsuite/ * g++.dg/plugin/attribute_plugin.c: Carefully replace TREE_CHAIN with DECL_CHAIN. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@162223 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/alias.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gcc/alias.c') diff --git a/gcc/alias.c b/gcc/alias.c index e46c8e9741a..2e28212f5b3 100644 --- a/gcc/alias.c +++ b/gcc/alias.c @@ -903,7 +903,7 @@ record_component_aliases (tree type) record_alias_subset (superset, get_alias_set (BINFO_TYPE (base_binfo))); } - for (field = TYPE_FIELDS (type); field != 0; field = TREE_CHAIN (field)) + for (field = TYPE_FIELDS (type); field != 0; field = DECL_CHAIN (field)) if (TREE_CODE (field) == FIELD_DECL && !DECL_NONADDRESSABLE_P (field)) record_alias_subset (superset, get_alias_set (TREE_TYPE (field))); break; -- cgit v1.2.1 From ec7b61e0099e20fa113a746eef25bee2aab87dda Mon Sep 17 00:00:00 2001 From: ebotcazou Date: Thu, 22 Jul 2010 19:33:45 +0000 Subject: * alias.c (get_alias_set): Fix formatting issues. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@162426 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/alias.c | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) (limited to 'gcc/alias.c') diff --git a/gcc/alias.c b/gcc/alias.c index 2e28212f5b3..93194907f1f 100644 --- a/gcc/alias.c +++ b/gcc/alias.c @@ -688,9 +688,9 @@ get_alias_set (tree t) conversion embedded treat it like a VIEW_CONVERT_EXPR above, using the memory access type for determining the alias-set. */ if (TREE_CODE (inner) == MEM_REF - && (TYPE_MAIN_VARIANT (TREE_TYPE (inner)) - != TYPE_MAIN_VARIANT - (TREE_TYPE (TREE_TYPE (TREE_OPERAND (inner, 1)))))) + && TYPE_MAIN_VARIANT (TREE_TYPE (inner)) + != TYPE_MAIN_VARIANT + (TREE_TYPE (TREE_TYPE (TREE_OPERAND (inner, 1))))) return get_deref_alias_set (TREE_OPERAND (inner, 1)); /* Otherwise, pick up the outermost object that we could have a pointer @@ -728,10 +728,13 @@ get_alias_set (tree t) return set; return 0; } + t = TYPE_CANONICAL (t); + /* Canonical types shouldn't form a tree nor should the canonical type require structural equality checks. */ - gcc_checking_assert (!TYPE_STRUCTURAL_EQUALITY_P (t) && TYPE_CANONICAL (t) == t); + gcc_checking_assert (TYPE_CANONICAL (t) == t + && !TYPE_STRUCTURAL_EQUALITY_P (t)); /* If this is a type with a known alias set, return it. */ if (TYPE_ALIAS_SET_KNOWN_P (t)) @@ -757,8 +760,7 @@ get_alias_set (tree t) /* There are no objects of FUNCTION_TYPE, so there's no point in using up an alias set for them. (There are, of course, pointers and references to functions, but that's different.) */ - else if (TREE_CODE (t) == FUNCTION_TYPE - || TREE_CODE (t) == METHOD_TYPE) + else if (TREE_CODE (t) == FUNCTION_TYPE || TREE_CODE (t) == METHOD_TYPE) set = 0; /* Unless the language specifies otherwise, let vector types alias @@ -776,18 +778,17 @@ get_alias_set (tree t) integer(kind=4)[4] the same alias set or not. Just be pragmatic here and make sure the array and its element type get the same alias set assigned. */ - else if (TREE_CODE (t) == ARRAY_TYPE - && !TYPE_NONALIASED_COMPONENT (t)) + else if (TREE_CODE (t) == ARRAY_TYPE && !TYPE_NONALIASED_COMPONENT (t)) set = get_alias_set (TREE_TYPE (t)); + /* Otherwise make a new alias set for this type. */ else - /* Otherwise make a new alias set for this type. */ set = new_alias_set (); TYPE_ALIAS_SET (t) = set; - /* If this is an aggregate type, we must record any component aliasing - information. */ + /* If this is an aggregate type or a complex type, we must record any + component aliasing information. */ if (AGGREGATE_TYPE_P (t) || TREE_CODE (t) == COMPLEX_TYPE) record_component_aliases (t); -- cgit v1.2.1 From 02f77cc46ebf74c127ad40243571834a3efb28ca Mon Sep 17 00:00:00 2001 From: steven Date: Thu, 22 Jul 2010 21:54:27 +0000 Subject: * alias.c (true_dependence_1): New function, merged version of true_dependence and canon_true_dependence. (true_dependence): Simplify. (canon_true_dependence): Simplify. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@162430 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/alias.c | 136 ++++++++++++++++++++++-------------------------------------- 1 file changed, 50 insertions(+), 86 deletions(-) (limited to 'gcc/alias.c') diff --git a/gcc/alias.c b/gcc/alias.c index 93194907f1f..dd846f3c996 100644 --- a/gcc/alias.c +++ b/gcc/alias.c @@ -2318,16 +2318,30 @@ nonoverlapping_memrefs_p (const_rtx x, const_rtx y) return sizex >= 0 && offsety >= offsetx + sizex; } -/* True dependence: X is read after store in MEM takes place. */ +/* Helper for true_dependence and canon_true_dependence. + Checks for true dependence: X is read after store in MEM takes place. -int -true_dependence (const_rtx mem, enum machine_mode mem_mode, const_rtx x, - bool (*varies) (const_rtx, bool)) + VARIES is the function that should be used as rtx_varies function. + + If MEM_CANONICALIZED is FALSE, then X_ADDR and MEM_ADDR should be + NULL_RTX, and the canonical addresses of MEM and X are both computed + here. If MEM_CANONICALIZED, then MEM must be already canonicalized. + + If X_ADDR is non-NULL, it is used in preference of XEXP (x, 0). + + Returns 1 if there is a true dependence, 0 otherwise. */ + +static int +true_dependence_1 (const_rtx mem, enum machine_mode mem_mode, rtx mem_addr, + const_rtx x, rtx x_addr, bool (*varies) (const_rtx, bool), + bool mem_canonicalized) { - rtx x_addr, mem_addr; rtx base; int ret; + gcc_checking_assert (mem_canonicalized ? (mem_addr != NULL_RTX) + : (mem_addr == NULL_RTX && x_addr == NULL_RTX)); + if (MEM_VOLATILE_P (x) && MEM_VOLATILE_P (mem)) return 1; @@ -2353,11 +2367,16 @@ true_dependence (const_rtx mem, enum machine_mode mem_mode, const_rtx x, if (MEM_ADDR_SPACE (mem) != MEM_ADDR_SPACE (x)) return 1; - if (mem_mode == VOIDmode) - mem_mode = GET_MODE (mem); + if (! mem_addr) + { + mem_addr = XEXP (mem, 0); + if (mem_mode == VOIDmode) + mem_mode = GET_MODE (mem); + } + + if (! x_addr) + x_addr = XEXP (x, 0); - x_addr = XEXP (x, 0); - mem_addr = XEXP (mem, 0); if (!((GET_CODE (x_addr) == VALUE && GET_CODE (mem_addr) != VALUE && reg_mentioned_p (x_addr, mem_addr)) @@ -2366,7 +2385,8 @@ true_dependence (const_rtx mem, enum machine_mode mem_mode, const_rtx x, && reg_mentioned_p (mem_addr, x_addr)))) { x_addr = get_addr (x_addr); - mem_addr = get_addr (mem_addr); + if (!mem_canonicalized) + mem_addr = get_addr (mem_addr); } base = find_base_term (x_addr); @@ -2379,7 +2399,8 @@ true_dependence (const_rtx mem, enum machine_mode mem_mode, const_rtx x, return 0; x_addr = canon_rtx (x_addr); - mem_addr = canon_rtx (mem_addr); + if (!mem_canonicalized) + mem_addr = canon_rtx (mem_addr); if ((ret = memrefs_conflict_p (GET_MODE_SIZE (mem_mode), mem_addr, SIZE_FOR_MODE (x), x_addr, 0)) != -1) @@ -2395,11 +2416,11 @@ true_dependence (const_rtx mem, enum machine_mode mem_mode, const_rtx x, return 1; /* We cannot use aliases_everything_p to test MEM, since we must look - at MEM_MODE, rather than GET_MODE (MEM). */ + at MEM_ADDR, rather than XEXP (mem, 0). */ if (mem_mode == QImode || GET_CODE (mem_addr) == AND) return 1; - /* In true_dependence we also allow BLKmode to alias anything. Why + /* ??? In true_dependence we also allow BLKmode to alias anything. Why don't we do this in anti_dependence and output_dependence? */ if (mem_mode == BLKmode || GET_MODE (x) == BLKmode) return 1; @@ -2410,87 +2431,30 @@ true_dependence (const_rtx mem, enum machine_mode mem_mode, const_rtx x, return rtx_refs_may_alias_p (x, mem, true); } +/* True dependence: X is read after store in MEM takes place. */ + +int +true_dependence (const_rtx mem, enum machine_mode mem_mode, const_rtx x, + bool (*varies) (const_rtx, bool)) +{ + return true_dependence_1 (mem, mem_mode, NULL_RTX, + x, NULL_RTX, varies, + /*mem_canonicalized=*/false); +} + /* Canonical true dependence: X is read after store in MEM takes place. Variant of true_dependence which assumes MEM has already been canonicalized (hence we no longer do that here). - The mem_addr argument has been added, since true_dependence computed - this value prior to canonicalizing. - If x_addr is non-NULL, it is used in preference of XEXP (x, 0). */ + The mem_addr argument has been added, since true_dependence_1 computed + this value prior to canonicalizing. */ int canon_true_dependence (const_rtx mem, enum machine_mode mem_mode, rtx mem_addr, const_rtx x, rtx x_addr, bool (*varies) (const_rtx, bool)) { - int ret; - - 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 (MEM_ALIAS_SET (x) == ALIAS_SET_MEMORY_BARRIER - || MEM_ALIAS_SET (mem) == ALIAS_SET_MEMORY_BARRIER) - return 1; - - /* Read-only memory is by definition never modified, and therefore can't - conflict with anything. We don't expect to find read-only set on MEM, - but stupid user tricks can produce them, so don't die. */ - if (MEM_READONLY_P (x)) - return 0; - - /* If we have MEMs refering to different address spaces (which can - potentially overlap), we cannot easily tell from the addresses - whether the references overlap. */ - if (MEM_ADDR_SPACE (mem) != MEM_ADDR_SPACE (x)) - return 1; - - if (! x_addr) - { - x_addr = XEXP (x, 0); - if (!((GET_CODE (x_addr) == VALUE - && GET_CODE (mem_addr) != VALUE - && reg_mentioned_p (x_addr, mem_addr)) - || (GET_CODE (x_addr) != VALUE - && GET_CODE (mem_addr) == VALUE - && reg_mentioned_p (mem_addr, x_addr)))) - x_addr = get_addr (x_addr); - } - - if (! base_alias_check (x_addr, mem_addr, GET_MODE (x), mem_mode)) - return 0; - - x_addr = canon_rtx (x_addr); - if ((ret = memrefs_conflict_p (GET_MODE_SIZE (mem_mode), mem_addr, - SIZE_FOR_MODE (x), x_addr, 0)) != -1) - return ret; - - if (DIFFERENT_ALIAS_SETS_P (x, mem)) - return 0; - - if (nonoverlapping_memrefs_p (x, mem)) - return 0; - - if (aliases_everything_p (x)) - return 1; - - /* We cannot use aliases_everything_p to test MEM, since we must look - at MEM_MODE, rather than GET_MODE (MEM). */ - if (mem_mode == QImode || GET_CODE (mem_addr) == AND) - return 1; - - /* In true_dependence we also allow BLKmode to alias anything. Why - don't we do this in anti_dependence and output_dependence? */ - if (mem_mode == BLKmode || GET_MODE (x) == BLKmode) - return 1; - - if (fixed_scalar_and_varying_struct_p (mem, x, mem_addr, x_addr, varies)) - return 0; - - return rtx_refs_may_alias_p (x, mem, true); + return true_dependence_1 (mem, mem_mode, mem_addr, + x, x_addr, varies, + /*mem_canonicalized=*/true); } /* Returns nonzero if a write to X might alias a previous read from -- cgit v1.2.1