From 39bc9f83fece7a16836cb5b4869fe66b66a373a7 Mon Sep 17 00:00:00 2001 From: Tom de Vries Date: Fri, 4 May 2018 08:29:08 +0000 Subject: [PATCH] [expand] Handle null target in expand_builtin_goacc_parlevel_id_size 2018-05-04 Tom de Vries PR libgomp/85639 * builtins.c (expand_builtin_goacc_parlevel_id_size): Handle null target if ignore == 0. From-SVN: r259927 --- gcc/ChangeLog | 6 ++++++ gcc/builtins.c | 3 +++ 2 files changed, 9 insertions(+) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 6ea25f8a9b5..8d8e8d8187d 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2018-05-04 Tom de Vries + + PR libgomp/85639 + * builtins.c (expand_builtin_goacc_parlevel_id_size): Handle null target + if ignore == 0. + 2018-05-04 Richard Biener PR middle-end/85627 diff --git a/gcc/builtins.c b/gcc/builtins.c index 300e13c2f47..0097d5bae97 100644 --- a/gcc/builtins.c +++ b/gcc/builtins.c @@ -6682,6 +6682,9 @@ expand_builtin_goacc_parlevel_id_size (tree exp, rtx target, int ignore) if (ignore) return target; + if (target == NULL_RTX) + target = gen_reg_rtx (TYPE_MODE (TREE_TYPE (exp))); + if (!targetm.have_oacc_dim_size ()) { emit_move_insn (target, fallback_retval); -- 2.30.2