[PATCH] Handle empty infinite loops in OpenACC for PR84955
Tom de Vries
Tom_deVries@mentor.com
Tue May 1 13:31:00 GMT 2018
On 04/16/2018 08:13 PM, Tom de Vries wrote:
> On 04/12/2018 08:58 PM, Jakub Jelinek wrote:
>> On Thu, Apr 12, 2018 at 11:39:43AM -0700, Cesar Philippidis wrote:
>>> Strange. I didn't observe any regressions when I tested it. But, then
>>> again, I was testing against revision
>>>
>>> r259092 | jason | 2018-04-04 09:42:55 -0700 (Wed, 04 Apr 2018) | 4 lines
>>>
>>> which is over a week old. I'll revert that patch for now, and revisit
>>> this issue in stage1.
>>
>> You should have kept the omp-expand.c chunk, that is correct and
>> shouldn't
>> cause issues.
>
> Committed as attached (with correct changelog entry, the previously
> committed patch had an incorrect one).
>
Backported to gcc-7-branch as attached.
Thanks,
- Tom
> diff --git a/gcc/omp-expand.c b/gcc/omp-expand.c
> index bb20490..c7d30ea 100644
> --- a/gcc/omp-expand.c
> +++ b/gcc/omp-expand.c
> @@ -5439,6 +5439,14 @@ expand_oacc_for (struct omp_region *region, struct omp_for_data *fd)
>
> split->flags ^= EDGE_FALLTHRU | EDGE_TRUE_VALUE;
>
> + /* Add a dummy exit for the tiled block when cont_bb is missing. */
> + if (cont_bb == NULL)
> + {
> + edge e = make_edge (body_bb, exit_bb, EDGE_FALSE_VALUE);
> + e->probability = profile_probability::even ();
> + split->probability = profile_probability::even ();
> + }
> +
> /* Initialize the user's loop vars. */
> gsi = gsi_start_bb (elem_body_bb);
> expand_oacc_collapse_vars (fd, true, &gsi, counts, e_offset);
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-backport-openacc-Fix-ICE-when-compiling-tile-loop-containing-infinite-loop.patch
Type: text/x-patch
Size: 2383 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20180501/f81b64f2/attachment.bin>
More information about the Gcc-patches
mailing list