2019-10-17 Jakub Jelinek <jakub@redhat.com>
+ PR tree-optimization/92056
+ * tree-object-size.c (cond_expr_object_size): Return early if then_
+ processing resulted in unknown size.
+
PR tree-optimization/92115
* tree-ssa-ifcombine.c (ifcombine_ifandif): Force condition into
temporary if it could trap.
2019-10-17 Jakub Jelinek <jakub@redhat.com>
+ PR tree-optimization/92056
+ * gcc.c-torture/compile/pr92056.c: New test.
+
PR tree-optimization/92115
* gcc.dg/pr92115.c: New test.
--- /dev/null
+/* PR tree-optimization/92056 */
+
+const char *d;
+
+void
+foo (int c, char *e, const char *a, const char *b)
+{
+ switch (c)
+ {
+ case 33:
+ for (;; d++)
+ if (__builtin_strcmp (b ? : "", d))
+ return;
+ break;
+ case 4:
+ __builtin_sprintf (e, a);
+ }
+}
else
expr_object_size (osi, var, then_);
+ if (object_sizes[object_size_type][varno] == unknown[object_size_type])
+ return reexamine;
+
if (TREE_CODE (else_) == SSA_NAME)
reexamine |= merge_object_sizes (osi, var, else_, 0);
else