public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc/devel/autopar_devel] tree-optimization/95308 - really avoid forward propagating of &TMR
@ 2020-08-22 21:33 Giuliano Belinassi
0 siblings, 0 replies; 2+ messages in thread
From: Giuliano Belinassi @ 2020-08-22 21:33 UTC (permalink / raw)
To: gcc-cvs
https://gcc.gnu.org/g:90865dd34e94407f9f3ebd86e40bf44e6e968e0d
commit 90865dd34e94407f9f3ebd86e40bf44e6e968e0d
Author: Richard Biener <rguenther@suse.de>
Date: Mon May 25 13:48:57 2020 +0200
tree-optimization/95308 - really avoid forward propagating of &TMR
This fixes a hole that still allowed forwarding of TARGET_MEM_REF
addresses.
2020-05-25 Richard Biener <rguenther@suse.de>
PR tree-optimization/95308
* tree-ssa-forwprop.c (pass_forwprop::execute): Generalize
test for TARGET_MEM_REFs.
* g++.dg/torture/pr95308.C: New testcase.
Diff:
---
gcc/ChangeLog | 6 ++++++
gcc/testsuite/ChangeLog | 5 +++++
2 files changed, 11 insertions(+)
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 150dc096c7a..d5844590274 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+2020-05-25 Richard Biener <rguenther@suse.de>
+
+ PR tree-optimization/95308
+ * tree-ssa-forwprop.c (pass_forwprop::execute): Generalize
+ test for TARGET_MEM_REFs.
+
2020-05-25 Richard Biener <rguenther@suse.de>
PR tree-optimization/95295
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index cba153f166e..dfb92ec5748 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2020-05-25 Richard Biener <rguenther@suse.de>
+
+ PR tree-optimization/95308
+ * g++.dg/torture/pr95308.C: New testcase.
+
2020-05-25 Richard Biener <rguenther@suse.de>
PR tree-optimization/95295
^ permalink raw reply [flat|nested] 2+ messages in thread
* [gcc/devel/autopar_devel] tree-optimization/95308 - really avoid forward propagating of &TMR
@ 2020-08-22 21:33 Giuliano Belinassi
0 siblings, 0 replies; 2+ messages in thread
From: Giuliano Belinassi @ 2020-08-22 21:33 UTC (permalink / raw)
To: gcc-cvs
https://gcc.gnu.org/g:3fc16a2d5504c81ab15975b4968871cf6d168f5b
commit 3fc16a2d5504c81ab15975b4968871cf6d168f5b
Author: Richard Biener <rguenther@suse.de>
Date: Mon May 25 09:44:50 2020 +0200
tree-optimization/95308 - really avoid forward propagating of &TMR
This fixes a hole that still allowed forwarding of TARGET_MEM_REF
addresses.
2020-05-25 Richard Biener <rguenther@suse.de>
PR tree-optimization/95308
* tree-ssa-forwprop.c (pass_forwprop::execute): Generalize
test for TARGET_MEM_REFs.
* g++.dg/torture/pr95308.C: New testcase.
Diff:
---
gcc/testsuite/g++.dg/torture/pr95308.C | 21 +++++++++++++++++++++
gcc/tree-ssa-forwprop.c | 14 +++++++-------
2 files changed, 28 insertions(+), 7 deletions(-)
diff --git a/gcc/testsuite/g++.dg/torture/pr95308.C b/gcc/testsuite/g++.dg/torture/pr95308.C
new file mode 100644
index 00000000000..01aa8ad17a6
--- /dev/null
+++ b/gcc/testsuite/g++.dg/torture/pr95308.C
@@ -0,0 +1,21 @@
+// { dg-do compile }
+// { dg-additional-options "-march=skylake-avx512" { target x86_64-*-* i?86-*-* } }
+
+extern int a[][18];
+extern short b[], c[];
+extern char d[][18];
+int e;
+void i(char f, long g[][100][100][100])
+{
+ for (int h = 0;; h += 2)
+ for (char j = 0; j < 17; j++) {
+ if (e ? f : 0) {
+ a[h][j] = 5;
+ for (int k = 0; k < 12; k += 4)
+ for (short l = 0; l < 015; l += 2)
+ b[k * 3 + l] = bool(g[2][j][k][l]);
+ } else
+ d[h][j] = 0;
+ c[j] = 3;
+ }
+}
diff --git a/gcc/tree-ssa-forwprop.c b/gcc/tree-ssa-forwprop.c
index b2ea3622d70..759baf56897 100644
--- a/gcc/tree-ssa-forwprop.c
+++ b/gcc/tree-ssa-forwprop.c
@@ -2763,18 +2763,18 @@ pass_forwprop::execute (function *fun)
/* If this statement sets an SSA_NAME to an address,
try to propagate the address into the uses of the SSA_NAME. */
- if (code == ADDR_EXPR
- /* Handle pointer conversions on invariant addresses
- as well, as this is valid gimple. */
- || (CONVERT_EXPR_CODE_P (code)
- && TREE_CODE (rhs) == ADDR_EXPR
- && POINTER_TYPE_P (TREE_TYPE (lhs))))
+ if ((code == ADDR_EXPR
+ /* Handle pointer conversions on invariant addresses
+ as well, as this is valid gimple. */
+ || (CONVERT_EXPR_CODE_P (code)
+ && TREE_CODE (rhs) == ADDR_EXPR
+ && POINTER_TYPE_P (TREE_TYPE (lhs))))
+ && TREE_CODE (TREE_OPERAND (rhs, 0)) != TARGET_MEM_REF)
{
tree base = get_base_address (TREE_OPERAND (rhs, 0));
if ((!base
|| !DECL_P (base)
|| decl_address_invariant_p (base))
- && TREE_CODE (base) != TARGET_MEM_REF
&& !stmt_references_abnormal_ssa_name (stmt)
&& forward_propagate_addr_expr (lhs, rhs, true))
{
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-08-22 21:33 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-22 21:33 [gcc/devel/autopar_devel] tree-optimization/95308 - really avoid forward propagating of &TMR Giuliano Belinassi
-- strict thread matches above, loose matches on Subject: below --
2020-08-22 21:33 Giuliano Belinassi
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).