- Add add-checks-to-avoid-spoiling-if-conversion.patch - Add add-option-fallow-store-data-races.patch - Add complete-struct-reorg.patch - Add cse-in-vectorization.patch - Add enable-simd-math.patch - Add fix-ICE-avoid-issueing-loads-in-SM-when-possible.patch - Add fix-ICE-in-compute_live_loop_exits.patch - Add fix-ICE-in-copy_reference_ops_from_ref.patch - Add fix-ICE-in-declare-return-variable.patch - Add fix-ICE-in-exact_div.patch - Add fix-ICE-in-gimple_op.patch - Add fix-ICE-in-model_update_limit_points_in_group.patch - Add fix-ICE-in-reload.patch - Add fix-ICE-in-store_constructor.patch - Add fix-ICE-in-vec.patch - Add fix-ICE-in-vect_create_epilog_for_reduction.patch - Add fix-ICE-in-vect_create_epilog_for_reduction_2.patch - Add fix-ICE-in-vect_create_epilog_for_reduction_3.patch - Add fix-ICE-in-vect_get_vec_def_for_stmt_copy.patch - Add fix-ICE-in-vect_slp_analyze_node_operations.patch - Add fix-ICE-in-vect_stmt_to_vectorize.patch - Add fix-ICE-in-vect_transform_stmt.patch - Add fix-ICE-in-vectorizable_condition.patch - Add fix-ICE-in-verify_ssa.patch - Add fix-ICE-statement-uses-released-SSA-name.patch - Add fix-ICE-when-vectorizing-nested-cycles.patch - Add fix-SSA-update-for-vectorizer-epilogue.patch - Add fix-do-not-build-op.patch - Add fix-load-eliding-in-SM.patch - Add fix-wrong-vectorizer-code.patch - Add generate-csel-for-arrayref.patch - Add ipa-const-prop-self-recursion-bugfix.patch - Add ipa-const-prop.patch - Add ipa-struct-reorg-bugfix.patch - Add ipa-struct-reorg.patch - Add medium-code-mode.patch - Add reduction-chain-slp-option.patch - Add reductions-slp-enhancement.patch - Add simplify-removing-subregs.patch - Add tighten-range-for-generating-csel.patch - Add vectorization-enhancement.patch - Add add-checks-to-avoid-spoiling-if-conversion.patch - Add add-option-fallow-store-data-races.patch - Add complete-struct-reorg.patch - Add cse-in-vectorization.patch - Add enable-simd-math.patch - Add fix-ICE-avoid-issueing-loads-in-SM-when-possible.patch - Add fix-ICE-in-compute_live_loop_exits.patch - Add fix-ICE-in-copy_reference_ops_from_ref.patch - Add fix-ICE-in-declare-return-variable.patch - Add fix-ICE-in-exact_div.patch - Add fix-ICE-in-gimple_op.patch - Add fix-ICE-in-model_update_limit_points_in_group.patch - Add fix-ICE-in-reload.patch - Add fix-ICE-in-store_constructor.patch - Add fix-ICE-in-vec.patch - Add fix-ICE-in-vect_create_epilog_for_reduction.patch - Add fix-ICE-in-vect_create_epilog_for_reduction_2.patch - Add fix-ICE-in-vect_create_epilog_for_reduction_3.patch - Add fix-ICE-in-vect_get_vec_def_for_stmt_copy.patch - Add fix-ICE-in-vect_slp_analyze_node_operations.patch - Add fix-ICE-in-vect_stmt_to_vectorize.patch - Add fix-ICE-in-vect_transform_stmt.patch - Add fix-ICE-in-vectorizable_condition.patch - Add fix-ICE-in-verify_ssa.patch - Add fix-ICE-statement-uses-released-SSA-name.patch - Add fix-ICE-when-vectorizing-nested-cycles.patch - Add fix-SSA-update-for-vectorizer-epilogue.patch - Add fix-do-not-build-op.patch - Add fix-load-eliding-in-SM.patch - Add fix-wrong-vectorizer-code.patch - Add generate-csel-for-arrayref.patch - Add ipa-const-prop-self-recursion-bugfix.patch - Add ipa-const-prop.patch - Add ipa-struct-reorg-bugfix.patch - Add ipa-struct-reorg.patch - Add medium-code-mode.patch - Add reduction-chain-slp-option.patch - Add reductions-slp-enhancement.patch - Add simplify-removing-subregs.patch - Add tighten-range-for-generating-csel.patch - Add vectorization-enhancement.patch
59 lines
1.7 KiB
Diff
59 lines
1.7 KiB
Diff
This backport contains 1 patch from gcc main stream tree.
|
|
The commit id of these patchs list as following in the order of time.
|
|
|
|
0001-re-PR-middle-end-91195-incorrect-may-be-used-uniniti.patch
|
|
06e8db10cd80d88fb3a6afedf2c35da6c1fa6d85
|
|
|
|
diff -uprN a/gcc/testsuite/gcc.dg/pr91195.c b/gcc/testsuite/gcc.dg/pr91195.c
|
|
new file mode 100644
|
|
--- /dev/null
|
|
+++ b/gcc/testsuite/gcc.dg/pr91195.c
|
|
@@ -0,0 +1,25 @@
|
|
+/* PR middle-end/91195 */
|
|
+/* { dg-do compile } */
|
|
+/* { dg-options "-Wmaybe-uninitialized -O2" } */
|
|
+
|
|
+int bar (char*);
|
|
+
|
|
+void
|
|
+foo (char *x, char *y)
|
|
+{
|
|
+ char *a[2];
|
|
+ int b = 0;
|
|
+
|
|
+ if (x)
|
|
+ a[b++] = x; /* { dg-bogus "may be used uninitialized in this function" } */
|
|
+ if (y)
|
|
+ a[b++] = y;
|
|
+
|
|
+ for (int j = 0; j < 4; j++)
|
|
+ switch (j)
|
|
+ {
|
|
+ case 0:
|
|
+ if (b == 0 || bar (a[0]))
|
|
+ break;
|
|
+ }
|
|
+}
|
|
diff -uprN a/gcc/tree-ssa-phiopt.c b/gcc/tree-ssa-phiopt.c
|
|
--- a/gcc/tree-ssa-phiopt.c
|
|
+++ b/gcc/tree-ssa-phiopt.c
|
|
@@ -2269,6 +2269,10 @@ cond_store_replacement (basic_block middle_bb, basic_block join_bb,
|
|
name = make_temp_ssa_name (TREE_TYPE (lhs), NULL, "cstore");
|
|
new_stmt = gimple_build_assign (name, lhs);
|
|
gimple_set_location (new_stmt, locus);
|
|
+ lhs = unshare_expr (lhs);
|
|
+ /* Set TREE_NO_WARNING on the rhs of the load to avoid uninit
|
|
+ warnings. */
|
|
+ TREE_NO_WARNING (gimple_assign_rhs1 (new_stmt)) = 1;
|
|
gsi_insert_on_edge (e1, new_stmt);
|
|
|
|
/* 3) Create a PHI node at the join block, with one argument
|
|
@@ -2279,7 +2283,6 @@ cond_store_replacement (basic_block middle_bb, basic_block join_bb,
|
|
add_phi_arg (newphi, rhs, e0, locus);
|
|
add_phi_arg (newphi, name, e1, locus);
|
|
|
|
- lhs = unshare_expr (lhs);
|
|
new_stmt = gimple_build_assign (lhs, PHI_RESULT (newphi));
|
|
|
|
/* 4) Insert that PHI node. */
|