+2015-09-24 Richard Biener <rguenther@suse.de>
+
+ * tree-ssa-sccvn.h (vn_reference_op_struct): Add clique and base
+ members.
+ * tree-ssa-sccvn.c (copy_reference_ops_from_ref): Record clique
+ and base for MEM_REF and TARGET_MEM_REF. Handle BIT_FIELD_REF
+ offset.
+ (ao_ref_init_from_vn_reference): Record clique and base in the
+ built base.
+ * tree-ssa-pre.c (create_component_ref_by_pieces_1): Likewise
+
2015-09-24 Richard Biener <rguenther@suse.de>
PR tree-optimization/48885
+2015-09-24 Richard Biener <rguenther@suse.de>
+
+ * g++.dg/tree-ssa/restrict3.C: New testcase.
+
2015-09-24 Richard Biener <rguenther@suse.de>
PR tree-optimization/48885
--- /dev/null
+// { dg-do compile }
+// { dg-options "-O -fdump-tree-fre1" }
+
+int
+f (int *__restrict__ &__restrict__ p, int *p2)
+{
+ *p = 1;
+ *p2 = 2;
+ return *p;
+}
+
+// { dg-final { scan-tree-dump "return 1;" "fre1" } }
off));
baseop = build_fold_addr_expr (base);
}
- return fold_build2 (MEM_REF, currop->type, baseop, offset);
+ genop = build2 (MEM_REF, currop->type, baseop, offset);
+ MR_DEPENDENCE_CLIQUE (genop) = currop->clique;
+ MR_DEPENDENCE_BASE (genop) = currop->base;
+ return genop;
}
case TARGET_MEM_REF:
if (!genop1)
return NULL_TREE;
}
- return build5 (TARGET_MEM_REF, currop->type,
- baseop, currop->op2, genop0, currop->op1, genop1);
+ genop = build5 (TARGET_MEM_REF, currop->type,
+ baseop, currop->op2, genop0, currop->op1, genop1);
+
+ MR_DEPENDENCE_CLIQUE (genop) = currop->clique;
+ MR_DEPENDENCE_BASE (genop) = currop->base;
+ return genop;
}
case ADDR_EXPR:
temp.op1 = TMR_STEP (ref);
temp.op2 = TMR_OFFSET (ref);
temp.off = -1;
+ temp.clique = MR_DEPENDENCE_CLIQUE (ref);
+ temp.base = MR_DEPENDENCE_BASE (ref);
result->quick_push (temp);
memset (&temp, 0, sizeof (temp));
temp.op0 = TREE_OPERAND (ref, 1);
if (tree_fits_shwi_p (TREE_OPERAND (ref, 1)))
temp.off = tree_to_shwi (TREE_OPERAND (ref, 1));
+ temp.clique = MR_DEPENDENCE_CLIQUE (ref);
+ temp.base = MR_DEPENDENCE_BASE (ref);
break;
case BIT_FIELD_REF:
/* Record bits and position. */
temp.op0 = TREE_OPERAND (ref, 1);
temp.op1 = TREE_OPERAND (ref, 2);
+ if (tree_fits_shwi_p (TREE_OPERAND (ref, 2)))
+ {
+ HOST_WIDE_INT off = tree_to_shwi (TREE_OPERAND (ref, 2));
+ if (off % BITS_PER_UNIT == 0)
+ temp.off = off / BITS_PER_UNIT;
+ }
break;
case COMPONENT_REF:
/* The field decl is enough to unambiguously specify the field,
base_alias_set = get_deref_alias_set (op->op0);
*op0_p = build2 (MEM_REF, op->type,
NULL_TREE, op->op0);
+ MR_DEPENDENCE_CLIQUE (*op0_p) = op->clique;
+ MR_DEPENDENCE_BASE (*op0_p) = op->base;
op0_p = &TREE_OPERAND (*op0_p, 0);
break;
ENUM_BITFIELD(tree_code) opcode : 16;
/* 1 for instrumented calls. */
unsigned with_bounds : 1;
+ /* Dependence info, used for [TARGET_]MEM_REF only. */
+ unsigned short clique;
+ unsigned short base;
/* Constant offset this op adds or -1 if it is variable. */
HOST_WIDE_INT off;
tree type;