+2019-09-02 Richard Biener <rguenther@suse.de>
+
+ Backport from mainline
+ 2019-03-14 Richard Biener <rguenther@suse.de>
+
+ PR tree-optimization/89710
+ * tree-ssa-loop-ch.c (should_duplicate_loop_header_p): Use
+ safe_dyn_cast.
+
+ 2019-03-14 Richard Biener <rguenther@suse.de>
+
+ PR middle-end/89572
+ * tree-scalar-evolution.c (get_loop_exit_condition): Use
+ safe_dyn_cast.
+ * tree-ssa-loop-ivcanon.c (canonicalize_loop_induction_variables):
+ Use gimple_location_safe.
+
+ 2019-02-18 Richard Biener <rguenther@suse.de>
+
+ PR tree-optimization/89296
+ * tree-ssa-loop-ch.c (ch_base::copy_headers): Restrict setting
+ of no-warning flag to cases that might emit the bogus warning.
+
+ 2019-01-31 Richard Biener <rguenther@suse.de>
+
+ PR tree-optimization/89135
+ * tree-ssa-phiprop.c (pass_phiprop::execute): Skip blocks
+ with abnormal preds.
+
2019-09-02 Richard Biener <rguenther@suse.de>
Backport from mainline
+2019-09-02 Richard Biener <rguenther@suse.de>
+
+ Backport from mainline
+ 2019-02-21 Richard Biener <rguenther@suse.de>
+
+ PR middle-end/89392
+ * vtable-class-hierarchy.c (vtv_generate_init_routine): Do not
+ make symtab process new functions here.
+
2019-08-30 Jakub Jelinek <jakub@redhat.com>
Backported from mainline
gimplify_function_tree (vtv_fndecl);
cgraph_node::add_new_function (vtv_fndecl, false);
- symtab->process_new_functions ();
-
if (flag_vtable_verify == VTV_PREINIT_PRIORITY && !TARGET_PECOFF)
assemble_vtv_preinit_initializer (vtv_fndecl);
+2019-09-02 Richard Biener <rguenther@suse.de>
+
+ Backport from mainline
+ 2019-03-14 Richard Biener <rguenther@suse.de>
+
+ PR tree-optimization/89710
+ * gcc.dg/torture/pr89710.c: New testcase.
+
+ 2019-03-14 Richard Biener <rguenther@suse.de>
+
+ PR middle-end/89572
+ * gcc.dg/torture/pr89572.c: New testcase.
+
+ 2019-02-18 Richard Biener <rguenther@suse.de>
+
+ PR tree-optimization/89296
+ * gcc.dg/uninit-pr89296.c: New testcase.
+
+ 2019-01-31 Richard Biener <rguenther@suse.de>
+
+ PR tree-optimization/89135
+ * gcc.dg/torture/pr89135.c: New testcase.
+
2019-09-02 Richard Biener <rguenther@suse.de>
Backport from mainline
--- /dev/null
+/* { dg-do compile } */
+/* { dg-require-effective-target indirect_jumps } */
+/* { dg-require-effective-target label_values } */
+
+typedef __INTPTR_TYPE__ intptr_t;
+intptr_t a, b, c, d;
+int foo (void) { return 0; }
+int baz (void);
+
+void
+bar (void)
+{
+ intptr_t g = (intptr_t) &&h;
+ void *i = &&j, *k = &&l;
+j:
+ if (baz ())
+ {
+ intptr_t **n = (intptr_t **) &a;
+l:
+ b = 0;
+ for (; b >= 0;)
+ goto *k;
+h:
+ **n = 0;
+ for (;;)
+ {
+ intptr_t *o = &c;
+ g = foo ();
+ *o = g;
+ if (c)
+ goto *d;
+ }
+ }
+ goto *i;
+}
--- /dev/null
+/* { dg-do compile } */
+/* { dg-additional-options "-finline-functions" } */
+
+int vh, it, k1;
+
+void
+vn (void)
+{
+ ++vh;
+ if (vh == 0 && it == 0)
+ k1 = -k1;
+}
+
+__attribute__ ((returns_twice)) void
+ef (int *uw)
+{
+ while (uw != (void *) 0)
+ {
+ vn ();
+ *uw = 0;
+ }
+}
+
+void
+gu (int *uw)
+{
+ ef (uw);
+}
--- /dev/null
+/* { dg-do compile } */
+
+void
+gm (int *);
+
+__attribute__ ((returns_twice)) void
+jg (void)
+{
+}
+
+void
+eb (void)
+{
+ int r6 = 0;
+
+ if (r6 != 0)
+ gm (&r6);
+}
+
+void
+gm (int *r6)
+{
+ jg ();
+
+ for (;;)
+ {
+ eb ();
+ *r6 = 0;
+ }
+}
--- /dev/null
+/* { dg-do compile } */
+/* { dg-options "-O2 -Wuninitialized" } */
+
+int get_a_value ();
+void printk(const char *);
+void test_func()
+{
+ int loop;
+ while (!loop) { /* { dg-warning "is used uninitialized" } */
+ loop = get_a_value();
+ printk("...");
+ }
+}
gimple *stmt;
stmt = last_stmt (exit_edge->src);
- if (gcond *cond_stmt = dyn_cast <gcond *> (stmt))
+ if (gcond *cond_stmt = safe_dyn_cast <gcond *> (stmt))
res = cond_stmt;
}
}
last = last_stmt (header);
- if (gimple_code (last) != GIMPLE_COND)
+ if (!last || gimple_code (last) != GIMPLE_COND)
{
if (dump_file && (dump_flags & TDF_DETAILS))
fprintf (dump_file,
{
gimple *stmt = gsi_stmt (bsi);
if (gimple_code (stmt) == GIMPLE_COND)
- gimple_set_no_warning (stmt, true);
+ {
+ tree lhs = gimple_cond_lhs (stmt);
+ if (gimple_cond_code (stmt) != EQ_EXPR
+ && gimple_cond_code (stmt) != NE_EXPR
+ && INTEGRAL_TYPE_P (TREE_TYPE (lhs))
+ && TYPE_OVERFLOW_UNDEFINED (TREE_TYPE (lhs)))
+ gimple_set_no_warning (stmt, true);
+ }
else if (is_gimple_assign (stmt))
{
enum tree_code rhs_code = gimple_assign_rhs_code (stmt);
- if (TREE_CODE_CLASS (rhs_code) == tcc_comparison)
+ tree rhs1 = gimple_assign_rhs1 (stmt);
+ if (TREE_CODE_CLASS (rhs_code) == tcc_comparison
+ && rhs_code != EQ_EXPR
+ && rhs_code != NE_EXPR
+ && INTEGRAL_TYPE_P (TREE_TYPE (rhs1))
+ && TYPE_OVERFLOW_UNDEFINED (TREE_TYPE (rhs1)))
gimple_set_no_warning (stmt, true);
}
}
niter = number_of_latch_executions (loop);
exit = single_exit (loop);
if (TREE_CODE (niter) == INTEGER_CST)
- locus = gimple_location (last_stmt (exit->src));
+ locus = gimple_location_safe (last_stmt (exit->src));
else
{
/* If the loop has more than one exit, try checking all of them
niter = find_loop_niter_by_eval (loop, &exit);
if (exit)
- locus = gimple_location (last_stmt (exit->src));
+ locus = gimple_location_safe (last_stmt (exit->src));
if (TREE_CODE (niter) != INTEGER_CST)
exit = NULL;
bbs = get_all_dominated_blocks (CDI_DOMINATORS,
single_succ (ENTRY_BLOCK_PTR_FOR_FN (fun)));
FOR_EACH_VEC_ELT (bbs, i, bb)
- for (gsi = gsi_start_phis (bb); !gsi_end_p (gsi); gsi_next (&gsi))
- did_something |= propagate_with_phi (bb, gsi.phi (), phivn, n);
+ {
+ /* Since we're going to move dereferences across predecessor
+ edges avoid blocks with abnormal predecessors. */
+ if (bb_has_abnormal_pred (bb))
+ continue;
+ for (gsi = gsi_start_phis (bb); !gsi_end_p (gsi); gsi_next (&gsi))
+ did_something |= propagate_with_phi (bb, gsi.phi (), phivn, n);
+ }
if (did_something)
gsi_commit_edge_inserts ();