Commit 3a54c456 by Aldy Hernandez Committed by Aldy Hernandez

re PR middle-end/51696 ([trans-mem] unsafe indirect function call in struct not properly displayed)

        PR middle-end/51696
        * trans-mem.c (diagnose_tm_1): Display indirect calls with no name
        correctly.

From-SVN: r182876
parent 17d038cd
2012-01-04 Aldy Hernandez <aldyh@redhat.com>
PR middle-end/51696
* trans-mem.c (diagnose_tm_1): Display indirect calls with no name
correctly.
2012-01-04 Richard Guenther <rguenther@suse.de>
PR middle-end/51750
/* { dg-do compile } */
/* { dg-options "-fgnu-tm" } */
struct list {
void (*compare)();
} *listPtr;
static void (*compare)();
__attribute__((transaction_safe))
static void func () {
listPtr->compare(); /* { dg-error "unsafe indirect function call" } */
compare(); /* { dg-error "unsafe function call" } */
}
......@@ -664,9 +664,16 @@ diagnose_tm_1 (gimple_stmt_iterator *gsi, bool *handled_ops_p,
"unsafe function call %qD within "
"atomic transaction", fn);
else
error_at (gimple_location (stmt),
"unsafe function call %qE within "
"atomic transaction", fn);
{
if (!DECL_P (fn) || DECL_NAME (fn))
error_at (gimple_location (stmt),
"unsafe function call %qE within "
"atomic transaction", fn);
else
error_at (gimple_location (stmt),
"unsafe indirect function call within "
"atomic transaction");
}
}
else
{
......@@ -675,9 +682,16 @@ diagnose_tm_1 (gimple_stmt_iterator *gsi, bool *handled_ops_p,
"unsafe function call %qD within "
"%<transaction_safe%> function", fn);
else
error_at (gimple_location (stmt),
"unsafe function call %qE within "
"%<transaction_safe%> function", fn);
{
if (!DECL_P (fn) || DECL_NAME (fn))
error_at (gimple_location (stmt),
"unsafe function call %qE within "
"%<transaction_safe%> function", fn);
else
error_at (gimple_location (stmt),
"unsafe indirect function call within "
"%<transaction_safe%> function");
}
}
}
}
......
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