+2006-10-23 Zdenek Dvorak <dvorakz@suse.cz>
+
+ PR tree-optimization/14784
+ * tree-flow.h (struct var_ann_d): Add is_heapvar bit.
+ * tree-ssa-structalias.c (get_constraint_for,
+ intra_create_variable_infos): Set is_heapvar.
+ * tree-ssa-operands.c (access_can_touch_variable): Do not handle
+ non-heapvar pointer variables specially.
+
2006-10-23 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
PR middle-end/29335
+2006-10-23 Zdenek Dvorak <dvorakz@suse.cz>
+
+ PR tree-optimization/14784
+ * gcc.dg/alias-10.c: New test.
+
2006-10-23 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* gcc.dg/torture/builtin-sin-mpfr-1.c: New test.
--- /dev/null
+/* For PR tree-optimization/14784 */
+
+/* { dg-do compile } */
+/* { dg-options "-O2 -funswitch-loops -fdump-tree-unswitch-details" } */
+
+typedef struct bitmap_element_def
+{
+ unsigned int indx;
+} bitmap_element;
+
+typedef struct bitmap_head_def {
+ bitmap_element *first;
+ int using_obstack;
+} bitmap_head;
+typedef struct bitmap_head_def *bitmap;
+
+bitmap_element *bitmap_free;
+
+void foo (bitmap head, bitmap_element *elt)
+{
+ while (1)
+ {
+ /* Alias analysis problems used to prevent us from recognizing
+ that this condition is invariant. */
+ if (head->using_obstack)
+ bitmap_free = elt;
+ }
+}
+
+
+/* { dg-final { scan-tree-dump-times "Unswitching" 1 "unswitch"} } */
+/* { dg-final { cleanup-tree-dump "unswitch" } } */
in the v_may_def list. */
unsigned in_v_may_def_list : 1;
+ /* True for HEAP and PARM_NOALIAS artificial variables. */
+ unsigned is_heapvar : 1;
+
/* An artificial variable representing the memory location pointed-to by
all the pointer symbols that flow-insensitive alias analysis
(mostly type-based) considers to be aliased. If the variable is
&& flag_strict_aliasing
&& TREE_CODE (ref) != INDIRECT_REF
&& !MTAG_P (alias)
+ && !var_ann (alias)->is_heapvar
&& (TREE_CODE (base) != INDIRECT_REF
|| TREE_CODE (TREE_TYPE (base)) != UNION_TYPE)
&& !AGGREGATE_TYPE_P (TREE_TYPE (alias))
&& TREE_CODE (TREE_TYPE (alias)) != COMPLEX_TYPE
- && !POINTER_TYPE_P (TREE_TYPE (alias))
/* When the struct has may_alias attached to it, we need not to
return true. */
&& get_alias_set (base))
{
heapvar = create_tmp_var_raw (ptr_type_node, "HEAP");
DECL_EXTERNAL (heapvar) = 1;
+ get_var_ann (heapvar)->is_heapvar = 1;
if (referenced_vars)
add_referenced_var (heapvar);
heapvar_insert (t, heapvar);
{
heapvar = create_tmp_var_raw (TREE_TYPE (TREE_TYPE (t)),
"PARM_NOALIAS");
+ get_var_ann (heapvar)->is_heapvar = 1;
DECL_EXTERNAL (heapvar) = 1;
if (referenced_vars)
add_referenced_var (heapvar);