@@ -1,3 +1,8 @@
+2014-02-24 Andrew Pinski <apinski@cavium.com>
+
+ * builtins.c (expand_builtin_thread_pointer): Create a new target
+ when the target is NULL.
+
2014-02-25 Vladimir Makarov <vmakarov@redhat.com>
PR rtl-optimization/60317
@@ -5712,7 +5712,10 @@ expand_builtin_thread_pointer (tree exp, rtx target)
if (icode != CODE_FOR_nothing)
{
struct expand_operand op;
- if (!REG_P (target) || GET_MODE (target) != Pmode)
+ /* If the target is not sutitable then create a new target. */
+ if (target == NULL_RTX
+ || !REG_P (target)
+ || GET_MODE (target) != Pmode)
target = gen_reg_rtx (Pmode);
create_output_operand (&op, target, Pmode);
expand_insn (icode, 1, &op);