aboutsummaryrefslogtreecommitdiff
path: root/gcc/stor-layout.c
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2004-07-18 01:44:18 -0400
committerJason Merrill <jason@gcc.gnu.org>2004-07-18 01:44:18 -0400
commitd8472c75e8f6cdeabb60e2d743e58fb7ab46fef6 (patch)
treec1f40776f7d9fdfe9b7691b28cc55470e406ddcc /gcc/stor-layout.c
parentb52cf5a74395bb7b39ded04dd7dd1fd756dd99e3 (diff)
downloadgcc-d8472c75e8f6cdeabb60e2d743e58fb7ab46fef6.zip
gcc-d8472c75e8f6cdeabb60e2d743e58fb7ab46fef6.tar.gz
gcc-d8472c75e8f6cdeabb60e2d743e58fb7ab46fef6.tar.bz2
re PR tree-optimization/16115 (double-destruction problem with argument passing via temporary (breaks auto_ptr))
PR c++/16115 * stor-layout.c (relayout_decl): New fn. * tree.h: Declare it. (DECL_BY_REFERENCE): New macro. * cp/call.c (type_passed_as): Make the invisible reference type __restrict. * cp/cp-gimplify.c (gimplify_cleanup_stmt): Rename to cp_genericize_r. Handle invisible reference lowering. (is_invisiref_parm): New fn. (cp_genericize): Adjust the types of invisible reference parms. Don't repeat the walk for clones. * cp/decl.c (store_parm_decls): Don't generate any code for clones. From-SVN: r84887
Diffstat (limited to 'gcc/stor-layout.c')
-rw-r--r--gcc/stor-layout.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/gcc/stor-layout.c b/gcc/stor-layout.c
index 6897685..0ca26c2 100644
--- a/gcc/stor-layout.c
+++ b/gcc/stor-layout.c
@@ -524,6 +524,20 @@ layout_decl (tree decl, unsigned int known_align)
SET_DECL_RTL (decl, rtl);
}
}
+
+/* Given a VAR_DECL, PARM_DECL or RESULT_DECL, clears the results of
+ a previous call to layout_decl and calls it again. */
+
+void
+relayout_decl (tree decl)
+{
+ DECL_SIZE (decl) = DECL_SIZE_UNIT (decl) = 0;
+ DECL_MODE (decl) = VOIDmode;
+ DECL_ALIGN (decl) = 0;
+ SET_DECL_RTL (decl, 0);
+
+ layout_decl (decl, 0);
+}
/* Hook for a front-end function that can modify the record layout as needed
immediately before it is finalized. */