Hi,
At r231739, there was an ICE when checking code generated by
oacc_xform_loop, in case the source contained an error.
Due to seen_error (), gimplification during oacc_xform_loop bailed out,
and an uninitialized var was introduced. Because of gimplifying in ssa
mode, that caused an ICE.
I can't reproduce this any longer, but I think the fix still makes
sense. The patch makes sure oacc_xform_loop gimplifies in non-ssa mode
if seen_error ().
Build on x86_64 with nvidia accelerator setup, tested libgomp and goacc.exp.
Committed to gomp-4_0-branch.
Thanks,
- Tom
Don't gimplify in ssa mode if seen_error in oacc_xform_loop
2016-01-13 Tom de Vries <t...@codesourcery.com>
PR tree-optimization/68977
* omp-low.c (oacc_xform_loop): Handle seen_error () == true.
---
gcc/ChangeLog.gomp | 5 +++++
gcc/omp-low.c | 7 ++++++-
2 files changed, 11 insertions(+), 1 deletion(-)
diff --git a/gcc/omp-low.c b/gcc/omp-low.c
index c99f0b8..a6e3fe3 100644
--- a/gcc/omp-low.c
+++ b/gcc/omp-low.c
@@ -19105,7 +19105,12 @@ oacc_xform_loop (gcall *call)
-> chunks=ceil (range/(chunksize*threads*step))
striding=false,chunking=false
-> chunk_size=ceil(range/(threads*step)),chunks=1 */
- push_gimplify_context (true);
+
+ /* If seen_error (), we may introduce an uninitialized var due to
+ gimplification bailing out. If we gimplify in ssa mode, that will cause an
+ ICE. If we gimplify in non-ssa mode, then ssa updating will turn it into a
+ default definition, and we avoid the ICE. */
+ push_gimplify_context (!seen_error ());
switch (code)
{