* gimplify.c (gimplify_modify_expr_rhs): Don't do return slot opt if
the target was declared 'register'.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@111947
138bc75d-0d04-0410-961f-
82ee72b054a4
+2006-03-10 Jason Merrill <jason@redhat.com>
+
+ PR c/26004
+ * gimplify.c (gimplify_modify_expr_rhs): Don't do return slot opt if
+ the target was declared 'register'.
+
2006-03-10 Adam Nemet <anemet@caviumnetworks.com>
* genpreds.c (write_insn_constraint_len): Change definition of
&& needs_to_live_in_memory (*to_p))
/* It's OK to use the return slot directly unless it's an NRV. */
use_target = true;
- else if (is_gimple_reg_type (TREE_TYPE (*to_p)))
+ else if (is_gimple_reg_type (TREE_TYPE (*to_p))
+ || (DECL_P (*to_p) && DECL_REGISTER (*to_p)))
/* Don't force regs into memory. */
use_target = false;
else if (TREE_CODE (*to_p) == VAR_DECL
--- /dev/null
+/* PR c/26004 */
+/* Bug: the return slot optimization was taking the address of s_3,
+ causing an error. */
+
+struct s_3 { short s[3]; } z_3, s_3;
+struct s_3 add_struct_3 (struct s_3 s){}
+wack_struct_3 (void)
+{
+ int i; register struct s_3 u = z_3;
+ u = add_struct_3 (u);
+}