Commit 45177337 by Jason Merrill Committed by Jason Merrill

PR c++/68983 (BE)

	PR c++/67557
gcc/
	* function.c (assign_temp): Guard against TREE_ADDRESSABLE types here.
	* expr.c (store_field): Not here.
	* tree-cfgcleanup.c (fixup_noreturn_call): Don't clear LHS of a
	call with TREE_ADDRESSABLE type.
	* tree-cfg.c (verify_gimple_call): Adjust.
gcc/cp/
	* cvt.c (convert_to_void): Don't strip a TARGET_EXPR of
	TREE_ADDRESSABLE type.

From-SVN: r232167
parent 0795b6f2
2016-01-08 Jason Merrill <jason@redhat.com>
PR c++/68983
PR c++/67557
* function.c (assign_temp): Guard against TREE_ADDRESSABLE types here.
* expr.c (store_field): Not here.
* tree-cfgcleanup.c (fixup_noreturn_call): Don't clear LHS of a
call with TREE_ADDRESSABLE type.
* tree-cfg.c (verify_gimple_call): Adjust.
2016-01-08 Olivier Hainque <hainque@adacore.com> 2016-01-08 Olivier Hainque <hainque@adacore.com>
* config/vxworks.h (VXWORKS_LIBGCC_SPEC): Don't link shared RTPs with * config/vxworks.h (VXWORKS_LIBGCC_SPEC): Don't link shared RTPs with
......
...@@ -2,6 +2,11 @@ ...@@ -2,6 +2,11 @@
PR c++/68983 PR c++/68983
PR c++/67557 PR c++/67557
* cvt.c (convert_to_void): Don't strip a TARGET_EXPR of
TREE_ADDRESSABLE type.
PR c++/68983
PR c++/67557
* call.c (unsafe_copy_elision_p): Look through COMPOUND_EXPR. * call.c (unsafe_copy_elision_p): Look through COMPOUND_EXPR.
2016-01-05 Nathan Sidwell <nathan@acm.org> 2016-01-05 Nathan Sidwell <nathan@acm.org>
......
...@@ -1229,11 +1229,12 @@ convert_to_void (tree expr, impl_conv_void implicit, tsubst_flags_t complain) ...@@ -1229,11 +1229,12 @@ convert_to_void (tree expr, impl_conv_void implicit, tsubst_flags_t complain)
case TARGET_EXPR: case TARGET_EXPR:
/* Don't bother with the temporary object returned from a function if /* Don't bother with the temporary object returned from a function if
we don't use it and don't need to destroy it. We'll still we don't use it, don't need to destroy it, and won't abort in
assign_temp. We'll still
allocate space for it in expand_call or declare_return_variable, allocate space for it in expand_call or declare_return_variable,
but we don't need to track it through all the tree phases. */ but we don't need to track it through all the tree phases. */
if (TARGET_EXPR_IMPLICIT_P (expr) if (TARGET_EXPR_IMPLICIT_P (expr)
&& TYPE_HAS_TRIVIAL_DESTRUCTOR (TREE_TYPE (expr))) && !TREE_ADDRESSABLE (TREE_TYPE (expr)))
{ {
tree init = TARGET_EXPR_INITIAL (expr); tree init = TARGET_EXPR_INITIAL (expr);
if (TREE_CODE (init) == AGGR_INIT_EXPR if (TREE_CODE (init) == AGGR_INIT_EXPR
......
...@@ -6655,9 +6655,6 @@ store_field (rtx target, HOST_WIDE_INT bitsize, HOST_WIDE_INT bitpos, ...@@ -6655,9 +6655,6 @@ store_field (rtx target, HOST_WIDE_INT bitsize, HOST_WIDE_INT bitpos,
rtx temp; rtx temp;
gimple *nop_def; gimple *nop_def;
/* Using bitwise copy is not safe for TREE_ADDRESSABLE types. */
gcc_assert (!TREE_ADDRESSABLE (TREE_TYPE (exp)));
/* If EXP is a NOP_EXPR of precision less than its mode, then that /* If EXP is a NOP_EXPR of precision less than its mode, then that
implies a mask operation. If the precision is the same size as implies a mask operation. If the precision is the same size as
the field we're storing into, that mask is redundant. This is the field we're storing into, that mask is redundant. This is
......
...@@ -956,6 +956,10 @@ assign_temp (tree type_or_decl, int memory_required, ...@@ -956,6 +956,10 @@ assign_temp (tree type_or_decl, int memory_required,
unsignedp = TYPE_UNSIGNED (type); unsignedp = TYPE_UNSIGNED (type);
#endif #endif
/* Allocating temporaries of TREE_ADDRESSABLE type must be done in the front
end. See also create_tmp_var for the gimplification-time check. */
gcc_assert (!TREE_ADDRESSABLE (type) && COMPLETE_TYPE_P (type));
if (mode == BLKmode || memory_required) if (mode == BLKmode || memory_required)
{ {
HOST_WIDE_INT size = int_size_in_bytes (type); HOST_WIDE_INT size = int_size_in_bytes (type);
......
// PR c++/68983
class SvxOptionsGrid {
int nFldDrawX;
bool bEqualGrid;
public:
~SvxOptionsGrid();
};
class A : SvxOptionsGrid {
public:
A(SvxOptionsGrid p1) : SvxOptionsGrid(p1) {}
};
SvxOptionsGrid a;
void fn1() { A b(a); }
...@@ -3371,7 +3371,8 @@ verify_gimple_call (gcall *stmt) ...@@ -3371,7 +3371,8 @@ verify_gimple_call (gcall *stmt)
if (lhs if (lhs
&& gimple_call_ctrl_altering_p (stmt) && gimple_call_ctrl_altering_p (stmt)
&& gimple_call_noreturn_p (stmt) && gimple_call_noreturn_p (stmt)
&& TREE_CODE (TYPE_SIZE_UNIT (TREE_TYPE (lhs))) == INTEGER_CST) && TREE_CODE (TYPE_SIZE_UNIT (TREE_TYPE (lhs))) == INTEGER_CST
&& !TREE_ADDRESSABLE (TREE_TYPE (lhs)))
{ {
error ("LHS in noreturn call"); error ("LHS in noreturn call");
return true; return true;
......
...@@ -601,9 +601,11 @@ fixup_noreturn_call (gimple *stmt) ...@@ -601,9 +601,11 @@ fixup_noreturn_call (gimple *stmt)
/* If there is an LHS, remove it, but only if its type has fixed size. /* If there is an LHS, remove it, but only if its type has fixed size.
The LHS will need to be recreated during RTL expansion and creating The LHS will need to be recreated during RTL expansion and creating
temporaries of variable-sized types is not supported. */ temporaries of variable-sized types is not supported. Also don't
do this with TREE_ADDRESSABLE types, as assign_temp will abort. */
tree lhs = gimple_call_lhs (stmt); tree lhs = gimple_call_lhs (stmt);
if (lhs && TREE_CODE (TYPE_SIZE_UNIT (TREE_TYPE (lhs))) == INTEGER_CST) if (lhs && TREE_CODE (TYPE_SIZE_UNIT (TREE_TYPE (lhs))) == INTEGER_CST
&& !TREE_ADDRESSABLE (TREE_TYPE (lhs)))
{ {
gimple_call_set_lhs (stmt, NULL_TREE); gimple_call_set_lhs (stmt, NULL_TREE);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment