[OpenACC] Don't gimplify in ssa mode if seen_error in oacc_xform_loop
2018-XX-YY Tom de Vries <tdevries@suse.de>
Cesar Philippidis <cesar@codesourcery.com>
gcc/
PR tree-optimization/68977
* omp-offload.c (oacc_xform_loop): Handle seen_error () == true.
(cherry picked from gomp-4_0-branch r232343 and r232344)
---
@@ -335,7 +335,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)
{
--
2.17.1