Commit a4d031c7 by Aldy Hernandez Committed by Aldy Hernandez

re PR middle-end/52141 ([trans-mem] ICE due to asm statement in trans-mem.c:expand_block_tm)

        PR middle-end/52141
        * trans-mem.c (ipa_tm_scan_irr_block): Error out on GIMPLE_ASM's
        in a transaction safe function.

From-SVN: r184417
parent 6e887223
2012-02-20 Aldy Hernandez <aldyh@redhat.com>
PR middle-end/52141
* trans-mem.c (ipa_tm_scan_irr_block): Error out on GIMPLE_ASM's
in a transaction safe function.
2012-02-20 Kai Tietz <ktietz@redhat.com>
PR target/52238
......
/* { dg-do compile } */
/* { dg-options "-fgnu-tm -O0 -w" } */
__attribute__((always_inline))
static void asmfunc(void)
{
__asm__ (""); /* { dg-error "asm not allowed in .transaction_safe" } */
}
__attribute__((transaction_safe))
static void f(void)
{
asmfunc();
}
int main()
{
__transaction_atomic {
f();
}
return 0;
}
/* { dg-message "inlined from \'f\'" "" { target *-*-* } 0 } */
......@@ -3736,6 +3736,13 @@ ipa_tm_scan_irr_block (basic_block bb)
assembly statement is not relevant to the transaction
is to wrap it in a __tm_waiver block. This is not
yet implemented, so we can't check for it. */
if (is_tm_safe (current_function_decl))
{
tree t = build1 (NOP_EXPR, void_type_node, size_zero_node);
SET_EXPR_LOCATION (t, gimple_location (stmt));
TREE_BLOCK (t) = gimple_block (stmt);
error ("%Kasm not allowed in %<transaction_safe%> function", t);
}
return true;
default:
......
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