+2019-07-12 Richard Biener <rguenther@suse.de>
+
+ Backport from mainline
+ 2019-07-04 Jakub Jelinek <jakub@redhat.com>
+
+ PR tree-optimization/91063
+ * tree-vect-stmts.c (vect_init_vector): Call gsi_remove to remove
+ stmt from stmts sequence before calling vect_init_vector_1.
+ Formatting fix.
+
+ 2019-07-04 Richard Biener <rguenther@suse.de>
+
+ PR ipa/91062
+ * tree-pass.h (execute_all_ipa_transforms): Add a flag
+ parameter whether to disable GC collection.
+ * passes.c (execute_one_ipa_transform_pass): Likewise, and
+ honor it.
+ (execute_all_ipa_transforms): Likewise and pass it down.
+ * cgraph.c (cgraph_node::get_body): Do not invoke garbage
+ collection from applying IPA transforms.
+ * cgraphunit.c (cgraph_node::expand): Allow garbage collection
+ from applying IPA transforms.
+
+ 2019-06-26 Richard Biener <rguenther@suse.de>
+
+ PR ipa/90982
+ * tree-inline.c (remap_ssa_name): Copy SSA range info.
+
+ 2019-06-24 Richard Biener <rguenther@suse.de>
+
+ PR tree-optimization/90972
+ * tree-vect-stmts.c (vect_init_vector): Handle CONSTANT_CLASS_P
+ in common code, dealing with STRING_CST properly.
+
+ 2019-06-21 Richard Biener <rguenther@suse.de>
+
+ PR debug/90914
+ * dwarf2out.c (prune_unused_types_walk): Always consider
+ function-local extern declarations as used.
+
+ 2019-06-18 Richard Biener <rguenther@suse.de>
+
+ PR debug/90900
+ * cfgexpand.c (expand_debug_expr): Treat NOTE_P DECL_RTL
+ as if optimized away.
+
+ 2019-05-07 Richard Biener <rguenther@suse.de>
+
+ PR lto/90369
+ * lto-wrapper.c (debug_objcopy): Use the original filename
+ including archive offset for the filename used for -save-temps.
+
2019-07-12 Eric Botcazou <ebotcazou@adacore.com>
PR rtl-optimization/91136
op0 = DECL_RTL_IF_SET (exp);
/* This decl was probably optimized away. */
- if (!op0)
+ if (!op0
+ /* At least label RTXen are sometimes replaced by
+ NOTE_INSN_DELETED_LABEL. Any notes here are not
+ handled by copy_rtx. */
+ || NOTE_P (op0))
{
if (!VAR_P (exp)
|| DECL_EXTERNAL (exp)
set_dump_file (NULL);
push_cfun (DECL_STRUCT_FUNCTION (decl));
- execute_all_ipa_transforms ();
+ execute_all_ipa_transforms (true);
cgraph_edge::rebuild_edges ();
free_dominance_info (CDI_DOMINATORS);
free_dominance_info (CDI_POST_DOMINATORS);
bitmap_obstack_initialize (®_obstack); /* FIXME, only at RTL generation*/
- execute_all_ipa_transforms ();
+ execute_all_ipa_transforms (false);
/* Perform all tree transforms and optimizations. */
break;
/* premark_used_variables marks external variables --- don't mark
- them here. */
+ them here. But function-local externals are always considered
+ used. */
if (get_AT (die, DW_AT_external))
- return;
+ {
+ for (c = die->die_parent; c; c = c->die_parent)
+ if (c->die_tag == DW_TAG_subprogram)
+ break;
+ if (!c)
+ return;
+ }
}
/* FALLTHROUGH */
int err;
const char *p;
+ const char *orig_infile = infile;
off_t inoff = 0;
long loffset;
int consumed;
if (save_temps)
{
- outfile = (char *) xmalloc (strlen (infile)
+ outfile = (char *) xmalloc (strlen (orig_infile)
+ sizeof (".debug.temp.o") + 1);
- strcpy (outfile, infile);
+ strcpy (outfile, orig_infile);
strcat (outfile, ".debug.temp.o");
}
else
static void
execute_one_ipa_transform_pass (struct cgraph_node *node,
- ipa_opt_pass_d *ipa_pass)
+ ipa_opt_pass_d *ipa_pass, bool do_not_collect)
{
opt_pass *pass = ipa_pass;
unsigned int todo_after = 0;
redirect_edge_var_map_empty ();
/* Signal this is a suitable GC collection point. */
- if (!(todo_after & TODO_do_not_ggc_collect))
+ if (!do_not_collect && !(todo_after & TODO_do_not_ggc_collect))
ggc_collect ();
}
/* For the current function, execute all ipa transforms. */
void
-execute_all_ipa_transforms (void)
+execute_all_ipa_transforms (bool do_not_collect)
{
struct cgraph_node *node;
if (!cfun)
unsigned int i;
for (i = 0; i < node->ipa_transforms_to_apply.length (); i++)
- execute_one_ipa_transform_pass (node, node->ipa_transforms_to_apply[i]);
+ execute_one_ipa_transform_pass (node, node->ipa_transforms_to_apply[i],
+ do_not_collect);
node->ipa_transforms_to_apply.release ();
}
}
+2019-07-12 Richard Biener <rguenther@suse.de>
+
+ Backport from mainline
+ 2019-07-04 Jakub Jelinek <jakub@redhat.com>
+
+ PR tree-optimization/91063
+ * gcc.dg/gomp/pr91063.c: New test.
+
+ 2019-06-27 Richard Biener <rguenther@suse.de>
+
+ PR testsuite/91004
+ * g++.dg/torture/pr34850.C: Fix overly reduced testcase.
+
+ 2019-06-26 Richard Biener <rguenther@suse.de>
+
+ PR ipa/90982
+ * g++.dg/torture/pr90982.C: New testcase.
+
+ 2019-06-24 Richard Biener <rguenther@suse.de>
+
+ PR tree-optimization/90972
+ * gcc.dg/torture/pr90972.c: New testcase.
+
+ 2019-06-21 Richard Biener <rguenther@suse.de>
+
+ PR debug/90914
+ * g++.dg/debug/pr90914.C: New testcase.
+
+ 2019-06-18 Richard Biener <rguenther@suse.de>
+
+ PR debug/90900
+ * gcc.dg/gomp/pr90900.c: New testcase.
+
2019-07-11 Uroš Bizjak <ubizjak@gmail.com>
Backported from mainline
--- /dev/null
+// { dg-do compile }
+// { dg-additional-options "-feliminate-unused-debug-symbols" }
+
+template <class> class A;
+void f ()
+{
+ extern A <double> b;
+}
extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__, __artificial__))
void * memset (void *__dest, int __ch, size_t __len) throw () {
if (__builtin_constant_p (__len) && __len == 0)
- __warn_memset_zero_len ();
+ __warn_memset_zero_len ();
+ return __dest;
}
}
inline void clear_mem(void* ptr, u32bit n) {
--- /dev/null
+// { dg-do compile }
+
+template <int n> struct S
+{
+ long c[n];
+ void f (S d)
+ {
+ for (int i = 2;; i++)
+ c[i] &= d.c[i];
+ }
+};
+
+template <int m> struct T:S<m/64>
+{
+ void operator &= (T d)
+ { this -> f (d); }
+};
+
+void g (T<192> &d)
+{
+ T<192> v;
+ d &= v;
+}
--- /dev/null
+/* { dg-do compile } */
+/* { dg-options "-O2 -fopenmp -g" } */
+
+void f (int a)
+{
+ void *x = &&lab;
+#pragma omp parallel
+ if (a)
+ { lab: __builtin_unreachable(); }
+ x;
+}
--- /dev/null
+/* PR tree-optimization/91063 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -fopenmp-simd" } */
+/* { dg-additional-options "-mavx512f" { target { i?86-*-* x86_64-*-* } } } */
+
+struct S { void *s; };
+
+int
+foo (struct S *x)
+{
+ int r = 0;
+ int i;
+#pragma omp simd reduction (+ : r)
+ for (i = 0; i < 64; ++i)
+ r += (int) (x->s != 0);
+ return r;
+}
--- /dev/null
+/* { dg-do compile } */
+/* { dg-additional-options "-mcpu=power8" { target powerpc*-*-* } } */
+
+long f;
+void a();
+void *g()
+{
+ char h[] = {}, j[] = {}, k[] = {}, l[] = {}, m[] = {}, n[] = {}, o[] = {},
+ q[] = {}, r[] = {};
+ static const char i[] = {6, 0};
+ const char *nops[] = {h, i, j, k, l, m, n, o, q, r};
+ long s = 2;
+ void *fill = a;
+ char *p = fill;
+ while (f) {
+ void *b = p;
+ const void *c = nops[1];
+ long d = s, e = __builtin_object_size(b, 0);
+ __builtin___memcpy_chk(b, c, d, e);
+ p += s;
+ f -= s;
+ }
+ return fill;
+}
struct ptr_info_def *new_pi = get_ptr_info (new_tree);
new_pi->pt = pi->pt;
}
+ /* So can range-info. */
+ if (!POINTER_TYPE_P (TREE_TYPE (name))
+ && SSA_NAME_RANGE_INFO (name))
+ duplicate_ssa_name_range_info (new_tree, SSA_NAME_RANGE_TYPE (name),
+ SSA_NAME_RANGE_INFO (name));
return new_tree;
}
struct ptr_info_def *new_pi = get_ptr_info (new_tree);
new_pi->pt = pi->pt;
}
+ /* So can range-info. */
+ if (!POINTER_TYPE_P (TREE_TYPE (name))
+ && SSA_NAME_RANGE_INFO (name))
+ duplicate_ssa_name_range_info (new_tree, SSA_NAME_RANGE_TYPE (name),
+ SSA_NAME_RANGE_INFO (name));
if (SSA_NAME_IS_DEFAULT_DEF (name))
{
/* By inlining function having uninitialized variable, we might
extern void execute_pass_list (function *, opt_pass *);
extern void execute_ipa_pass_list (opt_pass *);
extern void execute_ipa_summary_passes (ipa_opt_pass_d *);
-extern void execute_all_ipa_transforms (void);
+extern void execute_all_ipa_transforms (bool);
extern void execute_all_ipa_stmt_fixups (struct cgraph_node *, gimple **);
extern bool pass_init_dump_file (opt_pass *);
extern void pass_fini_dump_file (opt_pass *);
val = new_temp;
}
}
- else if (CONSTANT_CLASS_P (val))
- val = fold_convert (TREE_TYPE (type), val);
else
{
- new_temp = make_ssa_name (TREE_TYPE (type));
+ gimple_seq stmts = NULL;
if (! INTEGRAL_TYPE_P (TREE_TYPE (val)))
- init_stmt = gimple_build_assign (new_temp,
- fold_build1 (VIEW_CONVERT_EXPR,
- TREE_TYPE (type),
- val));
+ val = gimple_build (&stmts, VIEW_CONVERT_EXPR,
+ TREE_TYPE (type), val);
else
- init_stmt = gimple_build_assign (new_temp, NOP_EXPR, val);
- vect_init_vector_1 (stmt_info, init_stmt, gsi);
- val = new_temp;
+ /* ??? Condition vectorization expects us to do
+ promotion of invariant/external defs. */
+ val = gimple_convert (&stmts, TREE_TYPE (type), val);
+ for (gimple_stmt_iterator gsi2 = gsi_start (stmts);
+ !gsi_end_p (gsi2); )
+ {
+ init_stmt = gsi_stmt (gsi2);
+ gsi_remove (&gsi2, false);
+ vect_init_vector_1 (stmt_info, init_stmt, gsi);
+ }
}
}
val = build_vector_from_val (type, val);
}
new_temp = vect_get_new_ssa_name (type, vect_simple_var, "cst_");
- init_stmt = gimple_build_assign (new_temp, val);
+ init_stmt = gimple_build_assign (new_temp, val);
vect_init_vector_1 (stmt_info, init_stmt, gsi);
return new_temp;
}