[expand] Handle null target in expand_builtin_goacc_parlevel_id_size
authorTom de Vries <tom@codesourcery.com>
Fri, 4 May 2018 08:29:08 +0000 (08:29 +0000)
committerTom de Vries <vries@gcc.gnu.org>
Fri, 4 May 2018 08:29:08 +0000 (08:29 +0000)
2018-05-04  Tom de Vries  <tom@codesourcery.com>

PR libgomp/85639
* builtins.c (expand_builtin_goacc_parlevel_id_size): Handle null target
if ignore == 0.

From-SVN: r259927

gcc/ChangeLog
gcc/builtins.c

index 6ea25f8a9b530606bbd78a31c6c2677efe57f3a6..8d8e8d8187d682c0f71420a7987cbb3b8f4a5b80 100644 (file)
@@ -1,3 +1,9 @@
+2018-05-04  Tom de Vries  <tom@codesourcery.com>
+
+       PR libgomp/85639
+       * builtins.c (expand_builtin_goacc_parlevel_id_size): Handle null target
+       if ignore == 0.
+
 2018-05-04  Richard Biener  <rguenther@suse.de>
 
        PR middle-end/85627
index 300e13c2f47ab9a355cc7c5a7e6a3ccf7dddf14e..0097d5bae97dcb480b831b537f92eff9524bb18a 100644 (file)
@@ -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);