Push bugfix patches - part 2

This commit is contained in:
eastb233 2020-09-21 19:40:05 +08:00
parent 7b3cceeaa4
commit 6d5481c8fc
7 changed files with 515 additions and 122 deletions

View File

@ -1,6 +1,6 @@
diff -Nurp a/gcc/ipa-struct-reorg/escapes.def b/gcc/ipa-struct-reorg/escapes.def diff -Nurp a/gcc/ipa-struct-reorg/escapes.def b/gcc/ipa-struct-reorg/escapes.def
--- a/gcc/ipa-struct-reorg/escapes.def 2020-07-18 05:11:11.548000000 -0400 --- a/gcc/ipa-struct-reorg/escapes.def 2020-09-17 02:26:36.900000000 -0400
+++ b/gcc/ipa-struct-reorg/escapes.def 2020-07-18 05:16:25.928000000 -0400 +++ b/gcc/ipa-struct-reorg/escapes.def 2020-09-17 02:59:19.308000000 -0400
@@ -56,5 +56,7 @@ DEF_ESCAPE (escape_non_optimize, "Type u @@ -56,5 +56,7 @@ DEF_ESCAPE (escape_non_optimize, "Type u
DEF_ESCAPE (escape_array, "Type is used in an array [not handled yet]") DEF_ESCAPE (escape_array, "Type is used in an array [not handled yet]")
DEF_ESCAPE (escape_ptr_ptr, "Type is used in a pointer to a pointer [not handled yet]") DEF_ESCAPE (escape_ptr_ptr, "Type is used in a pointer to a pointer [not handled yet]")
@ -10,8 +10,8 @@ diff -Nurp a/gcc/ipa-struct-reorg/escapes.def b/gcc/ipa-struct-reorg/escapes.def
#undef DEF_ESCAPE #undef DEF_ESCAPE
diff -Nurp a/gcc/ipa-struct-reorg/ipa-struct-reorg.c b/gcc/ipa-struct-reorg/ipa-struct-reorg.c diff -Nurp a/gcc/ipa-struct-reorg/ipa-struct-reorg.c b/gcc/ipa-struct-reorg/ipa-struct-reorg.c
--- a/gcc/ipa-struct-reorg/ipa-struct-reorg.c 2020-07-18 05:11:17.664000000 -0400 --- a/gcc/ipa-struct-reorg/ipa-struct-reorg.c 2020-09-17 02:58:59.540000000 -0400
+++ b/gcc/ipa-struct-reorg/ipa-struct-reorg.c 2020-07-20 09:08:08.912000000 -0400 +++ b/gcc/ipa-struct-reorg/ipa-struct-reorg.c 2020-09-17 04:55:03.992000000 -0400
@@ -95,6 +95,7 @@ along with GCC; see the file COPYING3. @@ -95,6 +95,7 @@ along with GCC; see the file COPYING3.
#include "ipa-struct-reorg.h" #include "ipa-struct-reorg.h"
#include "tree-eh.h" #include "tree-eh.h"
@ -28,7 +28,7 @@ diff -Nurp a/gcc/ipa-struct-reorg/ipa-struct-reorg.c b/gcc/ipa-struct-reorg/ipa-
/* Return true iff TYPE is stdarg va_list type. */ /* Return true iff TYPE is stdarg va_list type. */
@@ -152,6 +154,14 @@ handled_type (tree type) @@ -158,6 +160,14 @@ handled_type (tree type)
return false; return false;
} }
@ -43,7 +43,7 @@ diff -Nurp a/gcc/ipa-struct-reorg/ipa-struct-reorg.c b/gcc/ipa-struct-reorg/ipa-
} // anon namespace } // anon namespace
namespace struct_reorg { namespace struct_reorg {
@@ -241,7 +251,8 @@ srtype::srtype (tree type) @@ -247,7 +257,8 @@ srtype::srtype (tree type)
: type (type), : type (type),
chain_type (false), chain_type (false),
escapes (does_not_escape), escapes (does_not_escape),
@ -53,7 +53,7 @@ diff -Nurp a/gcc/ipa-struct-reorg/ipa-struct-reorg.c b/gcc/ipa-struct-reorg/ipa-
{ {
for (int i = 0; i < max_split; i++) for (int i = 0; i < max_split; i++)
newtype[i] = NULL_TREE; newtype[i] = NULL_TREE;
@@ -441,13 +452,6 @@ srtype::dump (FILE *f) @@ -447,13 +458,6 @@ srtype::dump (FILE *f)
fn->simple_dump (f); fn->simple_dump (f);
} }
fprintf (f, "\n }\n"); fprintf (f, "\n }\n");
@ -67,7 +67,7 @@ diff -Nurp a/gcc/ipa-struct-reorg/ipa-struct-reorg.c b/gcc/ipa-struct-reorg/ipa-
fprintf (f, "}\n"); fprintf (f, "}\n");
} }
@@ -798,12 +802,6 @@ srfield::dump (FILE *f) @@ -804,12 +808,6 @@ srfield::dump (FILE *f)
fprintf (f, ", offset = " HOST_WIDE_INT_PRINT_DEC, offset); fprintf (f, ", offset = " HOST_WIDE_INT_PRINT_DEC, offset);
fprintf (f, ", type = "); fprintf (f, ", type = ");
print_generic_expr (f, fieldtype); print_generic_expr (f, fieldtype);
@ -80,7 +80,7 @@ diff -Nurp a/gcc/ipa-struct-reorg/ipa-struct-reorg.c b/gcc/ipa-struct-reorg/ipa-
fprintf (f, "\n}\n"); fprintf (f, "\n}\n");
} }
@@ -813,7 +811,10 @@ srfield::dump (FILE *f) @@ -819,7 +817,10 @@ srfield::dump (FILE *f)
void void
srfield::simple_dump (FILE *f) srfield::simple_dump (FILE *f)
{ {
@ -92,7 +92,7 @@ diff -Nurp a/gcc/ipa-struct-reorg/ipa-struct-reorg.c b/gcc/ipa-struct-reorg/ipa-
} }
/* Dump out the access structure to FILE. */ /* Dump out the access structure to FILE. */
@@ -857,21 +858,113 @@ srdecl::dump (FILE *file) @@ -863,21 +864,120 @@ srdecl::dump (FILE *file)
} // namespace struct_reorg } // namespace struct_reorg
@ -119,6 +119,11 @@ diff -Nurp a/gcc/ipa-struct-reorg/ipa-struct-reorg.c b/gcc/ipa-struct-reorg/ipa-
+unsigned +unsigned
+csrtype::calculate_field_num (tree field_offset) +csrtype::calculate_field_num (tree field_offset)
+{ +{
+ if (field_offset == NULL)
+ {
+ return 0;
+ }
+
+ HOST_WIDE_INT off = int_byte_position (field_offset); + HOST_WIDE_INT off = int_byte_position (field_offset);
+ unsigned i = 1; + unsigned i = 1;
+ for (tree field = TYPE_FIELDS (type); field; field = DECL_CHAIN (field)) + for (tree field = TYPE_FIELDS (type); field; field = DECL_CHAIN (field))
@ -141,7 +146,9 @@ diff -Nurp a/gcc/ipa-struct-reorg/ipa-struct-reorg.c b/gcc/ipa-struct-reorg/ipa-
+ } + }
+ new_size = old_size = tree_to_uhwi (TYPE_SIZE_UNIT (type)); + new_size = old_size = tree_to_uhwi (TYPE_SIZE_UNIT (type));
+ +
+ /* Close enough to pad to improve performance. */ + /* Close enough to pad to improve performance.
+ 33~63 should pad to 64 but 33~48 (first half) are too far away, and
+ 65~127 should pad to 128 but 65~96 (first half) are too far away. */
+ if (old_size > 48 && old_size < 64) + if (old_size > 48 && old_size < 64)
+ { + {
+ new_size = 64; + new_size = 64;
@ -210,7 +217,7 @@ diff -Nurp a/gcc/ipa-struct-reorg/ipa-struct-reorg.c b/gcc/ipa-struct-reorg/ipa-
// fields // fields
auto_vec_del<srtype> types; auto_vec_del<srtype> types;
auto_vec_del<srfunction> functions; auto_vec_del<srfunction> functions;
@@ -879,8 +972,8 @@ private: @@ -885,8 +985,8 @@ private:
srfunction *current_function; srfunction *current_function;
bool done_recording; bool done_recording;
@ -220,7 +227,7 @@ diff -Nurp a/gcc/ipa-struct-reorg/ipa-struct-reorg.c b/gcc/ipa-struct-reorg/ipa-
void dump_types (FILE *f); void dump_types (FILE *f);
void dump_types_escaped (FILE *f); void dump_types_escaped (FILE *f);
void dump_functions (FILE *f); void dump_functions (FILE *f);
@@ -910,6 +1003,7 @@ private: @@ -916,6 +1016,7 @@ private:
void maybe_record_allocation_site (cgraph_node *, gimple *); void maybe_record_allocation_site (cgraph_node *, gimple *);
void record_stmt_expr (tree expr, cgraph_node *node, gimple *stmt); void record_stmt_expr (tree expr, cgraph_node *node, gimple *stmt);
void mark_expr_escape(tree, escape_type, gimple *stmt); void mark_expr_escape(tree, escape_type, gimple *stmt);
@ -228,7 +235,7 @@ diff -Nurp a/gcc/ipa-struct-reorg/ipa-struct-reorg.c b/gcc/ipa-struct-reorg/ipa-
tree allocate_size (srtype *t, gimple *stmt); tree allocate_size (srtype *t, gimple *stmt);
void mark_decls_in_as_not_needed (tree fn); void mark_decls_in_as_not_needed (tree fn);
@@ -925,6 +1019,7 @@ private: @@ -931,6 +1032,7 @@ private:
bool get_type_field (tree expr, tree &base, bool &indirect, srtype *&type, srfield *&field, bool &realpart, bool &imagpart, bool &address, bool should_create = false, bool can_escape = false); bool get_type_field (tree expr, tree &base, bool &indirect, srtype *&type, srfield *&field, bool &realpart, bool &imagpart, bool &address, bool should_create = false, bool can_escape = false);
bool wholeaccess (tree expr, tree base, tree accesstype, srtype *t); bool wholeaccess (tree expr, tree base, tree accesstype, srtype *t);
@ -236,24 +243,24 @@ diff -Nurp a/gcc/ipa-struct-reorg/ipa-struct-reorg.c b/gcc/ipa-struct-reorg/ipa-
void check_definition (srdecl *decl, vec<srdecl*>&); void check_definition (srdecl *decl, vec<srdecl*>&);
void check_uses (srdecl *decl, vec<srdecl*>&); void check_uses (srdecl *decl, vec<srdecl*>&);
void check_use (srdecl *decl, gimple *stmt, vec<srdecl*>&); void check_use (srdecl *decl, gimple *stmt, vec<srdecl*>&);
@@ -937,8 +1032,631 @@ private: @@ -943,8 +1045,644 @@ private:
bool has_rewritten_type (srfunction*); bool has_rewritten_type (srfunction*);
void maybe_mark_or_record_other_side (tree side, tree other, gimple *stmt); void maybe_mark_or_record_other_side (tree side, tree other, gimple *stmt);
+ unsigned execute_struct_relayout (void); + unsigned execute_struct_relayout (void);
+}; };
+
+struct ipa_struct_relayout +struct ipa_struct_relayout
+{ +{
+public: +public:
+ // fields + // fields
+ tree gptr[max_relayout_split + 1]; + tree gptr[max_relayout_split + 1];
+ csrtype ctype; + csrtype ctype;
+ ipa_struct_reorg* sr; + ipa_struct_reorg *sr;
+ cgraph_node* current_node; + cgraph_node *current_node;
+ +
+ // Constructors + // Constructors
+ ipa_struct_relayout (tree type, ipa_struct_reorg* sr_) + ipa_struct_relayout (tree type, ipa_struct_reorg *sr_)
+ { + {
+ ctype.type = type; + ctype.type = type;
+ sr = sr_; + sr = sr_;
@ -283,8 +290,8 @@ diff -Nurp a/gcc/ipa-struct-reorg/ipa-struct-reorg.c b/gcc/ipa-struct-reorg/ipa-
+ bool maybe_rewrite_cst (tree cst, gimple_stmt_iterator *gsi, + bool maybe_rewrite_cst (tree cst, gimple_stmt_iterator *gsi,
+ HOST_WIDE_INT &times); + HOST_WIDE_INT &times);
+ unsigned int execute (void); + unsigned int execute (void);
}; +};
+
+} // anon namespace +} // anon namespace
+ +
+namespace { +namespace {
@ -349,8 +356,13 @@ diff -Nurp a/gcc/ipa-struct-reorg/ipa-struct-reorg.c b/gcc/ipa-struct-reorg/ipa-
+ fprintf (dump_file, "Create global gptrs: {\n"); + fprintf (dump_file, "Create global gptrs: {\n");
+ } + }
+ +
+ char *gptr0_name = NULL;
+ const char *type_name = get_type_name (ctype.type); + const char *type_name = get_type_name (ctype.type);
+ char *gptr0_name = concat (type_name, "_gptr0", NULL); +
+ if (type_name)
+ {
+ gptr0_name = concat (type_name, "_gptr0", NULL);
+ }
+ tree var_gptr0 = create_new_vars (ctype.type, gptr0_name); + tree var_gptr0 = create_new_vars (ctype.type, gptr0_name);
+ gptr[0] = var_gptr0; + gptr[0] = var_gptr0;
+ varpool_node::add (var_gptr0); + varpool_node::add (var_gptr0);
@ -368,8 +380,10 @@ diff -Nurp a/gcc/ipa-struct-reorg/ipa-struct-reorg.c b/gcc/ipa-struct-reorg/ipa-
+ sprintf (id, "%d", i); + sprintf (id, "%d", i);
+ const char *decl_name = IDENTIFIER_POINTER (DECL_NAME (field)); + const char *decl_name = IDENTIFIER_POINTER (DECL_NAME (field));
+ +
+ name = concat (type_name, "_", decl_name, "_gptr", id, NULL); + if (type_name && decl_name)
+ + {
+ name = concat (type_name, "_", decl_name, "_gptr", id, NULL);
+ }
+ tree var = create_new_vars (type, name); + tree var = create_new_vars (type, name);
+ +
+ gptr[i] = var; + gptr[i] = var;
@ -441,6 +455,11 @@ diff -Nurp a/gcc/ipa-struct-reorg/ipa-struct-reorg.c b/gcc/ipa-struct-reorg/ipa-
+ if (cnode->definition) + if (cnode->definition)
+ { + {
+ fn = DECL_STRUCT_FUNCTION (cnode->decl); + fn = DECL_STRUCT_FUNCTION (cnode->decl);
+ if (fn == NULL)
+ {
+ continue;
+ }
+
+ current_node = cnode; + current_node = cnode;
+ push_cfun (fn); + push_cfun (fn);
+ +
@ -469,7 +488,7 @@ diff -Nurp a/gcc/ipa-struct-reorg/ipa-struct-reorg.c b/gcc/ipa-struct-reorg/ipa-
+bool +bool
+ipa_struct_relayout::rewrite_debug (gimple *stmt, gimple_stmt_iterator *gsi) +ipa_struct_relayout::rewrite_debug (gimple *stmt, gimple_stmt_iterator *gsi)
+{ +{
+ /* TODO: For future implement. */ + /* Delete debug gimple now. */
+ return true; + return true;
+} +}
+ +
@ -508,15 +527,15 @@ diff -Nurp a/gcc/ipa-struct-reorg/ipa-struct-reorg.c b/gcc/ipa-struct-reorg/ipa-
+ /* Case that gimple is at the end of bb. */ + /* Case that gimple is at the end of bb. */
+ if (gsi_one_before_end_p (*gsi)) + if (gsi_one_before_end_p (*gsi))
+ { + {
+ gassign* gptr0 = gimple_build_assign (gptr[0], lhs); + gassign *gptr0 = gimple_build_assign (gptr[0], lhs);
+ gsi_insert_after (gsi, gptr0, GSI_SAME_STMT); + gsi_insert_after (gsi, gptr0, GSI_SAME_STMT);
+ } + }
+ gsi_next (gsi); + gsi_next (gsi);
+ +
+ /* Emit gimple gptr0 = _X and gptr1 = _X. */ + /* Emit gimple gptr0 = _X and gptr1 = _X. */
+ gassign* gptr0 = gimple_build_assign (gptr[0], lhs); + gassign *gptr0 = gimple_build_assign (gptr[0], lhs);
+ gsi_insert_before (gsi, gptr0, GSI_SAME_STMT); + gsi_insert_before (gsi, gptr0, GSI_SAME_STMT);
+ gassign* gptr1 = gimple_build_assign (gptr[1], lhs); + gassign *gptr1 = gimple_build_assign (gptr[1], lhs);
+ gsi_insert_before (gsi, gptr1, GSI_SAME_STMT); + gsi_insert_before (gsi, gptr1, GSI_SAME_STMT);
+ +
+ /* Emit gimple gptr_[i] = gptr_[i-1] + _Y[gap]. */ + /* Emit gimple gptr_[i] = gptr_[i-1] + _Y[gap]. */
@ -612,6 +631,7 @@ diff -Nurp a/gcc/ipa-struct-reorg/ipa-struct-reorg.c b/gcc/ipa-struct-reorg/ipa-
+tree +tree
+ipa_struct_relayout::create_ssa (tree node, gimple_stmt_iterator *gsi) +ipa_struct_relayout::create_ssa (tree node, gimple_stmt_iterator *gsi)
+{ +{
+ gcc_assert (TREE_CODE (node) == VAR_DECL);
+ tree node_ssa = make_ssa_name (TREE_TYPE (node)); + tree node_ssa = make_ssa_name (TREE_TYPE (node));
+ gassign *stmt = gimple_build_assign (node_ssa, node); + gassign *stmt = gimple_build_assign (node_ssa, node);
+ gsi_insert_before (gsi, stmt, GSI_SAME_STMT); + gsi_insert_before (gsi, stmt, GSI_SAME_STMT);
@ -868,7 +888,7 @@ diff -Nurp a/gcc/ipa-struct-reorg/ipa-struct-reorg.c b/gcc/ipa-struct-reorg/ipa-
/* Dump all of the recorded types to file F. */ /* Dump all of the recorded types to file F. */
void void
@@ -1134,8 +1852,10 @@ ipa_struct_reorg::record_type (tree type @@ -1140,8 +1878,10 @@ ipa_struct_reorg::record_type (tree type
f->type = t1; f->type = t1;
t1->add_field_site (f); t1->add_field_site (f);
} }
@ -881,7 +901,7 @@ diff -Nurp a/gcc/ipa-struct-reorg/ipa-struct-reorg.c b/gcc/ipa-struct-reorg/ipa-
} }
} }
} }
@@ -1272,6 +1992,14 @@ ipa_struct_reorg::record_var (tree decl, @@ -1278,6 +2018,14 @@ ipa_struct_reorg::record_var (tree decl,
else else
e = escape_type_volatile_array_or_ptrptr (TREE_TYPE (decl)); e = escape_type_volatile_array_or_ptrptr (TREE_TYPE (decl));
@ -896,7 +916,7 @@ diff -Nurp a/gcc/ipa-struct-reorg/ipa-struct-reorg.c b/gcc/ipa-struct-reorg/ipa-
if (e != does_not_escape) if (e != does_not_escape)
type->mark_escape (e, NULL); type->mark_escape (e, NULL);
} }
@@ -1347,7 +2075,8 @@ ipa_struct_reorg::find_vars (gimple *stm @@ -1353,7 +2101,8 @@ ipa_struct_reorg::find_vars (gimple *stm
{ {
case GIMPLE_ASSIGN: case GIMPLE_ASSIGN:
if (gimple_assign_rhs_class (stmt) == GIMPLE_SINGLE_RHS if (gimple_assign_rhs_class (stmt) == GIMPLE_SINGLE_RHS
@ -906,7 +926,7 @@ diff -Nurp a/gcc/ipa-struct-reorg/ipa-struct-reorg.c b/gcc/ipa-struct-reorg/ipa-
{ {
tree lhs = gimple_assign_lhs (stmt); tree lhs = gimple_assign_lhs (stmt);
tree rhs = gimple_assign_rhs1 (stmt); tree rhs = gimple_assign_rhs1 (stmt);
@@ -1372,6 +2101,32 @@ ipa_struct_reorg::find_vars (gimple *stm @@ -1378,6 +2127,32 @@ ipa_struct_reorg::find_vars (gimple *stm
current_function->record_decl (t, rhs, -1); current_function->record_decl (t, rhs, -1);
} }
} }
@ -939,7 +959,7 @@ diff -Nurp a/gcc/ipa-struct-reorg/ipa-struct-reorg.c b/gcc/ipa-struct-reorg/ipa-
break; break;
case GIMPLE_CALL: case GIMPLE_CALL:
@@ -1453,9 +2208,23 @@ is_result_of_mult (tree arg, tree *num, @@ -1459,9 +2234,23 @@ is_result_of_mult (tree arg, tree *num,
/* If we have a integer, just check if it is a multiply of STRUCT_SIZE. */ /* If we have a integer, just check if it is a multiply of STRUCT_SIZE. */
if (TREE_CODE (arg) == INTEGER_CST) if (TREE_CODE (arg) == INTEGER_CST)
{ {
@ -965,7 +985,7 @@ diff -Nurp a/gcc/ipa-struct-reorg/ipa-struct-reorg.c b/gcc/ipa-struct-reorg/ipa-
return true; return true;
} }
return false; return false;
@@ -1525,15 +2294,19 @@ is_result_of_mult (tree arg, tree *num, @@ -1531,15 +2320,19 @@ is_result_of_mult (tree arg, tree *num,
/* Return TRUE if STMT is an allocation statement that is handled. */ /* Return TRUE if STMT is an allocation statement that is handled. */
@ -993,7 +1013,7 @@ diff -Nurp a/gcc/ipa-struct-reorg/ipa-struct-reorg.c b/gcc/ipa-struct-reorg/ipa-
return true; return true;
return false; return false;
} }
@@ -1575,7 +2348,8 @@ ipa_struct_reorg::allocate_size (srtype @@ -1581,7 +2374,8 @@ ipa_struct_reorg::allocate_size (srtype
/* Check that second argument is a constant equal to the size of structure. */ /* Check that second argument is a constant equal to the size of structure. */
if (operand_equal_p (arg1, struct_size, 0)) if (operand_equal_p (arg1, struct_size, 0))
return size; return size;
@ -1003,7 +1023,7 @@ diff -Nurp a/gcc/ipa-struct-reorg/ipa-struct-reorg.c b/gcc/ipa-struct-reorg/ipa-
if (operand_equal_p (size, struct_size, 0)) if (operand_equal_p (size, struct_size, 0))
return arg1; return arg1;
if (dump_file && (dump_flags & TDF_DETAILS)) if (dump_file && (dump_flags & TDF_DETAILS))
@@ -1692,6 +2466,29 @@ ipa_struct_reorg::maybe_record_assign (c @@ -1698,6 +2492,29 @@ ipa_struct_reorg::maybe_record_assign (c
} }
} }
@ -1033,7 +1053,7 @@ diff -Nurp a/gcc/ipa-struct-reorg/ipa-struct-reorg.c b/gcc/ipa-struct-reorg/ipa-
tree tree
get_ref_base_and_offset (tree &e, HOST_WIDE_INT &offset, bool &realpart, bool &imagpart, tree &accesstype) get_ref_base_and_offset (tree &e, HOST_WIDE_INT &offset, bool &realpart, bool &imagpart, tree &accesstype)
{ {
@@ -1731,7 +2528,10 @@ get_ref_base_and_offset (tree &e, HOST_W @@ -1737,7 +2554,10 @@ get_ref_base_and_offset (tree &e, HOST_W
gcc_assert (TREE_CODE (field_off) == INTEGER_CST); gcc_assert (TREE_CODE (field_off) == INTEGER_CST);
/* So we can mark the types as escaping if different. */ /* So we can mark the types as escaping if different. */
accesstype = TREE_TYPE (field_off); accesstype = TREE_TYPE (field_off);
@ -1045,7 +1065,7 @@ diff -Nurp a/gcc/ipa-struct-reorg/ipa-struct-reorg.c b/gcc/ipa-struct-reorg/ipa-
return TREE_OPERAND (expr, 0); return TREE_OPERAND (expr, 0);
} }
default: default:
@@ -2108,6 +2908,39 @@ ipa_struct_reorg::check_type_and_push (t @@ -2114,6 +2934,39 @@ ipa_struct_reorg::check_type_and_push (t
} }
@ -1085,7 +1105,7 @@ diff -Nurp a/gcc/ipa-struct-reorg/ipa-struct-reorg.c b/gcc/ipa-struct-reorg/ipa-
/* /*
2) Check SSA_NAMEs for non type usages (source or use) (worlist of srdecl) 2) Check SSA_NAMEs for non type usages (source or use) (worlist of srdecl)
a) if the SSA_NAME is sourced from a pointer plus, record the pointer and a) if the SSA_NAME is sourced from a pointer plus, record the pointer and
@@ -2151,6 +2984,7 @@ ipa_struct_reorg::check_definition (srde @@ -2157,6 +3010,7 @@ ipa_struct_reorg::check_definition (srde
if (!handled_allocation_stmt (stmt) if (!handled_allocation_stmt (stmt)
|| !allocate_size (type, stmt)) || !allocate_size (type, stmt))
type->mark_escape (escape_return, stmt); type->mark_escape (escape_return, stmt);
@ -1093,7 +1113,7 @@ diff -Nurp a/gcc/ipa-struct-reorg/ipa-struct-reorg.c b/gcc/ipa-struct-reorg/ipa-
return; return;
} }
/* If the SSA_NAME is sourced from an inline-asm, just mark the type as escaping. */ /* If the SSA_NAME is sourced from an inline-asm, just mark the type as escaping. */
@@ -2189,6 +3023,21 @@ ipa_struct_reorg::check_definition (srde @@ -2195,6 +3049,21 @@ ipa_struct_reorg::check_definition (srde
return; return;
} }
@ -1115,7 +1135,7 @@ diff -Nurp a/gcc/ipa-struct-reorg/ipa-struct-reorg.c b/gcc/ipa-struct-reorg/ipa-
/* Casts between pointers and integer are escaping. */ /* Casts between pointers and integer are escaping. */
if (gimple_assign_cast_p (stmt)) if (gimple_assign_cast_p (stmt))
{ {
@@ -2251,6 +3100,13 @@ ipa_struct_reorg::check_other_side (srde @@ -2257,6 +3126,13 @@ ipa_struct_reorg::check_other_side (srde
srtype *t1 = find_type (inner_type (t)); srtype *t1 = find_type (inner_type (t));
if (t1 == type) if (t1 == type)
{ {
@ -1129,7 +1149,7 @@ diff -Nurp a/gcc/ipa-struct-reorg/ipa-struct-reorg.c b/gcc/ipa-struct-reorg/ipa-
tree base; tree base;
bool indirect; bool indirect;
srtype *type1; srtype *type1;
@@ -2298,8 +3154,11 @@ ipa_struct_reorg::check_use (srdecl *dec @@ -2304,8 +3180,11 @@ ipa_struct_reorg::check_use (srdecl *dec
tree rhs1 = gimple_cond_lhs (stmt); tree rhs1 = gimple_cond_lhs (stmt);
tree rhs2 = gimple_cond_rhs (stmt); tree rhs2 = gimple_cond_rhs (stmt);
tree orhs = rhs1; tree orhs = rhs1;
@ -1143,7 +1163,7 @@ diff -Nurp a/gcc/ipa-struct-reorg/ipa-struct-reorg.c b/gcc/ipa-struct-reorg/ipa-
{ {
mark_expr_escape (rhs1, escape_non_eq, stmt); mark_expr_escape (rhs1, escape_non_eq, stmt);
mark_expr_escape (rhs2, escape_non_eq, stmt); mark_expr_escape (rhs2, escape_non_eq, stmt);
@@ -2329,8 +3188,11 @@ ipa_struct_reorg::check_use (srdecl *dec @@ -2335,8 +3214,11 @@ ipa_struct_reorg::check_use (srdecl *dec
tree rhs1 = gimple_assign_rhs1 (stmt); tree rhs1 = gimple_assign_rhs1 (stmt);
tree rhs2 = gimple_assign_rhs2 (stmt); tree rhs2 = gimple_assign_rhs2 (stmt);
tree orhs = rhs1; tree orhs = rhs1;
@ -1157,7 +1177,7 @@ diff -Nurp a/gcc/ipa-struct-reorg/ipa-struct-reorg.c b/gcc/ipa-struct-reorg/ipa-
{ {
mark_expr_escape (rhs1, escape_non_eq, stmt); mark_expr_escape (rhs1, escape_non_eq, stmt);
mark_expr_escape (rhs2, escape_non_eq, stmt); mark_expr_escape (rhs2, escape_non_eq, stmt);
@@ -2727,8 +3589,11 @@ ipa_struct_reorg::propagate_escape (void @@ -2733,8 +3615,11 @@ ipa_struct_reorg::propagate_escape (void
void void
ipa_struct_reorg::prune_escaped_types (void) ipa_struct_reorg::prune_escaped_types (void)
{ {
@ -1171,7 +1191,7 @@ diff -Nurp a/gcc/ipa-struct-reorg/ipa-struct-reorg.c b/gcc/ipa-struct-reorg/ipa-
if (dump_file && (dump_flags & TDF_DETAILS)) if (dump_file && (dump_flags & TDF_DETAILS))
{ {
@@ -3850,16 +4715,82 @@ ipa_struct_reorg::rewrite_functions (voi @@ -3856,16 +4741,82 @@ ipa_struct_reorg::rewrite_functions (voi
} }
unsigned int unsigned int
@ -1216,8 +1236,7 @@ diff -Nurp a/gcc/ipa-struct-reorg/ipa-struct-reorg.c b/gcc/ipa-struct-reorg/ipa-
+ "Complete Structure Relayout.\n"); + "Complete Structure Relayout.\n");
+ } + }
+ } + }
+
- return rewrite_functions ();
+ return retval; + return retval;
+} +}
+ +
@ -1229,7 +1248,7 @@ diff -Nurp a/gcc/ipa-struct-reorg/ipa-struct-reorg.c b/gcc/ipa-struct-reorg/ipa-
+ if (mode == NORMAL) + if (mode == NORMAL)
+ { + {
+ current_mode = NORMAL; + current_mode = NORMAL;
+ /* FIXME: If there is a top-level inline-asm, + /* If there is a top-level inline-asm,
+ the pass immediately returns. */ + the pass immediately returns. */
+ if (symtab->first_asm_symbol ()) + if (symtab->first_asm_symbol ())
+ { + {
@ -1238,7 +1257,8 @@ diff -Nurp a/gcc/ipa-struct-reorg/ipa-struct-reorg.c b/gcc/ipa-struct-reorg/ipa-
+ record_accesses (); + record_accesses ();
+ prune_escaped_types (); + prune_escaped_types ();
+ analyze_types (); + analyze_types ();
+
- return rewrite_functions ();
+ ret = rewrite_functions (); + ret = rewrite_functions ();
+ } + }
+ else if (mode == COMPLETE_STRUCT_RELAYOUT) + else if (mode == COMPLETE_STRUCT_RELAYOUT)
@ -1262,7 +1282,7 @@ diff -Nurp a/gcc/ipa-struct-reorg/ipa-struct-reorg.c b/gcc/ipa-struct-reorg/ipa-
} }
const pass_data pass_data_ipa_struct_reorg = const pass_data pass_data_ipa_struct_reorg =
@@ -3884,17 +4815,27 @@ public: @@ -3890,17 +4841,27 @@ public:
/* opt_pass methods: */ /* opt_pass methods: */
virtual bool gate (function *); virtual bool gate (function *);
@ -1294,8 +1314,8 @@ diff -Nurp a/gcc/ipa-struct-reorg/ipa-struct-reorg.c b/gcc/ipa-struct-reorg/ipa-
} // anon namespace } // anon namespace
diff -Nurp a/gcc/ipa-struct-reorg/ipa-struct-reorg.h b/gcc/ipa-struct-reorg/ipa-struct-reorg.h diff -Nurp a/gcc/ipa-struct-reorg/ipa-struct-reorg.h b/gcc/ipa-struct-reorg/ipa-struct-reorg.h
--- a/gcc/ipa-struct-reorg/ipa-struct-reorg.h 2020-07-18 05:11:11.548000000 -0400 --- a/gcc/ipa-struct-reorg/ipa-struct-reorg.h 2020-09-17 02:26:36.904000000 -0400
+++ b/gcc/ipa-struct-reorg/ipa-struct-reorg.h 2020-07-18 05:16:25.928000000 -0400 +++ b/gcc/ipa-struct-reorg/ipa-struct-reorg.h 2020-09-17 02:59:19.308000000 -0400
@@ -121,6 +121,7 @@ public: @@ -121,6 +121,7 @@ public:
tree newtype[max_split]; tree newtype[max_split];
@ -1341,7 +1361,7 @@ diff -Nurp a/gcc/ipa-struct-reorg/ipa-struct-reorg.h b/gcc/ipa-struct-reorg/ipa-
#endif #endif
diff -Nurp a/gcc/testsuite/gcc.dg/struct/complete_struct_relayout.c b/gcc/testsuite/gcc.dg/struct/complete_struct_relayout.c diff -Nurp a/gcc/testsuite/gcc.dg/struct/complete_struct_relayout.c b/gcc/testsuite/gcc.dg/struct/complete_struct_relayout.c
--- a/gcc/testsuite/gcc.dg/struct/complete_struct_relayout.c 1969-12-31 19:00:00.000000000 -0500 --- a/gcc/testsuite/gcc.dg/struct/complete_struct_relayout.c 1969-12-31 19:00:00.000000000 -0500
+++ b/gcc/testsuite/gcc.dg/struct/complete_struct_relayout.c 2020-07-18 05:16:25.928000000 -0400 +++ b/gcc/testsuite/gcc.dg/struct/complete_struct_relayout.c 2020-09-17 02:59:19.308000000 -0400
@@ -0,0 +1,60 @@ @@ -0,0 +1,60 @@
+// { dg-do run } +// { dg-do run }
+ +
@ -1405,7 +1425,7 @@ diff -Nurp a/gcc/testsuite/gcc.dg/struct/complete_struct_relayout.c b/gcc/testsu
+/* { dg-final { scan-ipa-dump "Number of structures to transform in Complete Structure Relayout is 1" "struct_reorg" } } */ +/* { dg-final { scan-ipa-dump "Number of structures to transform in Complete Structure Relayout is 1" "struct_reorg" } } */
diff -Nurp a/gcc/testsuite/gcc.dg/struct/csr_allocation-1.c b/gcc/testsuite/gcc.dg/struct/csr_allocation-1.c diff -Nurp a/gcc/testsuite/gcc.dg/struct/csr_allocation-1.c b/gcc/testsuite/gcc.dg/struct/csr_allocation-1.c
--- a/gcc/testsuite/gcc.dg/struct/csr_allocation-1.c 1969-12-31 19:00:00.000000000 -0500 --- a/gcc/testsuite/gcc.dg/struct/csr_allocation-1.c 1969-12-31 19:00:00.000000000 -0500
+++ b/gcc/testsuite/gcc.dg/struct/csr_allocation-1.c 2020-07-18 05:16:25.928000000 -0400 +++ b/gcc/testsuite/gcc.dg/struct/csr_allocation-1.c 2020-09-17 02:59:19.308000000 -0400
@@ -0,0 +1,46 @@ @@ -0,0 +1,46 @@
+#include <stdlib.h> +#include <stdlib.h>
+#include <stdio.h> +#include <stdio.h>
@ -1455,7 +1475,7 @@ diff -Nurp a/gcc/testsuite/gcc.dg/struct/csr_allocation-1.c b/gcc/testsuite/gcc.
+/* { dg-final { scan-ipa-dump "No structures to transform in Complete Structure Relayout." "struct_reorg" } } */ +/* { dg-final { scan-ipa-dump "No structures to transform in Complete Structure Relayout." "struct_reorg" } } */
diff -Nurp a/gcc/testsuite/gcc.dg/struct/csr_allocation-2.c b/gcc/testsuite/gcc.dg/struct/csr_allocation-2.c diff -Nurp a/gcc/testsuite/gcc.dg/struct/csr_allocation-2.c b/gcc/testsuite/gcc.dg/struct/csr_allocation-2.c
--- a/gcc/testsuite/gcc.dg/struct/csr_allocation-2.c 1969-12-31 19:00:00.000000000 -0500 --- a/gcc/testsuite/gcc.dg/struct/csr_allocation-2.c 1969-12-31 19:00:00.000000000 -0500
+++ b/gcc/testsuite/gcc.dg/struct/csr_allocation-2.c 2020-07-18 05:16:25.928000000 -0400 +++ b/gcc/testsuite/gcc.dg/struct/csr_allocation-2.c 2020-09-17 02:59:19.308000000 -0400
@@ -0,0 +1,59 @@ @@ -0,0 +1,59 @@
+#include <stdlib.h> +#include <stdlib.h>
+#include <stdio.h> +#include <stdio.h>
@ -1518,7 +1538,7 @@ diff -Nurp a/gcc/testsuite/gcc.dg/struct/csr_allocation-2.c b/gcc/testsuite/gcc.
+/* { dg-final { scan-ipa-dump "No structures to transform in Complete Structure Relayout." "struct_reorg" } } */ +/* { dg-final { scan-ipa-dump "No structures to transform in Complete Structure Relayout." "struct_reorg" } } */
diff -Nurp a/gcc/testsuite/gcc.dg/struct/csr_allocation-3.c b/gcc/testsuite/gcc.dg/struct/csr_allocation-3.c diff -Nurp a/gcc/testsuite/gcc.dg/struct/csr_allocation-3.c b/gcc/testsuite/gcc.dg/struct/csr_allocation-3.c
--- a/gcc/testsuite/gcc.dg/struct/csr_allocation-3.c 1969-12-31 19:00:00.000000000 -0500 --- a/gcc/testsuite/gcc.dg/struct/csr_allocation-3.c 1969-12-31 19:00:00.000000000 -0500
+++ b/gcc/testsuite/gcc.dg/struct/csr_allocation-3.c 2020-07-18 05:16:25.928000000 -0400 +++ b/gcc/testsuite/gcc.dg/struct/csr_allocation-3.c 2020-09-17 02:59:19.308000000 -0400
@@ -0,0 +1,77 @@ @@ -0,0 +1,77 @@
+#include <stdlib.h> +#include <stdlib.h>
+#include <stdio.h> +#include <stdio.h>
@ -1599,7 +1619,7 @@ diff -Nurp a/gcc/testsuite/gcc.dg/struct/csr_allocation-3.c b/gcc/testsuite/gcc.
+/* { dg-final { scan-ipa-dump "No structures to transform in Complete Structure Relayout." "struct_reorg" } } */ +/* { dg-final { scan-ipa-dump "No structures to transform in Complete Structure Relayout." "struct_reorg" } } */
diff -Nurp a/gcc/testsuite/gcc.dg/struct/csr_cast_int.c b/gcc/testsuite/gcc.dg/struct/csr_cast_int.c diff -Nurp a/gcc/testsuite/gcc.dg/struct/csr_cast_int.c b/gcc/testsuite/gcc.dg/struct/csr_cast_int.c
--- a/gcc/testsuite/gcc.dg/struct/csr_cast_int.c 1969-12-31 19:00:00.000000000 -0500 --- a/gcc/testsuite/gcc.dg/struct/csr_cast_int.c 1969-12-31 19:00:00.000000000 -0500
+++ b/gcc/testsuite/gcc.dg/struct/csr_cast_int.c 2020-07-18 05:16:25.928000000 -0400 +++ b/gcc/testsuite/gcc.dg/struct/csr_cast_int.c 2020-09-17 02:59:19.308000000 -0400
@@ -0,0 +1,52 @@ @@ -0,0 +1,52 @@
+// { dg-do run } +// { dg-do run }
+ +
@ -1655,7 +1675,7 @@ diff -Nurp a/gcc/testsuite/gcc.dg/struct/csr_cast_int.c b/gcc/testsuite/gcc.dg/s
+/* { dg-final { scan-ipa-dump "struct node has escaped: \"Type escapes a cast from/to intergral type\"" "struct_reorg" } } */ +/* { dg-final { scan-ipa-dump "struct node has escaped: \"Type escapes a cast from/to intergral type\"" "struct_reorg" } } */
diff -Nurp a/gcc/testsuite/gcc.dg/struct/csr_separate_instance.c b/gcc/testsuite/gcc.dg/struct/csr_separate_instance.c diff -Nurp a/gcc/testsuite/gcc.dg/struct/csr_separate_instance.c b/gcc/testsuite/gcc.dg/struct/csr_separate_instance.c
--- a/gcc/testsuite/gcc.dg/struct/csr_separate_instance.c 1969-12-31 19:00:00.000000000 -0500 --- a/gcc/testsuite/gcc.dg/struct/csr_separate_instance.c 1969-12-31 19:00:00.000000000 -0500
+++ b/gcc/testsuite/gcc.dg/struct/csr_separate_instance.c 2020-07-18 05:16:25.928000000 -0400 +++ b/gcc/testsuite/gcc.dg/struct/csr_separate_instance.c 2020-09-17 02:59:19.308000000 -0400
@@ -0,0 +1,48 @@ @@ -0,0 +1,48 @@
+#include <stdlib.h> +#include <stdlib.h>
+#include <stdio.h> +#include <stdio.h>
@ -1707,7 +1727,7 @@ diff -Nurp a/gcc/testsuite/gcc.dg/struct/csr_separate_instance.c b/gcc/testsuite
+/* { dg-final { scan-ipa-dump "struct node has escaped: \"Type escapes via a separate instance\"" "struct_reorg" } } */ +/* { dg-final { scan-ipa-dump "struct node has escaped: \"Type escapes via a separate instance\"" "struct_reorg" } } */
diff -Nurp a/gcc/testsuite/gcc.dg/struct/sr_address_of_field.c b/gcc/testsuite/gcc.dg/struct/sr_address_of_field.c diff -Nurp a/gcc/testsuite/gcc.dg/struct/sr_address_of_field.c b/gcc/testsuite/gcc.dg/struct/sr_address_of_field.c
--- a/gcc/testsuite/gcc.dg/struct/sr_address_of_field.c 1969-12-31 19:00:00.000000000 -0500 --- a/gcc/testsuite/gcc.dg/struct/sr_address_of_field.c 1969-12-31 19:00:00.000000000 -0500
+++ b/gcc/testsuite/gcc.dg/struct/sr_address_of_field.c 2020-07-18 05:16:25.928000000 -0400 +++ b/gcc/testsuite/gcc.dg/struct/sr_address_of_field.c 2020-09-17 02:59:19.308000000 -0400
@@ -0,0 +1,37 @@ @@ -0,0 +1,37 @@
+/* { dg-do run } */ +/* { dg-do run } */
+ +
@ -1748,7 +1768,7 @@ diff -Nurp a/gcc/testsuite/gcc.dg/struct/sr_address_of_field.c b/gcc/testsuite/g
+/* { dg-final { scan-ipa-dump "struct S has escaped: \"Type escapes via taking the address of field\"" "struct_reorg" } } */ +/* { dg-final { scan-ipa-dump "struct S has escaped: \"Type escapes via taking the address of field\"" "struct_reorg" } } */
diff -Nurp a/gcc/testsuite/gcc.dg/struct/sr_maxmin_expr.c b/gcc/testsuite/gcc.dg/struct/sr_maxmin_expr.c diff -Nurp a/gcc/testsuite/gcc.dg/struct/sr_maxmin_expr.c b/gcc/testsuite/gcc.dg/struct/sr_maxmin_expr.c
--- a/gcc/testsuite/gcc.dg/struct/sr_maxmin_expr.c 1969-12-31 19:00:00.000000000 -0500 --- a/gcc/testsuite/gcc.dg/struct/sr_maxmin_expr.c 1969-12-31 19:00:00.000000000 -0500
+++ b/gcc/testsuite/gcc.dg/struct/sr_maxmin_expr.c 2020-07-18 05:16:25.928000000 -0400 +++ b/gcc/testsuite/gcc.dg/struct/sr_maxmin_expr.c 2020-09-17 02:59:19.308000000 -0400
@@ -0,0 +1,25 @@ @@ -0,0 +1,25 @@
+// { dg-do compile } +// { dg-do compile }
+ +
@ -1777,7 +1797,7 @@ diff -Nurp a/gcc/testsuite/gcc.dg/struct/sr_maxmin_expr.c b/gcc/testsuite/gcc.dg
+/* { dg-final { scan-ipa-dump "No structures to transform." "struct_reorg" } } */ +/* { dg-final { scan-ipa-dump "No structures to transform." "struct_reorg" } } */
diff -Nurp a/gcc/testsuite/gcc.dg/struct/sr_pointer_minus.c b/gcc/testsuite/gcc.dg/struct/sr_pointer_minus.c diff -Nurp a/gcc/testsuite/gcc.dg/struct/sr_pointer_minus.c b/gcc/testsuite/gcc.dg/struct/sr_pointer_minus.c
--- a/gcc/testsuite/gcc.dg/struct/sr_pointer_minus.c 1969-12-31 19:00:00.000000000 -0500 --- a/gcc/testsuite/gcc.dg/struct/sr_pointer_minus.c 1969-12-31 19:00:00.000000000 -0500
+++ b/gcc/testsuite/gcc.dg/struct/sr_pointer_minus.c 2020-07-18 05:16:25.928000000 -0400 +++ b/gcc/testsuite/gcc.dg/struct/sr_pointer_minus.c 2020-09-17 02:59:19.308000000 -0400
@@ -0,0 +1,33 @@ @@ -0,0 +1,33 @@
+// { dg-do compile } +// { dg-do compile }
+ +

View File

@ -0,0 +1,162 @@
This backport contains 2 patchs from gcc main stream tree.
The commit id of these patchs list as following in the order of time.
0001-Tweak-gcc.dg-vect-bb-slp-4-01-.c-PR92366.patch
3771033244b3ee1b53a8a00d734580b16384fdd3
0001-tree-vect-slp.c-vect_analyze_slp_instance-Dump-const.patch
140ee00a961fda084c1b4b3f0e7e489a917858f7
diff -Nurp a/gcc/testsuite/gcc.dg/vect/bb-slp-40.c b/gcc/testsuite/gcc.dg/vect/bb-slp-40.c
--- a/gcc/testsuite/gcc.dg/vect/bb-slp-40.c 2020-09-14 21:24:20.899694710 +0800
+++ b/gcc/testsuite/gcc.dg/vect/bb-slp-40.c 2020-09-15 20:54:05.456027442 +0800
@@ -1,5 +1,5 @@
/* { dg-do compile } */
-/* { dg-options "-O3 -fdump-tree-slp-all" } */
+/* { dg-additional-options "-fvect-cost-model=dynamic" } */
/* { dg-require-effective-target vect_int } */
char g_d[1024], g_s1[1024], g_s2[1024];
@@ -30,5 +30,5 @@ void foo(void)
}
/* See that we vectorize an SLP instance. */
-/* { dg-final { scan-tree-dump-times "Found vectorizable constructor" 1 "slp1" } } */
-/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 1 "slp1" } } */
+/* { dg-final { scan-tree-dump "Analyzing vectorizable constructor" "slp1" } } */
+/* { dg-final { scan-tree-dump "vectorizing stmts using SLP" "slp1" } } */
diff -Nurp a/gcc/testsuite/gcc.dg/vect/bb-slp-41.c b/gcc/testsuite/gcc.dg/vect/bb-slp-41.c
--- a/gcc/testsuite/gcc.dg/vect/bb-slp-41.c 2020-09-14 21:24:20.899694710 +0800
+++ b/gcc/testsuite/gcc.dg/vect/bb-slp-41.c 2020-09-15 20:54:10.424087539 +0800
@@ -1,10 +1,9 @@
-/* { dg-do run } */
-/* { dg-options "-O3 -fdump-tree-slp-all -fno-vect-cost-model" } */
/* { dg-require-effective-target vect_int } */
#define ARR_SIZE 1000
-void foo (int *a, int *b)
+void __attribute__((optimize (0)))
+foo (int *a, int *b)
{
int i;
for (i = 0; i < (ARR_SIZE - 2); ++i)
@@ -56,6 +55,4 @@ int main ()
return 0;
}
-/* See that we vectorize an SLP instance. */
-/* { dg-final { scan-tree-dump-times "Found vectorizable constructor" 12 "slp1" } } */
-/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 4 "slp1" } } */
+/* { dg-final { scan-tree-dump-not "vectorizing stmts using SLP" "slp1" } } */
diff -Nurp a/gcc/testsuite/gcc.dg/vect/bb-slp-42.c b/gcc/testsuite/gcc.dg/vect/bb-slp-42.c
--- a/gcc/testsuite/gcc.dg/vect/bb-slp-42.c 1970-01-01 08:00:00.000000000 +0800
+++ b/gcc/testsuite/gcc.dg/vect/bb-slp-42.c 2020-09-15 20:54:14.724139555 +0800
@@ -0,0 +1,48 @@
+/* { dg-require-effective-target vect_int } */
+/* { dg-require-effective-target vect_perm } */
+
+#include "tree-vect.h"
+
+#define ARR_SIZE 1024
+
+void __attribute__((noipa))
+foo (int a[][ARR_SIZE], int *b)
+{
+ int i;
+ for (i = 0; i < ARR_SIZE; ++i)
+ {
+ a[0][i] += b[0];
+ a[1][i] += b[1];
+ a[2][i] += b[2];
+ a[3][i] += b[3];
+ }
+}
+
+int
+main ()
+{
+ int a[4][ARR_SIZE];
+ int b[4];
+
+ check_vect ();
+
+ for (int i = 0; i < 4; ++i)
+ {
+ b[i] = 20 * i;
+ for (int j = 0; j < ARR_SIZE; ++j)
+ a[i][j] = (i + 1) * ARR_SIZE - j;
+ }
+
+ foo (a, b);
+
+ for (int i = 0; i < 4; ++i)
+ for (int j = 0; j < ARR_SIZE; ++j)
+ if (a[i][j] != (i + 1) * ARR_SIZE - j + 20 * i)
+ __builtin_abort ();
+
+ return 0;
+
+}
+
+/* See that we do not try to vectorize the uniform CTORs. */
+/* { dg-final { scan-tree-dump-not "Analyzing vectorizable constructor" "slp1" } } */
diff -Nurp a/gcc/tree-vect-slp.c b/gcc/tree-vect-slp.c
--- a/gcc/tree-vect-slp.c 2020-09-14 21:24:20.983695752 +0800
+++ b/gcc/tree-vect-slp.c 2020-09-14 16:13:11.077779069 +0800
@@ -2106,6 +2106,10 @@ vect_analyze_slp_instance (vec_info *vin
else
return false;
}
+ if (dump_enabled_p ())
+ dump_printf_loc (MSG_NOTE, vect_location,
+ "Analyzing vectorizable constructor: %G\n",
+ stmt_info->stmt);
}
else
{
@@ -3049,31 +3053,22 @@ vect_slp_check_for_constructors (bb_vec_
gimple_stmt_iterator gsi;
for (gsi = bb_vinfo->region_begin;
- gsi_stmt (gsi) != gsi_stmt (bb_vinfo->region_end); gsi_next (&gsi))
+ gsi_stmt (gsi) != gsi_stmt (bb_vinfo->region_end); gsi_next (&gsi))
{
- gimple *stmt = gsi_stmt (gsi);
-
- if (is_gimple_assign (stmt)
- && gimple_assign_rhs_code (stmt) == CONSTRUCTOR
- && TREE_CODE (gimple_assign_lhs (stmt)) == SSA_NAME
- && TREE_CODE (TREE_TYPE (gimple_assign_lhs (stmt))) == VECTOR_TYPE)
- {
- tree rhs = gimple_assign_rhs1 (stmt);
-
- if (CONSTRUCTOR_NELTS (rhs) == 0)
- continue;
-
- poly_uint64 subparts = TYPE_VECTOR_SUBPARTS (TREE_TYPE (rhs));
+ gassign *stmt = dyn_cast <gassign *> (gsi_stmt (gsi));
+ if (!stmt || gimple_assign_rhs_code (stmt) != CONSTRUCTOR)
+ continue;
- if (maybe_ne (subparts, CONSTRUCTOR_NELTS (rhs)))
- continue;
+ tree rhs = gimple_assign_rhs1 (stmt);
+ if (!VECTOR_TYPE_P (TREE_TYPE (rhs))
+ || maybe_ne (TYPE_VECTOR_SUBPARTS (TREE_TYPE (rhs)),
+ CONSTRUCTOR_NELTS (rhs))
+ || VECTOR_TYPE_P (TREE_TYPE (CONSTRUCTOR_ELT (rhs, 0)->value))
+ || uniform_vector_p (rhs))
+ continue;
- if (dump_enabled_p ())
- dump_printf_loc (MSG_NOTE, vect_location,
- "Found vectorizable constructor: %G\n", stmt);
- stmt_vec_info stmt_info = bb_vinfo->lookup_stmt (stmt);
- BB_VINFO_GROUPED_STORES (bb_vinfo).safe_push (stmt_info);
- }
+ stmt_vec_info stmt_info = bb_vinfo->lookup_stmt (stmt);
+ BB_VINFO_GROUPED_STORES (bb_vinfo).safe_push (stmt_info);
}
}

View File

@ -0,0 +1,69 @@
This backport contains 1 patch from gcc main stream tree. ^M
The commit id of these patchs list as following in the order of time.
0001-Make-ifcvt-clean-up-dead-comparisons.patch
f1f10541903b082d27114db38947fb31f5364bcc
diff -Nurp a/gcc/basic-block.h b/gcc/basic-block.h
--- a/gcc/basic-block.h 2020-09-12 14:42:34.268000000 +0800
+++ b/gcc/basic-block.h 2020-09-12 14:42:48.448000000 +0800
@@ -507,6 +507,8 @@ ei_cond (edge_iterator ei, edge *p)
#define CLEANUP_CFGLAYOUT 32 /* Do cleanup in cfglayout mode. */
#define CLEANUP_CFG_CHANGED 64 /* The caller changed the CFG. */
#define CLEANUP_NO_PARTITIONING 128 /* Do not try to fix partitions. */
+#define CLEANUP_FORCE_FAST_DCE 0x100 /* Force run_fast_dce to be called
+ at least once. */
/* Return true if BB is in a transaction. */
diff -Nurp a/gcc/cfgcleanup.c b/gcc/cfgcleanup.c
--- a/gcc/cfgcleanup.c 2020-09-12 14:42:34.292000000 +0800
+++ b/gcc/cfgcleanup.c 2020-09-12 14:42:48.448000000 +0800
@@ -3197,7 +3197,10 @@ cleanup_cfg (int mode)
&& !delete_trivially_dead_insns (get_insns (), max_reg_num ()))
break;
if ((mode & CLEANUP_CROSSJUMP) && crossjumps_occurred)
- run_fast_dce ();
+ {
+ run_fast_dce ();
+ mode &= ~CLEANUP_FORCE_FAST_DCE;
+ }
}
else
break;
@@ -3206,6 +3209,9 @@ cleanup_cfg (int mode)
if (mode & CLEANUP_CROSSJUMP)
remove_fake_exit_edges ();
+ if (mode & CLEANUP_FORCE_FAST_DCE)
+ run_fast_dce ();
+
/* Don't call delete_dead_jumptables in cfglayout mode, because
that function assumes that jump tables are in the insns stream.
But we also don't _have_ to delete dead jumptables in cfglayout
diff -Nurp a/gcc/ifcvt.c b/gcc/ifcvt.c
--- a/gcc/ifcvt.c 2020-09-12 14:42:34.300000000 +0800
+++ b/gcc/ifcvt.c 2020-09-12 14:42:48.448000000 +0800
@@ -5457,6 +5457,8 @@ if_convert (bool after_combine)
static unsigned int
rest_of_handle_if_conversion (void)
{
+ int flags = 0;
+
if (flag_if_conversion)
{
if (dump_file)
@@ -5466,9 +5468,12 @@ rest_of_handle_if_conversion (void)
}
cleanup_cfg (CLEANUP_EXPENSIVE);
if_convert (false);
+ if (num_updated_if_blocks)
+ /* Get rid of any dead CC-related instructions. */
+ flags |= CLEANUP_FORCE_FAST_DCE;
}
- cleanup_cfg (0);
+ cleanup_cfg (flags);
return 0;
}

View File

@ -1,7 +1,8 @@
%global DATE 20200915 %global DATE 20200921
%global gcc_version 9.3.1 %global gcc_version 9.3.1
%global gcc_major 9.3.1 %global gcc_major 9.3.1
%global gcc_pkgversion "build 300b011"
%global _unpackaged_files_terminate_build 0 %global _unpackaged_files_terminate_build 0
%global _performance_build 1 %global _performance_build 1
@ -13,7 +14,7 @@
%global build_go 0 %global build_go 0
%global build_d 0 %global build_d 0
%global build_check 0 %global build_check 0
%ifarch %{ix86} x86_64 ia64 ppc64le %ifarch %{ix86} x86_64 ia64 ppc64le aarch64
%global build_libquadmath 1 %global build_libquadmath 1
%else %else
%global build_libquadmath 0 %global build_libquadmath 0
@ -59,7 +60,7 @@
Summary: Various compilers (C, C++, Objective-C, ...) Summary: Various compilers (C, C++, Objective-C, ...)
Name: gcc Name: gcc
Version: %{gcc_version} Version: %{gcc_version}
Release: %{DATE}.9 Release: %{DATE}.10
License: GPLv3+ and GPLv3+ with exceptions and GPLv2+ with exceptions and LGPLv2+ and BSD License: GPLv3+ and GPLv3+ with exceptions and GPLv2+ with exceptions and LGPLv2+ and BSD
Source0: gcc-9.3.0.tar.xz Source0: gcc-9.3.0.tar.xz
%global isl_version 0.16.1 %global isl_version 0.16.1
@ -181,6 +182,9 @@ Patch66: fix-ICE-in-verify_target_availability.patch
Patch67: fix-ICE-vect_slp_analyze_node_operations.patch Patch67: fix-ICE-vect_slp_analyze_node_operations.patch
Patch68: fix-ICE-in-extract_constrain_insn.patch Patch68: fix-ICE-in-extract_constrain_insn.patch
Patch69: fix-ICE-during-GIMPLE-pass-dse.patch Patch69: fix-ICE-during-GIMPLE-pass-dse.patch
Patch70: ipa-const-prop-buffer-overflow-bugfix.patch
Patch71: fix-ICE-in-eliminate_stmt.patch
Patch72: fix-make-ifcvt-clean-up-dead-comparisons.patch
%global gcc_target_platform %{_arch}-linux-gnu %global gcc_target_platform %{_arch}-linux-gnu
@ -693,6 +697,9 @@ not stable, so plugins must be rebuilt any time GCC is updated.
%patch67 -p1 %patch67 -p1
%patch68 -p1 %patch68 -p1
%patch69 -p1 %patch69 -p1
%patch70 -p1
%patch71 -p1
%patch72 -p1
%build %build
@ -749,7 +756,7 @@ export extra_ldflags_libobjc="-Wl,-z,relro,-z,now"
export FCFLAGS="$OPT_FLAGS" export FCFLAGS="$OPT_FLAGS"
CC="$CC" CFLAGS="$OPT_FLAGS" \ CC="$CC" CFLAGS="$OPT_FLAGS" \
CXXFLAGS="`echo " $OPT_FLAGS " | sed 's/ -Wall / /g;s/ -fexceptions / /g' \ CXXFLAGS="`echo " $OPT_FLAGS " | sed 's/ -Wall / /g;s/ -fexceptions / /g' \
| sed 's/ -Werror=format-security //'`" \ | sed 's/ -Werror=format-security / /'`" \
LDFLAGS="$OPT_LDFLAGS" \ LDFLAGS="$OPT_LDFLAGS" \
CFLAGS_FOR_TARGET="$OPT_FLAGS" \ CFLAGS_FOR_TARGET="$OPT_FLAGS" \
CXXFLAGS_FOR_TARGET="$OPT_FLAGS" \ CXXFLAGS_FOR_TARGET="$OPT_FLAGS" \
@ -761,6 +768,7 @@ CC="$CC" CFLAGS="$OPT_FLAGS" \
--enable-languages=c,c++,objc,obj-c++,fortran,lto --enable-plugin \ --enable-languages=c,c++,objc,obj-c++,fortran,lto --enable-plugin \
--enable-initfini-array --disable-libgcj --without-isl --without-cloog \ --enable-initfini-array --disable-libgcj --without-isl --without-cloog \
--enable-gnu-indirect-function --build=%{gcc_target_platform} \ --enable-gnu-indirect-function --build=%{gcc_target_platform} \
--with-pkgversion=%{gcc_pkgversion} \
--with-stage1-ldflags="$OPT_LDFLAGS" \ --with-stage1-ldflags="$OPT_LDFLAGS" \
--with-boot-ldflags="$OPT_LDFLAGS" \ --with-boot-ldflags="$OPT_LDFLAGS" \
%ifarch x86_64 %ifarch x86_64
@ -2621,6 +2629,15 @@ end
%doc rpm.doc/changelogs/libcc1/ChangeLog* %doc rpm.doc/changelogs/libcc1/ChangeLog*
%changelog %changelog
* Mon Sep 21 2020 eastb233 <xiezhiheng@huawei.com> - 9.3.1-20200921.10
- complete-struct-reorg.patch: Fix secure coding
- ipa-struct-reorg-bugfix.patch: Likewise
- simplify-removing-subregs.patch: Likewise
- fix-ICE-in-eliminate_stmt.patch: New file
- fix-make-ifcvt-clean-up-dead-comparisons.patch: New file
- ipa-const-prop-buffer-overflow-bugfix.patch: New file
- gcc.spec: Add pkgversion, pack libquadmath library on aarch64
* Thu Sep 15 2020 eastb233 <xiezhiheng@huawei.com> - 9.3.1-20200915.9 * Thu Sep 15 2020 eastb233 <xiezhiheng@huawei.com> - 9.3.1-20200915.9
- avoid-cycling-on-vertain-subreg-reloads.patch: New file - avoid-cycling-on-vertain-subreg-reloads.patch: New file
- fix-ICE-in-verify_target_availability.patch: New file - fix-ICE-in-verify_target_availability.patch: New file

View File

@ -0,0 +1,119 @@
This patch is to solve issue409, which merge following 3 commits with some style fix
commit 9505acd8501e6c79bc4fa9ed9f1ee174462601d1
Author: Richard Biener <rguenther@suse.de>
Date: Wed Jul 17 09:35:04 2019 +0000
re PR tree-optimization/91180 (wrong code at -O and above with __builtin_memset())
2019-07-17 Richard Biener <rguenther@suse.de>
PR tree-optimization/91180
* tree-ssa-sccvn.c (vn_reference_lookup_3): Fix offset
computation for memset partial defs.
* gcc.dg/torture/pr91180.c: New testcase.
From-SVN: r273548
commit 6b68f00d4c2b375dad66bd6e72c01c309b4085c5
Author: Richard Biener <rguenther@suse.de>
Date: Fri Jul 19 16:19:39 2019 +0000
re PR tree-optimization/91211 (wrong code with __builtin_memset() and __builtin_memcpy() at -O1 and above)
2019-07-19 Richard Biener <rguenther@suse.de>
PR tree-optimization/91211
* tree-ssa-sccvn.c (vn_walk_cb_data::push_partial_def): Fix
memset encoding size.
* gcc.dg/torture/pr91211.c: New testcase.
From-SVN: r273605
commit 599331c858294dec6ac94400e63d275c4836607f
Author: Richard Biener <rguenther@suse.de>
Date: Thu Jul 25 06:57:46 2019 +0000
re PR tree-optimization/91236 (ICE in walk_non_aliased_vuses at gcc/tree-ssa-alias.c:3395 on aarch64)
2019-07-25 Richard Biener <rguenther@suse.de>
PR tree-optimization/91236
* tree-ssa-sccvn.c (vn_walk_cb_data::push_partial_def): Fix
size of CONSTRUCTOR write. Fix buffer size we pass to
native_encode_expr.
From-SVN: r273787
diff -Nurp a/gcc/testsuite/gcc.dg/torture/pr91180.c b/gcc/testsuite/gcc.dg/torture/pr91180.c
--- a/gcc/testsuite/gcc.dg/torture/pr91180.c 1970-01-01 08:00:00.000000000 +0800
+++ b/gcc/testsuite/gcc.dg/torture/pr91180.c 2020-09-15 20:52:58.796000000 +0800
@@ -0,0 +1,13 @@
+/* { dg-do run } */
+
+int
+main ()
+{
+#if __SIZEOF_INT__ == 4
+ unsigned x = 0xffffffff;
+ __builtin_memset (1 + (char *) &x, 0, 2);
+ if (x != 0xff0000ff)
+ __builtin_abort ();
+#endif
+ return 0;
+}
diff -Nurp a/gcc/testsuite/gcc.dg/torture/pr91211.c b/gcc/testsuite/gcc.dg/torture/pr91211.c
--- a/gcc/testsuite/gcc.dg/torture/pr91211.c 1970-01-01 08:00:00.000000000 +0800
+++ b/gcc/testsuite/gcc.dg/torture/pr91211.c 2020-09-15 20:52:43.932000000 +0800
@@ -0,0 +1,19 @@
+/* { dg-do run } */
+
+typedef __UINT32_TYPE__ u32;
+
+int
+main (void)
+{
+ u32 b = 0x027C5902;
+ u32 a = 0;
+ __builtin_memset (1 + (char *) &b, 0, 2);
+ __builtin_memcpy (&a, 2 + (char *) &b, 2);
+#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
+ if (a != 0x00000200)
+#else
+ if (a != 0x00020000)
+#endif
+ __builtin_abort();
+ return 0;
+}
diff -Nurp a/gcc/tree-ssa-sccvn.c b/gcc/tree-ssa-sccvn.c
--- a/gcc/tree-ssa-sccvn.c 2020-09-14 16:44:05.476000000 +0800
+++ b/gcc/tree-ssa-sccvn.c 2020-09-16 09:29:22.520000000 +0800
@@ -1840,12 +1840,15 @@ vn_walk_cb_data::push_partial_def (const
if (TREE_CODE (pd.rhs) == CONSTRUCTOR)
/* Empty CONSTRUCTOR. */
memset (buffer + MAX (0, pd.offset),
- 0, MIN ((HOST_WIDE_INT)sizeof (buffer), pd.size));
+ 0, MIN ((HOST_WIDE_INT)sizeof (buffer)
+ - MAX (0, pd.offset),
+ pd.size + MIN (0, pd.offset)));
else
{
len = native_encode_expr (pd.rhs,
buffer + MAX (0, pd.offset),
- sizeof (buffer - MAX (0, pd.offset)),
+ sizeof (buffer)
+ - MAX (0, pd.offset),
MAX (0, -pd.offset));
if (len <= 0
|| len < (pd.size - MAX (0, -pd.offset)))
@@ -2461,7 +2464,7 @@ vn_reference_lookup_3 (ao_ref *ref, tree
{
pd_data pd;
pd.rhs = build_constructor (NULL_TREE, NULL);
- pd.offset = offset2i - offseti;
+ pd.offset = (offset2i - offseti) / BITS_PER_UNIT;
pd.size = leni;
return data->push_partial_def (pd, vuse, maxsizei);
}

View File

@ -1,6 +1,6 @@
diff -Nurp a/gcc/fold-const.c b/gcc/fold-const.c diff -Nurp a/gcc/fold-const.c b/gcc/fold-const.c
--- a/gcc/fold-const.c 2020-06-16 22:27:46.116000000 -0400 --- a/gcc/fold-const.c 2020-09-17 02:26:36.900000000 -0400
+++ b/gcc/fold-const.c 2020-06-16 22:27:58.412000000 -0400 +++ b/gcc/fold-const.c 2020-09-17 02:27:57.368000000 -0400
@@ -7165,15 +7165,9 @@ fold_plusminus_mult_expr (location_t loc @@ -7165,15 +7165,9 @@ fold_plusminus_mult_expr (location_t loc
increased the number of multiplications necessary. */ increased the number of multiplications necessary. */
&& TREE_CODE (arg10) != INTEGER_CST) && TREE_CODE (arg10) != INTEGER_CST)
@ -20,9 +20,9 @@ diff -Nurp a/gcc/fold-const.c b/gcc/fold-const.c
same = maybe_same; same = maybe_same;
if (swap) if (swap)
diff -Nurp a/gcc/ipa-struct-reorg/ipa-struct-reorg.c b/gcc/ipa-struct-reorg/ipa-struct-reorg.c diff -Nurp a/gcc/ipa-struct-reorg/ipa-struct-reorg.c b/gcc/ipa-struct-reorg/ipa-struct-reorg.c
--- a/gcc/ipa-struct-reorg/ipa-struct-reorg.c 2020-06-16 22:27:46.116000000 -0400 --- a/gcc/ipa-struct-reorg/ipa-struct-reorg.c 2020-09-17 02:26:36.900000000 -0400
+++ b/gcc/ipa-struct-reorg/ipa-struct-reorg.c 2020-06-16 22:33:18.968000000 -0400 +++ b/gcc/ipa-struct-reorg/ipa-struct-reorg.c 2020-09-17 02:34:04.040000000 -0400
@@ -112,6 +112,23 @@ is_va_list_type (tree type) @@ -112,6 +112,29 @@ is_va_list_type (tree type)
return TYPE_MAIN_VARIANT (type) == TYPE_MAIN_VARIANT (va_list_type_node); return TYPE_MAIN_VARIANT (type) == TYPE_MAIN_VARIANT (va_list_type_node);
} }
@ -30,6 +30,12 @@ diff -Nurp a/gcc/ipa-struct-reorg/ipa-struct-reorg.c b/gcc/ipa-struct-reorg/ipa-
+get_type_name (tree type) +get_type_name (tree type)
+{ +{
+ const char *tname = NULL; + const char *tname = NULL;
+
+ if (type == NULL)
+ {
+ return NULL;
+ }
+
+ if (TYPE_NAME (type) != NULL) + if (TYPE_NAME (type) != NULL)
+ { + {
+ if (TREE_CODE (TYPE_NAME (type)) == IDENTIFIER_NODE) + if (TREE_CODE (TYPE_NAME (type)) == IDENTIFIER_NODE)
@ -46,12 +52,12 @@ diff -Nurp a/gcc/ipa-struct-reorg/ipa-struct-reorg.c b/gcc/ipa-struct-reorg/ipa-
/* Return the inner most type for arrays and pointers of TYPE. */ /* Return the inner most type for arrays and pointers of TYPE. */
@@ -463,10 +480,10 @@ srtype::analyze (void) @@ -463,10 +486,10 @@ srtype::analyze (void)
if (fields.length () == 2) if (fields.length () == 2)
fields[1]->clusternum = 1; fields[1]->clusternum = 1;
- /* REMOVEME: FIXME: this is here for testing more testcases. */ - /* REMOVEME: FIXME: this is here for testing more testcases. */
+ /* FIXME: Currently Return. */ + /* Otherwise we do nothing. */
if (fields.length () >= 3) if (fields.length () >= 3)
{ {
- fields[1]->clusternum = 1; - fields[1]->clusternum = 1;
@ -59,7 +65,7 @@ diff -Nurp a/gcc/ipa-struct-reorg/ipa-struct-reorg.c b/gcc/ipa-struct-reorg/ipa-
} }
} }
@@ -875,6 +892,7 @@ private: @@ -875,6 +898,7 @@ private:
void analyze_types (void); void analyze_types (void);
void clear_visited (void); void clear_visited (void);
bool create_new_types (void); bool create_new_types (void);
@ -67,7 +73,7 @@ diff -Nurp a/gcc/ipa-struct-reorg/ipa-struct-reorg.c b/gcc/ipa-struct-reorg/ipa-
void create_new_decls (void); void create_new_decls (void);
srdecl *find_decl (tree); srdecl *find_decl (tree);
void create_new_functions (void); void create_new_functions (void);
@@ -1096,6 +1114,11 @@ ipa_struct_reorg::record_type (tree type @@ -1096,6 +1120,11 @@ ipa_struct_reorg::record_type (tree type
{ {
tree t = TREE_TYPE (field); tree t = TREE_TYPE (field);
process_union (t); process_union (t);
@ -79,7 +85,7 @@ diff -Nurp a/gcc/ipa-struct-reorg/ipa-struct-reorg.c b/gcc/ipa-struct-reorg/ipa-
if (isvolatile_type (t)) if (isvolatile_type (t))
type1->mark_escape (escape_volatile, NULL); type1->mark_escape (escape_volatile, NULL);
escape_type e = escape_type_volatile_array_or_ptrptr (t); escape_type e = escape_type_volatile_array_or_ptrptr (t);
@@ -2818,6 +2841,49 @@ ipa_struct_reorg::analyze_types (void) @@ -2818,6 +2847,49 @@ ipa_struct_reorg::analyze_types (void)
} }
} }
@ -129,7 +135,7 @@ diff -Nurp a/gcc/ipa-struct-reorg/ipa-struct-reorg.c b/gcc/ipa-struct-reorg/ipa-
/* Create all new types we want to create. */ /* Create all new types we want to create. */
bool bool
@@ -3669,7 +3735,7 @@ ipa_struct_reorg::rewrite_functions (voi @@ -3669,7 +3741,7 @@ ipa_struct_reorg::rewrite_functions (voi
{ {
unsigned retval = 0; unsigned retval = 0;
@ -139,7 +145,7 @@ diff -Nurp a/gcc/ipa-struct-reorg/ipa-struct-reorg.c b/gcc/ipa-struct-reorg/ipa-
then don't rewrite any accesses. */ then don't rewrite any accesses. */
if (!create_new_types ()) if (!create_new_types ())
diff -Nurp a/gcc/testsuite/gcc.c-torture/compile/20170404-1.c b/gcc/testsuite/gcc.c-torture/compile/20170404-1.c diff -Nurp a/gcc/testsuite/gcc.c-torture/compile/20170404-1.c b/gcc/testsuite/gcc.c-torture/compile/20170404-1.c
--- a/gcc/testsuite/gcc.c-torture/compile/20170404-1.c 2020-06-16 22:27:46.120000000 -0400 --- a/gcc/testsuite/gcc.c-torture/compile/20170404-1.c 2020-09-17 02:26:36.904000000 -0400
+++ b/gcc/testsuite/gcc.c-torture/compile/20170404-1.c 1969-12-31 19:00:00.000000000 -0500 +++ b/gcc/testsuite/gcc.c-torture/compile/20170404-1.c 1969-12-31 19:00:00.000000000 -0500
@@ -1,19 +0,0 @@ @@ -1,19 +0,0 @@
-struct a -struct a
@ -162,15 +168,15 @@ diff -Nurp a/gcc/testsuite/gcc.c-torture/compile/20170404-1.c b/gcc/testsuite/gc
- return b->t; - return b->t;
-} -}
diff -Nurp a/gcc/testsuite/gcc.c-torture/compile/nested-3.c b/gcc/testsuite/gcc.c-torture/compile/nested-3.c diff -Nurp a/gcc/testsuite/gcc.c-torture/compile/nested-3.c b/gcc/testsuite/gcc.c-torture/compile/nested-3.c
--- a/gcc/testsuite/gcc.c-torture/compile/nested-3.c 2020-06-16 22:27:46.120000000 -0400 --- a/gcc/testsuite/gcc.c-torture/compile/nested-3.c 2020-09-17 02:26:36.904000000 -0400
+++ b/gcc/testsuite/gcc.c-torture/compile/nested-3.c 2020-06-16 22:27:58.416000000 -0400 +++ b/gcc/testsuite/gcc.c-torture/compile/nested-3.c 2020-09-17 02:27:57.372000000 -0400
@@ -1,4 +1,3 @@ @@ -1,4 +1,3 @@
-/* This used to crash Struct reorg. */ -/* This used to crash Struct reorg. */
struct a struct a
{ {
int t; int t;
diff -Nurp a/gcc/testsuite/gcc.c-torture/compile/struct-reorg-1.c b/gcc/testsuite/gcc.c-torture/compile/struct-reorg-1.c diff -Nurp a/gcc/testsuite/gcc.c-torture/compile/struct-reorg-1.c b/gcc/testsuite/gcc.c-torture/compile/struct-reorg-1.c
--- a/gcc/testsuite/gcc.c-torture/compile/struct-reorg-1.c 2020-06-16 22:27:46.120000000 -0400 --- a/gcc/testsuite/gcc.c-torture/compile/struct-reorg-1.c 2020-09-17 02:26:36.904000000 -0400
+++ b/gcc/testsuite/gcc.c-torture/compile/struct-reorg-1.c 1969-12-31 19:00:00.000000000 -0500 +++ b/gcc/testsuite/gcc.c-torture/compile/struct-reorg-1.c 1969-12-31 19:00:00.000000000 -0500
@@ -1,18 +0,0 @@ @@ -1,18 +0,0 @@
-#include <stdlib.h> -#include <stdlib.h>
@ -192,7 +198,7 @@ diff -Nurp a/gcc/testsuite/gcc.c-torture/compile/struct-reorg-1.c b/gcc/testsuit
- * sizeof (compile_stack_elt_t)); - * sizeof (compile_stack_elt_t));
-} -}
diff -Nurp a/gcc/testsuite/gcc.dg/pr33136-4.c b/gcc/testsuite/gcc.dg/pr33136-4.c diff -Nurp a/gcc/testsuite/gcc.dg/pr33136-4.c b/gcc/testsuite/gcc.dg/pr33136-4.c
--- a/gcc/testsuite/gcc.dg/pr33136-4.c 2020-06-16 22:27:46.120000000 -0400 --- a/gcc/testsuite/gcc.dg/pr33136-4.c 2020-09-17 02:26:36.904000000 -0400
+++ b/gcc/testsuite/gcc.dg/pr33136-4.c 1969-12-31 19:00:00.000000000 -0500 +++ b/gcc/testsuite/gcc.dg/pr33136-4.c 1969-12-31 19:00:00.000000000 -0500
@@ -1,59 +0,0 @@ @@ -1,59 +0,0 @@
-/* PR tree-optimization/33136 */ -/* PR tree-optimization/33136 */
@ -256,7 +262,7 @@ diff -Nurp a/gcc/testsuite/gcc.dg/pr33136-4.c b/gcc/testsuite/gcc.dg/pr33136-4.c
-} -}
diff -Nurp a/gcc/testsuite/gcc.dg/struct/struct_reorg-1.c b/gcc/testsuite/gcc.dg/struct/struct_reorg-1.c diff -Nurp a/gcc/testsuite/gcc.dg/struct/struct_reorg-1.c b/gcc/testsuite/gcc.dg/struct/struct_reorg-1.c
--- a/gcc/testsuite/gcc.dg/struct/struct_reorg-1.c 1969-12-31 19:00:00.000000000 -0500 --- a/gcc/testsuite/gcc.dg/struct/struct_reorg-1.c 1969-12-31 19:00:00.000000000 -0500
+++ b/gcc/testsuite/gcc.dg/struct/struct_reorg-1.c 2020-06-16 22:27:58.436000000 -0400 +++ b/gcc/testsuite/gcc.dg/struct/struct_reorg-1.c 2020-09-17 02:27:57.372000000 -0400
@@ -0,0 +1,24 @@ @@ -0,0 +1,24 @@
+// { dg-do compile } +// { dg-do compile }
+// { dg-options "-O3 -flto-partition=one -fipa-struct-reorg -fdump-ipa-all" } +// { dg-options "-O3 -flto-partition=one -fipa-struct-reorg -fdump-ipa-all" }
@ -284,7 +290,7 @@ diff -Nurp a/gcc/testsuite/gcc.dg/struct/struct_reorg-1.c b/gcc/testsuite/gcc.dg
+/* { dg-final { scan-ipa-dump "No structures to transform." "struct_reorg" } } */ +/* { dg-final { scan-ipa-dump "No structures to transform." "struct_reorg" } } */
diff -Nurp a/gcc/testsuite/gcc.dg/struct/struct_reorg-2.c b/gcc/testsuite/gcc.dg/struct/struct_reorg-2.c diff -Nurp a/gcc/testsuite/gcc.dg/struct/struct_reorg-2.c b/gcc/testsuite/gcc.dg/struct/struct_reorg-2.c
--- a/gcc/testsuite/gcc.dg/struct/struct_reorg-2.c 1969-12-31 19:00:00.000000000 -0500 --- a/gcc/testsuite/gcc.dg/struct/struct_reorg-2.c 1969-12-31 19:00:00.000000000 -0500
+++ b/gcc/testsuite/gcc.dg/struct/struct_reorg-2.c 2020-06-16 22:27:58.440000000 -0400 +++ b/gcc/testsuite/gcc.dg/struct/struct_reorg-2.c 2020-09-17 02:27:57.372000000 -0400
@@ -0,0 +1,29 @@ @@ -0,0 +1,29 @@
+// { dg-do run } +// { dg-do run }
+ +
@ -317,7 +323,7 @@ diff -Nurp a/gcc/testsuite/gcc.dg/struct/struct_reorg-2.c b/gcc/testsuite/gcc.dg
+/* { dg-final { scan-ipa-dump "Number of structures to transform is 2" "struct_reorg" } } */ +/* { dg-final { scan-ipa-dump "Number of structures to transform is 2" "struct_reorg" } } */
diff -Nurp a/gcc/testsuite/gcc.dg/struct/struct_reorg-3.c b/gcc/testsuite/gcc.dg/struct/struct_reorg-3.c diff -Nurp a/gcc/testsuite/gcc.dg/struct/struct_reorg-3.c b/gcc/testsuite/gcc.dg/struct/struct_reorg-3.c
--- a/gcc/testsuite/gcc.dg/struct/struct_reorg-3.c 1969-12-31 19:00:00.000000000 -0500 --- a/gcc/testsuite/gcc.dg/struct/struct_reorg-3.c 1969-12-31 19:00:00.000000000 -0500
+++ b/gcc/testsuite/gcc.dg/struct/struct_reorg-3.c 2020-06-16 22:27:58.440000000 -0400 +++ b/gcc/testsuite/gcc.dg/struct/struct_reorg-3.c 2020-09-17 02:27:57.372000000 -0400
@@ -0,0 +1,23 @@ @@ -0,0 +1,23 @@
+// { dg-do compile } +// { dg-do compile }
+// { dg-options "-O3 -flto-partition=one -fipa-struct-reorg -fdump-ipa-all" } +// { dg-options "-O3 -flto-partition=one -fipa-struct-reorg -fdump-ipa-all" }
@ -344,7 +350,7 @@ diff -Nurp a/gcc/testsuite/gcc.dg/struct/struct_reorg-3.c b/gcc/testsuite/gcc.dg
+/* { dg-final { scan-ipa-dump "Number of structures to transform is 1" "struct_reorg" } } */ +/* { dg-final { scan-ipa-dump "Number of structures to transform is 1" "struct_reorg" } } */
diff -Nurp a/gcc/testsuite/gcc.dg/struct/struct_reorg-4.c b/gcc/testsuite/gcc.dg/struct/struct_reorg-4.c diff -Nurp a/gcc/testsuite/gcc.dg/struct/struct_reorg-4.c b/gcc/testsuite/gcc.dg/struct/struct_reorg-4.c
--- a/gcc/testsuite/gcc.dg/struct/struct_reorg-4.c 1969-12-31 19:00:00.000000000 -0500 --- a/gcc/testsuite/gcc.dg/struct/struct_reorg-4.c 1969-12-31 19:00:00.000000000 -0500
+++ b/gcc/testsuite/gcc.dg/struct/struct_reorg-4.c 2020-06-16 22:27:58.440000000 -0400 +++ b/gcc/testsuite/gcc.dg/struct/struct_reorg-4.c 2020-09-17 02:27:57.372000000 -0400
@@ -0,0 +1,59 @@ @@ -0,0 +1,59 @@
+/* { dg-do run } */ +/* { dg-do run } */
+ +
@ -406,8 +412,8 @@ diff -Nurp a/gcc/testsuite/gcc.dg/struct/struct_reorg-4.c b/gcc/testsuite/gcc.dg
+ +
+/* { dg-final { scan-ipa-dump "No structures to transform." "struct_reorg" } } */ +/* { dg-final { scan-ipa-dump "No structures to transform." "struct_reorg" } } */
diff -Nurp a/gcc/testsuite/gcc.dg/struct/struct-reorg.exp b/gcc/testsuite/gcc.dg/struct/struct-reorg.exp diff -Nurp a/gcc/testsuite/gcc.dg/struct/struct-reorg.exp b/gcc/testsuite/gcc.dg/struct/struct-reorg.exp
--- a/gcc/testsuite/gcc.dg/struct/struct-reorg.exp 2020-06-16 22:27:46.120000000 -0400 --- a/gcc/testsuite/gcc.dg/struct/struct-reorg.exp 2020-09-17 02:26:36.904000000 -0400
+++ b/gcc/testsuite/gcc.dg/struct/struct-reorg.exp 2020-06-16 22:27:58.440000000 -0400 +++ b/gcc/testsuite/gcc.dg/struct/struct-reorg.exp 2020-09-17 02:27:57.372000000 -0400
@@ -1,5 +1,4 @@ @@ -1,5 +1,4 @@
-# Copyright (C) 2007, 2008, 2009, 2010 -# Copyright (C) 2007, 2008, 2009, 2010
-# Free Software Foundation, Inc. -# Free Software Foundation, Inc.
@ -500,8 +506,8 @@ diff -Nurp a/gcc/testsuite/gcc.dg/struct/struct-reorg.exp b/gcc/testsuite/gcc.dg
-} -}
+dg-finish +dg-finish
diff -Nurp a/gcc/testsuite/gcc.dg/struct/wo_prof_escape_str_init.c b/gcc/testsuite/gcc.dg/struct/wo_prof_escape_str_init.c diff -Nurp a/gcc/testsuite/gcc.dg/struct/wo_prof_escape_str_init.c b/gcc/testsuite/gcc.dg/struct/wo_prof_escape_str_init.c
--- a/gcc/testsuite/gcc.dg/struct/wo_prof_escape_str_init.c 2020-06-16 22:27:46.120000000 -0400 --- a/gcc/testsuite/gcc.dg/struct/wo_prof_escape_str_init.c 2020-09-17 02:26:36.904000000 -0400
+++ b/gcc/testsuite/gcc.dg/struct/wo_prof_escape_str_init.c 2020-06-16 22:27:58.440000000 -0400 +++ b/gcc/testsuite/gcc.dg/struct/wo_prof_escape_str_init.c 2020-09-17 02:27:57.372000000 -0400
@@ -28,4 +28,4 @@ main () @@ -28,4 +28,4 @@ main ()
} }
@ -509,8 +515,8 @@ diff -Nurp a/gcc/testsuite/gcc.dg/struct/wo_prof_escape_str_init.c b/gcc/testsui
-/* { dg-final { scan-ipa-dump "has escaped...Type is used in an array" "struct_reorg" } } */ -/* { dg-final { scan-ipa-dump "has escaped...Type is used in an array" "struct_reorg" } } */
+/* { dg-final { scan-ipa-dump "No structures to transform." "struct_reorg" } } */ +/* { dg-final { scan-ipa-dump "No structures to transform." "struct_reorg" } } */
diff -Nurp a/gcc/testsuite/gcc.dg/struct/wo_prof_mult_field_peeling.c b/gcc/testsuite/gcc.dg/struct/wo_prof_mult_field_peeling.c diff -Nurp a/gcc/testsuite/gcc.dg/struct/wo_prof_mult_field_peeling.c b/gcc/testsuite/gcc.dg/struct/wo_prof_mult_field_peeling.c
--- a/gcc/testsuite/gcc.dg/struct/wo_prof_mult_field_peeling.c 2020-06-16 22:27:46.120000000 -0400 --- a/gcc/testsuite/gcc.dg/struct/wo_prof_mult_field_peeling.c 2020-09-17 02:26:36.904000000 -0400
+++ b/gcc/testsuite/gcc.dg/struct/wo_prof_mult_field_peeling.c 2020-06-16 22:27:58.440000000 -0400 +++ b/gcc/testsuite/gcc.dg/struct/wo_prof_mult_field_peeling.c 2020-09-17 02:27:57.372000000 -0400
@@ -38,5 +38,5 @@ main () @@ -38,5 +38,5 @@ main ()
} }
@ -520,8 +526,8 @@ diff -Nurp a/gcc/testsuite/gcc.dg/struct/wo_prof_mult_field_peeling.c b/gcc/test
+/* Two more fields structure is not splitted. */ +/* Two more fields structure is not splitted. */
+/* { dg-final { scan-ipa-dump "No structures to transform." "struct_reorg" } } */ +/* { dg-final { scan-ipa-dump "No structures to transform." "struct_reorg" } } */
diff -Nurp a/gcc/testsuite/gcc.dg/struct/w_prof_global_array.c b/gcc/testsuite/gcc.dg/struct/w_prof_global_array.c diff -Nurp a/gcc/testsuite/gcc.dg/struct/w_prof_global_array.c b/gcc/testsuite/gcc.dg/struct/w_prof_global_array.c
--- a/gcc/testsuite/gcc.dg/struct/w_prof_global_array.c 2020-06-16 22:27:46.120000000 -0400 --- a/gcc/testsuite/gcc.dg/struct/w_prof_global_array.c 2020-09-17 02:26:36.904000000 -0400
+++ b/gcc/testsuite/gcc.dg/struct/w_prof_global_array.c 2020-06-16 22:27:58.440000000 -0400 +++ b/gcc/testsuite/gcc.dg/struct/w_prof_global_array.c 2020-09-17 02:27:57.372000000 -0400
@@ -26,4 +26,4 @@ main () @@ -26,4 +26,4 @@ main ()
} }
@ -529,8 +535,8 @@ diff -Nurp a/gcc/testsuite/gcc.dg/struct/w_prof_global_array.c b/gcc/testsuite/g
-/* { dg-final-use { scan-ipa-dump "Number of structures to transform is 1" "struct_reorg" { xfail *-*-* } } } */ -/* { dg-final-use { scan-ipa-dump "Number of structures to transform is 1" "struct_reorg" { xfail *-*-* } } } */
+/* { dg-final { scan-ipa-dump "Number of structures to transform is 1" "struct_reorg" { xfail *-*-* } } } */ +/* { dg-final { scan-ipa-dump "Number of structures to transform is 1" "struct_reorg" { xfail *-*-* } } } */
diff -Nurp a/gcc/testsuite/gcc.dg/struct/w_prof_global_var.c b/gcc/testsuite/gcc.dg/struct/w_prof_global_var.c diff -Nurp a/gcc/testsuite/gcc.dg/struct/w_prof_global_var.c b/gcc/testsuite/gcc.dg/struct/w_prof_global_var.c
--- a/gcc/testsuite/gcc.dg/struct/w_prof_global_var.c 2020-06-16 22:27:46.120000000 -0400 --- a/gcc/testsuite/gcc.dg/struct/w_prof_global_var.c 2020-09-17 02:26:36.908000000 -0400
+++ b/gcc/testsuite/gcc.dg/struct/w_prof_global_var.c 2020-06-16 22:27:58.440000000 -0400 +++ b/gcc/testsuite/gcc.dg/struct/w_prof_global_var.c 2020-09-17 02:27:57.372000000 -0400
@@ -39,4 +39,4 @@ main () @@ -39,4 +39,4 @@ main ()
} }
@ -538,8 +544,8 @@ diff -Nurp a/gcc/testsuite/gcc.dg/struct/w_prof_global_var.c b/gcc/testsuite/gcc
-/* { dg-final-use { scan-ipa-dump "Number of structures to transform is 1" "struct_reorg" } } */ -/* { dg-final-use { scan-ipa-dump "Number of structures to transform is 1" "struct_reorg" } } */
+/* { dg-final { scan-ipa-dump "Number of structures to transform is 1" "struct_reorg" } } */ +/* { dg-final { scan-ipa-dump "Number of structures to transform is 1" "struct_reorg" } } */
diff -Nurp a/gcc/testsuite/gcc.dg/struct/w_prof_local_array.c b/gcc/testsuite/gcc.dg/struct/w_prof_local_array.c diff -Nurp a/gcc/testsuite/gcc.dg/struct/w_prof_local_array.c b/gcc/testsuite/gcc.dg/struct/w_prof_local_array.c
--- a/gcc/testsuite/gcc.dg/struct/w_prof_local_array.c 2020-06-16 22:27:46.124000000 -0400 --- a/gcc/testsuite/gcc.dg/struct/w_prof_local_array.c 2020-09-17 02:26:36.908000000 -0400
+++ b/gcc/testsuite/gcc.dg/struct/w_prof_local_array.c 2020-06-16 22:27:58.472000000 -0400 +++ b/gcc/testsuite/gcc.dg/struct/w_prof_local_array.c 2020-09-17 02:27:57.372000000 -0400
@@ -34,4 +34,4 @@ main () @@ -34,4 +34,4 @@ main ()
} }
@ -547,8 +553,8 @@ diff -Nurp a/gcc/testsuite/gcc.dg/struct/w_prof_local_array.c b/gcc/testsuite/gc
-/* { dg-final-use { scan-ipa-dump "Number of structures to transform is 1" "struct_reorg" { xfail *-*-* } } } */ -/* { dg-final-use { scan-ipa-dump "Number of structures to transform is 1" "struct_reorg" { xfail *-*-* } } } */
+/* { dg-final { scan-ipa-dump "Number of structures to transform is 1" "struct_reorg" { xfail *-*-* } } } */ +/* { dg-final { scan-ipa-dump "Number of structures to transform is 1" "struct_reorg" { xfail *-*-* } } } */
diff -Nurp a/gcc/testsuite/gcc.dg/struct/w_prof_local_var.c b/gcc/testsuite/gcc.dg/struct/w_prof_local_var.c diff -Nurp a/gcc/testsuite/gcc.dg/struct/w_prof_local_var.c b/gcc/testsuite/gcc.dg/struct/w_prof_local_var.c
--- a/gcc/testsuite/gcc.dg/struct/w_prof_local_var.c 2020-06-16 22:27:46.124000000 -0400 --- a/gcc/testsuite/gcc.dg/struct/w_prof_local_var.c 2020-09-17 02:26:36.908000000 -0400
+++ b/gcc/testsuite/gcc.dg/struct/w_prof_local_var.c 2020-06-16 22:27:58.472000000 -0400 +++ b/gcc/testsuite/gcc.dg/struct/w_prof_local_var.c 2020-09-17 02:27:57.372000000 -0400
@@ -37,4 +37,4 @@ main () @@ -37,4 +37,4 @@ main ()
} }
@ -556,8 +562,8 @@ diff -Nurp a/gcc/testsuite/gcc.dg/struct/w_prof_local_var.c b/gcc/testsuite/gcc.
-/* { dg-final-use { scan-ipa-dump "Number of structures to transform is 1" "struct_reorg" } } */ -/* { dg-final-use { scan-ipa-dump "Number of structures to transform is 1" "struct_reorg" } } */
+/* { dg-final { scan-ipa-dump "Number of structures to transform is 1" "struct_reorg" } } */ +/* { dg-final { scan-ipa-dump "Number of structures to transform is 1" "struct_reorg" } } */
diff -Nurp a/gcc/testsuite/gcc.dg/struct/w_prof_single_str_global.c b/gcc/testsuite/gcc.dg/struct/w_prof_single_str_global.c diff -Nurp a/gcc/testsuite/gcc.dg/struct/w_prof_single_str_global.c b/gcc/testsuite/gcc.dg/struct/w_prof_single_str_global.c
--- a/gcc/testsuite/gcc.dg/struct/w_prof_single_str_global.c 2020-06-16 22:27:46.124000000 -0400 --- a/gcc/testsuite/gcc.dg/struct/w_prof_single_str_global.c 2020-09-17 02:26:36.908000000 -0400
+++ b/gcc/testsuite/gcc.dg/struct/w_prof_single_str_global.c 2020-06-16 22:27:58.472000000 -0400 +++ b/gcc/testsuite/gcc.dg/struct/w_prof_single_str_global.c 2020-09-17 02:27:57.372000000 -0400
@@ -28,4 +28,4 @@ main () @@ -28,4 +28,4 @@ main ()
} }
@ -565,8 +571,8 @@ diff -Nurp a/gcc/testsuite/gcc.dg/struct/w_prof_single_str_global.c b/gcc/testsu
-/* { dg-final-use { scan-ipa-dump "Number of structures to transform is 1" "struct_reorg" } } */ -/* { dg-final-use { scan-ipa-dump "Number of structures to transform is 1" "struct_reorg" } } */
+/* { dg-final { scan-ipa-dump "Number of structures to transform is 1" "struct_reorg" } } */ +/* { dg-final { scan-ipa-dump "Number of structures to transform is 1" "struct_reorg" } } */
diff -Nurp a/gcc/testsuite/gcc.dg/struct/w_prof_two_strs.c b/gcc/testsuite/gcc.dg/struct/w_prof_two_strs.c diff -Nurp a/gcc/testsuite/gcc.dg/struct/w_prof_two_strs.c b/gcc/testsuite/gcc.dg/struct/w_prof_two_strs.c
--- a/gcc/testsuite/gcc.dg/struct/w_prof_two_strs.c 2020-06-16 22:27:46.124000000 -0400 --- a/gcc/testsuite/gcc.dg/struct/w_prof_two_strs.c 2020-09-17 02:26:36.908000000 -0400
+++ b/gcc/testsuite/gcc.dg/struct/w_prof_two_strs.c 2020-06-16 22:27:58.472000000 -0400 +++ b/gcc/testsuite/gcc.dg/struct/w_prof_two_strs.c 2020-09-17 02:27:57.372000000 -0400
@@ -61,4 +61,4 @@ main () @@ -61,4 +61,4 @@ main ()
} }
@ -574,8 +580,8 @@ diff -Nurp a/gcc/testsuite/gcc.dg/struct/w_prof_two_strs.c b/gcc/testsuite/gcc.d
-/* { dg-final-use { scan-ipa-dump "Number of structures to transform is 2" "struct_reorg" } } */ -/* { dg-final-use { scan-ipa-dump "Number of structures to transform is 2" "struct_reorg" } } */
+/* { dg-final { scan-ipa-dump "Number of structures to transform is 2" "struct_reorg" } } */ +/* { dg-final { scan-ipa-dump "Number of structures to transform is 2" "struct_reorg" } } */
diff -Nurp a/gcc/testsuite/gcc.dg/struct/w_ratio_cold_str.c b/gcc/testsuite/gcc.dg/struct/w_ratio_cold_str.c diff -Nurp a/gcc/testsuite/gcc.dg/struct/w_ratio_cold_str.c b/gcc/testsuite/gcc.dg/struct/w_ratio_cold_str.c
--- a/gcc/testsuite/gcc.dg/struct/w_ratio_cold_str.c 2020-06-16 22:27:46.124000000 -0400 --- a/gcc/testsuite/gcc.dg/struct/w_ratio_cold_str.c 2020-09-17 02:26:36.908000000 -0400
+++ b/gcc/testsuite/gcc.dg/struct/w_ratio_cold_str.c 2020-06-16 22:27:58.472000000 -0400 +++ b/gcc/testsuite/gcc.dg/struct/w_ratio_cold_str.c 2020-09-17 02:27:57.372000000 -0400
@@ -40,4 +40,4 @@ main () @@ -40,4 +40,4 @@ main ()
/*--------------------------------------------------------------------------*/ /*--------------------------------------------------------------------------*/
@ -583,7 +589,7 @@ diff -Nurp a/gcc/testsuite/gcc.dg/struct/w_ratio_cold_str.c b/gcc/testsuite/gcc.
-/* { dg-final-use { scan-ipa-dump "Number of structures to transform is 1" "struct_reorg" { xfail *-*-* } } } */ -/* { dg-final-use { scan-ipa-dump "Number of structures to transform is 1" "struct_reorg" { xfail *-*-* } } } */
+/* { dg-final { scan-ipa-dump "Number of structures to transform is 1" "struct_reorg" { xfail *-*-* } } } */ +/* { dg-final { scan-ipa-dump "Number of structures to transform is 1" "struct_reorg" { xfail *-*-* } } } */
diff -Nurp a/gcc/testsuite/g++.dg/torture/pr38355.C b/gcc/testsuite/g++.dg/torture/pr38355.C diff -Nurp a/gcc/testsuite/g++.dg/torture/pr38355.C b/gcc/testsuite/g++.dg/torture/pr38355.C
--- a/gcc/testsuite/g++.dg/torture/pr38355.C 2020-06-16 22:27:46.124000000 -0400 --- a/gcc/testsuite/g++.dg/torture/pr38355.C 2020-09-17 02:26:36.908000000 -0400
+++ b/gcc/testsuite/g++.dg/torture/pr38355.C 1969-12-31 19:00:00.000000000 -0500 +++ b/gcc/testsuite/g++.dg/torture/pr38355.C 1969-12-31 19:00:00.000000000 -0500
@@ -1,25 +0,0 @@ @@ -1,25 +0,0 @@
-// { dg-do run } -// { dg-do run }

