* builtins.c (expand_builtin_acc_on_device): Check target for NULL.
authoruros <uros@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 16 Jan 2015 13:16:46 +0000 (13:16 +0000)
committeruros <uros@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 16 Jan 2015 13:16:46 +0000 (13:16 +0000)
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@219735 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/builtins.c

index efab157..4010ace 100644 (file)
@@ -1,3 +1,7 @@
+2015-01-16  Uros Bizjak  <ubizjak@gmail.com>
+
+       * builtins.c (expand_builtin_acc_on_device): Check target for NULL.
+
 2015-01-16  Matthew Wahab  <matthew.wahab@arm.com>
 
        PR target/64149
index 9a6a11b..bf5acbc 100644 (file)
@@ -5930,7 +5930,7 @@ expand_builtin_acc_on_device (tree exp, rtx target)
   v2 = GEN_INT (GOMP_DEVICE_HOST);
 #endif
   machine_mode target_mode = TYPE_MODE (integer_type_node);
-  if (!REG_P (target) || GET_MODE (target) != target_mode)
+  if (!target || !register_operand (target, target_mode))
     target = gen_reg_rtx (target_mode);
   emit_move_insn (target, const1_rtx);
   rtx_code_label *done_label = gen_label_rtx ();