* [PATCH] -fopenmp-simd LTO ICE fix (PR middle-end/67452)
@ 2015-09-04 16:09 Jakub Jelinek
2015-09-04 19:24 ` Richard Biener
2015-09-04 20:42 ` Jeff Law
0 siblings, 2 replies; 3+ messages in thread
From: Jakub Jelinek @ 2015-09-04 16:09 UTC (permalink / raw)
To: Richard Biener, Jan Hubicka, Jeff Law; +Cc: gcc-patches, Ilya Verbin
Hi!
This patch is a fix for gomp4.1 branch ICEs on
FAIL libgomp.c/for-5.c
FAIL libgomp.c++/for-13.C
that can be reproduced with intelmic emul offloading even on the trunk
with the attached testcase. The problem is that LTO streaming doesn't
really like earlier unreferenced VAR_DECLs to be streamed late during
output_function (from output_cfg).
The patch fixes it by clearing loop->simduid when optimizations removed
all IL uses of the var and remove_unused_locals is about to nuke it from
cfun->local_decls.
Ok for trunk/5.3 if it passes bootstrap/regtest?
2015-09-04 Jakub Jelinek <jakub@redhat.com>
PR middle-end/67452
* tree-ssa-live.c: Include cfgloop.h.
(remove_unused_locals): Clear loop->simduid if simduid is about
to be removed from cfun->local_decls.
* gcc.dg/lto/pr67452_0.c: New test.
--- gcc/tree-ssa-live.c.jj 2015-08-24 18:27:19.738209359 +0200
+++ gcc/tree-ssa-live.c 2015-09-04 17:16:53.620321240 +0200
@@ -50,6 +50,7 @@ along with GCC; see the file COPYING3.
#include "tree-ssa.h"
#include "cgraph.h"
#include "ipa-utils.h"
+#include "cfgloop.h"
#ifdef ENABLE_CHECKING
static void verify_live_on_entry (tree_live_info_p);
@@ -820,6 +821,14 @@ remove_unused_locals (void)
}
}
+ if (cfun->has_simduid_loops)
+ {
+ struct loop *loop;
+ FOR_EACH_LOOP (loop, 0)
+ if (loop->simduid && !is_used_p (loop->simduid))
+ loop->simduid = NULL_TREE;
+ }
+
cfun->has_local_explicit_reg_vars = false;
/* Remove unmarked local and global vars from local_decls. */
--- gcc/testsuite/gcc.dg/lto/pr67452_0.c.jj 2015-09-04 17:12:34.636045313 +0200
+++ gcc/testsuite/gcc.dg/lto/pr67452_0.c 2015-09-04 17:13:18.473414952 +0200
@@ -0,0 +1,23 @@
+/* { dg-lto-do link } */
+/* { dg-lto-options { { -O2 -flto -fopenmp-simd } } } */
+
+float b[3][3];
+
+__attribute__((used, noinline)) void
+foo ()
+{
+ int v1, v2;
+#pragma omp simd collapse(2)
+ for (v1 = 0; v1 < 3; v1++)
+ for (v2 = 0; v2 < 3; v2++)
+ b[v1][v2] = 2.5;
+}
+
+int
+main ()
+{
+ asm volatile ("" : : "g" (b) : "memory");
+ foo ();
+ asm volatile ("" : : "g" (b) : "memory");
+ return 0;
+}
Jakub
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] -fopenmp-simd LTO ICE fix (PR middle-end/67452)
2015-09-04 16:09 [PATCH] -fopenmp-simd LTO ICE fix (PR middle-end/67452) Jakub Jelinek
@ 2015-09-04 19:24 ` Richard Biener
2015-09-04 20:42 ` Jeff Law
1 sibling, 0 replies; 3+ messages in thread
From: Richard Biener @ 2015-09-04 19:24 UTC (permalink / raw)
To: Jakub Jelinek, Jan Hubicka, Jeff Law; +Cc: gcc-patches, Ilya Verbin
On September 4, 2015 5:27:27 PM GMT+02:00, Jakub Jelinek <jakub@redhat.com> wrote:
>Hi!
>
>This patch is a fix for gomp4.1 branch ICEs on
>FAIL libgomp.c/for-5.c
>FAIL libgomp.c++/for-13.C
>that can be reproduced with intelmic emul offloading even on the trunk
>with the attached testcase. The problem is that LTO streaming doesn't
>really like earlier unreferenced VAR_DECLs to be streamed late during
>output_function (from output_cfg).
>
>The patch fixes it by clearing loop->simduid when optimizations removed
>all IL uses of the var and remove_unused_locals is about to nuke it
>from
>cfun->local_decls.
>
>Ok for trunk/5.3 if it passes bootstrap/regtest?
OK.
Thanks,
Richard.
>2015-09-04 Jakub Jelinek <jakub@redhat.com>
>
> PR middle-end/67452
> * tree-ssa-live.c: Include cfgloop.h.
> (remove_unused_locals): Clear loop->simduid if simduid is about
> to be removed from cfun->local_decls.
>
> * gcc.dg/lto/pr67452_0.c: New test.
>
>--- gcc/tree-ssa-live.c.jj 2015-08-24 18:27:19.738209359 +0200
>+++ gcc/tree-ssa-live.c 2015-09-04 17:16:53.620321240 +0200
>@@ -50,6 +50,7 @@ along with GCC; see the file COPYING3.
> #include "tree-ssa.h"
> #include "cgraph.h"
> #include "ipa-utils.h"
>+#include "cfgloop.h"
>
> #ifdef ENABLE_CHECKING
> static void verify_live_on_entry (tree_live_info_p);
>@@ -820,6 +821,14 @@ remove_unused_locals (void)
> }
> }
>
>+ if (cfun->has_simduid_loops)
>+ {
>+ struct loop *loop;
>+ FOR_EACH_LOOP (loop, 0)
>+ if (loop->simduid && !is_used_p (loop->simduid))
>+ loop->simduid = NULL_TREE;
>+ }
>+
> cfun->has_local_explicit_reg_vars = false;
>
> /* Remove unmarked local and global vars from local_decls. */
>--- gcc/testsuite/gcc.dg/lto/pr67452_0.c.jj 2015-09-04
>17:12:34.636045313 +0200
>+++ gcc/testsuite/gcc.dg/lto/pr67452_0.c 2015-09-04 17:13:18.473414952
>+0200
>@@ -0,0 +1,23 @@
>+/* { dg-lto-do link } */
>+/* { dg-lto-options { { -O2 -flto -fopenmp-simd } } } */
>+
>+float b[3][3];
>+
>+__attribute__((used, noinline)) void
>+foo ()
>+{
>+ int v1, v2;
>+#pragma omp simd collapse(2)
>+ for (v1 = 0; v1 < 3; v1++)
>+ for (v2 = 0; v2 < 3; v2++)
>+ b[v1][v2] = 2.5;
>+}
>+
>+int
>+main ()
>+{
>+ asm volatile ("" : : "g" (b) : "memory");
>+ foo ();
>+ asm volatile ("" : : "g" (b) : "memory");
>+ return 0;
>+}
>
> Jakub
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] -fopenmp-simd LTO ICE fix (PR middle-end/67452)
2015-09-04 16:09 [PATCH] -fopenmp-simd LTO ICE fix (PR middle-end/67452) Jakub Jelinek
2015-09-04 19:24 ` Richard Biener
@ 2015-09-04 20:42 ` Jeff Law
1 sibling, 0 replies; 3+ messages in thread
From: Jeff Law @ 2015-09-04 20:42 UTC (permalink / raw)
To: Jakub Jelinek, Richard Biener, Jan Hubicka; +Cc: gcc-patches, Ilya Verbin
On 09/04/2015 09:27 AM, Jakub Jelinek wrote:
> Hi!
>
> This patch is a fix for gomp4.1 branch ICEs on
> FAIL libgomp.c/for-5.c
> FAIL libgomp.c++/for-13.C
> that can be reproduced with intelmic emul offloading even on the trunk
> with the attached testcase. The problem is that LTO streaming doesn't
> really like earlier unreferenced VAR_DECLs to be streamed late during
> output_function (from output_cfg).
>
> The patch fixes it by clearing loop->simduid when optimizations removed
> all IL uses of the var and remove_unused_locals is about to nuke it from
> cfun->local_decls.
>
> Ok for trunk/5.3 if it passes bootstrap/regtest?
>
> 2015-09-04 Jakub Jelinek <jakub@redhat.com>
>
> PR middle-end/67452
> * tree-ssa-live.c: Include cfgloop.h.
> (remove_unused_locals): Clear loop->simduid if simduid is about
> to be removed from cfun->local_decls.
>
> * gcc.dg/lto/pr67452_0.c: New test.
OK.
jeff
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2015-09-04 20:33 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-09-04 16:09 [PATCH] -fopenmp-simd LTO ICE fix (PR middle-end/67452) Jakub Jelinek
2015-09-04 19:24 ` Richard Biener
2015-09-04 20:42 ` Jeff Law
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).