View File

@ -18,22 +18,22 @@ diff -Nurp a/gcc/expr.c b/gcc/expr.c
+ rtx x_inner = NULL_RTX; + rtx x_inner = NULL_RTX;
+ rtx y_inner = NULL_RTX; + rtx y_inner = NULL_RTX;
+ +
+ #define CANDIDATE_SUBREG_P(subreg) \ +#define CANDIDATE_SUBREG_P(subreg) \
+ (REG_P (SUBREG_REG (subreg)) \ + (REG_P (SUBREG_REG (subreg)) \
+ && known_eq (GET_MODE_SIZE (GET_MODE (SUBREG_REG (subreg))), \ + && known_eq (GET_MODE_SIZE (GET_MODE (SUBREG_REG (subreg))), \
+ GET_MODE_SIZE (GET_MODE (subreg))) \ + GET_MODE_SIZE (GET_MODE (subreg))) \
+ && optab_handler (mov_optab, GET_MODE (SUBREG_REG (subreg))) \ + && optab_handler (mov_optab, GET_MODE (SUBREG_REG (subreg))) \
+ != CODE_FOR_nothing) + != CODE_FOR_nothing)
+ +
+ #define CANDIDATE_MEM_P(innermode, mem) \ +#define CANDIDATE_MEM_P(innermode, mem) \
+ (!targetm.can_change_mode_class ((innermode), GET_MODE (mem), ALL_REGS) \ + (!targetm.can_change_mode_class ((innermode), GET_MODE (mem), ALL_REGS) \
+ && !push_operand ((mem), GET_MODE (mem)) \ + && !push_operand ((mem), GET_MODE (mem)) \
+ /* Not a candiate if innermode requires too much alignment. */ \ + /* Not a candiate if innermode requires too much alignment. */ \
+ && (MEM_ALIGN (mem) >= GET_MODE_ALIGNMENT (innermode) \ + && (MEM_ALIGN (mem) >= GET_MODE_ALIGNMENT (innermode) \
+ || targetm.slow_unaligned_access (GET_MODE (mem), \ + || targetm.slow_unaligned_access (GET_MODE (mem), \
+ MEM_ALIGN (mem)) \ + MEM_ALIGN (mem)) \
+ || !targetm.slow_unaligned_access ((innermode), \ + || !targetm.slow_unaligned_access ((innermode), \
+ MEM_ALIGN (mem)))) + MEM_ALIGN (mem))))
+ +
+ if (SUBREG_P (x) && CANDIDATE_SUBREG_P (x)) + if (SUBREG_P (x) && CANDIDATE_SUBREG_P (x))
+ x_inner = SUBREG_REG (x); + x_inner = SUBREG_REG (x);