diff --git a/gdb/regcache.c b/gdb/regcache.c
index c151aee5f717..218257aa085f 100644
--- a/gdb/regcache.c
+++ b/gdb/regcache.c
@@ -773,11 +773,8 @@ readable_regcache::cooked_read_value (int regnum)
       || (m_has_pseudo && m_register_status[regnum] != REG_UNKNOWN)
       || !gdbarch_pseudo_register_read_value_p (m_descr->gdbarch))
     {
-      struct value *result;
-
-      result = value::allocate (register_type (m_descr->gdbarch, regnum));
-      result->set_lval (lval_register);
-      VALUE_REGNUM (result) = regnum;
+      value *result = value::allocate_register
+	(get_next_frame_sentinel_okay (get_current_frame ()), regnum);
 
       /* It is more efficient in general to do this delegation in this
 	 direction than in the other one, even though the value-based
diff --git a/gdb/value.c b/gdb/value.c
index 7067ae94df0b..a2acd1f26e03 100644
--- a/gdb/value.c
+++ b/gdb/value.c
@@ -959,6 +959,21 @@ value::allocate (struct type *type)
   return allocate (type, true);
 }
 
+/* See value.h  */
+
+struct value *
+value::allocate_register (frame_info_ptr next_frame, int regnum)
+{
+  value *result
+    = value::allocate (register_type (frame_unwind_arch (next_frame), regnum));
+
+  result->set_lval (lval_register);
+  VALUE_REGNUM (result) = regnum;
+  VALUE_NEXT_FRAME_ID (result) = get_frame_id (next_frame);
+
+  return result;
+}
+
 /* Allocate a  value  that has the correct length
    for COUNT repetitions of type TYPE.  */
 
diff --git a/gdb/value.h b/gdb/value.h
index 3f9b35b589bd..2f3b41e26ea4 100644
--- a/gdb/value.h
+++ b/gdb/value.h
@@ -159,6 +159,13 @@ struct value
   /* Allocate a value and its contents for type TYPE.  */
   static struct value *allocate (struct type *type);
 
+  /* Allocate a non-lazy value representing register RENUM in the frame previous
+     to NEXT_FRAME.  The type of the value is found using `register_type`.
+
+     The caller is responsible for filling the value's contents.  */
+  static struct value *allocate_register (frame_info_ptr next_frame,
+					  int regnum);
+
   /* Create a computed lvalue, with type TYPE, function pointers
      FUNCS, and closure CLOSURE.  */
   static struct value *allocate_computed (struct type *type,
