re PR c++/58516 (ICE with __transaction_atomic)

PR c++/58516
cp/
	* semantics.c (finish_transaction_stmt): Check for EXPR_P before
	setting the expr location.

testsuite/
	* g++.dg/tm/pr58516.C: New test.

From-SVN: r202883
This commit is contained in:
Marek Polacek 2013-09-25 07:48:47 +00:00
parent 28d18db363
commit 550dfe7f28
4 changed files with 24 additions and 4 deletions

View File

@ -1,3 +1,9 @@
2013-09-25 Marek Polacek <polacek@redhat.com>
PR c++/58516
* semantics.c (finish_transaction_stmt): Check for EXPR_P before
setting the expr location.
2013-09-23 Adam Butcher <adam@jessamine.co.uk>
PR c++/58500

View File

@ -5199,7 +5199,9 @@ finish_transaction_stmt (tree stmt, tree compound_stmt, int flags, tree noex)
{
tree body = build_must_not_throw_expr (TRANSACTION_EXPR_BODY (stmt),
noex);
SET_EXPR_LOCATION (body, EXPR_LOCATION (TRANSACTION_EXPR_BODY (stmt)));
/* This may not be true when the STATEMENT_LIST is empty. */
if (EXPR_P (body))
SET_EXPR_LOCATION (body, EXPR_LOCATION (TRANSACTION_EXPR_BODY (stmt)));
TREE_SIDE_EFFECTS (body) = 1;
TRANSACTION_EXPR_BODY (stmt) = body;
}

View File

@ -1,8 +1,13 @@
2013-09-25 Marek Polacek <polacek@redhat.com>
PR c++/58516
* g++.dg/tm/pr58516.C: New test.
2013-09-24 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
* lib/target-supports.exp (check_effective_target_arm_cond_exec):
New procedure.
* gcc.target/arm/minmax_minus.c: Check for cond_exec target.
* lib/target-supports.exp (check_effective_target_arm_cond_exec):
New procedure.
* gcc.target/arm/minmax_minus.c: Check for cond_exec target.
2013-09-24 Richard Biener <rguenther@suse.de>

View File

@ -0,0 +1,7 @@
// { dg-do compile }
// { dg-options "-std=c++11 -fgnu-tm" }
void foo()
{
__transaction_atomic noexcept(false) {}
}