+2018-11-20 Richard Biener <rguenther@suse.de>
+
+ PR middle-end/83215
+ * alias.c (component_uses_parent_alias_set_from): Remove
+ alias-set zero and TYPE_TYPELESS_STORAGE case both already
+ handled in other ways.
+
2018-11-20 Richard Biener <rguenther@suse.de>
PR tree-optimization/88087
/* Return the outermost parent of component present in the chain of
component references handled by get_inner_reference in T with the
following property:
- - the component is non-addressable, or
- - the parent has alias set zero,
+ - the component is non-addressable
or NULL_TREE if no such parent exists. In the former cases, the alias
set of this parent is the alias set that must be used for T itself. */
{
const_tree found = NULL_TREE;
- if (AGGREGATE_TYPE_P (TREE_TYPE (t))
- && TYPE_TYPELESS_STORAGE (TREE_TYPE (t)))
- return const_cast <tree> (t);
-
while (handled_component_p (t))
{
switch (TREE_CODE (t))
gcc_unreachable ();
}
- if (get_alias_set (TREE_TYPE (TREE_OPERAND (t, 0))) == 0)
- found = t;
-
t = TREE_OPERAND (t, 0);
}
+2018-11-20 Richard Biener <rguenther@suse.de>
+
+ PR middle-end/83215
+ * g++.dg/tree-ssa/pr83215.C: New testcase.
+
2018-11-20 Eric Botcazou <ebotcazou@adacore.com>
* gcc.c-torture/execute/20181120-1.c: New test.
--- /dev/null
+// { dg-do compile }
+// { dg-options "-O2 -fdump-tree-fre1" }
+
+struct mytest
+{
+ float a;
+ char buf[256];
+};
+
+int foo(mytest *m, int *i)
+{
+ int tmp = *i;
+ m->a = 10.0f;
+ return tmp + *i;
+}
+
+// we should be able to CSE *i despite mytest having a cbar[] buffer
+// and thus being subject to TYPE_TYPELESS_STORAGE
+// { dg-final { scan-tree-dump-times "\\*i" 1 "fre1" } }