PR tree-optimization/87110
* tree-ssa-dse.c (compute_trims): Handle non-constant
TYPE_SIZE_UNIT.
PR tree-optimization/87110
* gcc.c-torture/compile/pr87110.c: New test.
From-SVN: r263906
+2018-08-27 Jeff Law <law@redhat.com>
+
+ PR tree-optimization/87110
+ * tree-ssa-dse.c (compute_trims): Handle non-constant
+ TYPE_SIZE_UNIT.
+
2018-08-27 Martin Sebor <msebor@redhat.com>
PR tree-optimization/86914
+2018-08-27 Jeff Law <law@redhat.com>
+
+ PR tree-optimization/87110
+ * gcc.c-torture/compile/pr87110.c: New test.
+
2018-08-27 Martin Sebor <msebor@redhat.com>
PR tree-optimization/86914
--- /dev/null
+enum a { b, c };
+struct d {
+ _Bool e;
+ enum a f
+};
+g, h;
+i() {
+ struct d j[h];
+ j[0] = (struct d){.f = c};
+ for (; g;)
+ (struct d){};
+}
+
*trim_tail = last_orig - last_live;
/* But don't trim away out of bounds accesses, as this defeats
- proper warnings. */
+ proper warnings.
+
+ We could have a type with no TYPE_SIZE_UNIT or we could have a VLA
+ where TYPE_SIZE_UNIT is not a constant. */
if (*trim_tail
&& TYPE_SIZE_UNIT (TREE_TYPE (ref->base))
+ && TREE_CODE (TYPE_SIZE_UNIT (TREE_TYPE (ref->base))) == INTEGER_CST
&& compare_tree_int (TYPE_SIZE_UNIT (TREE_TYPE (ref->base)),
last_orig) <= 0)
*trim_tail = 0;