summaryrefslogtreecommitdiff
path: root/gcc/trans-mem.c
diff options
context:
space:
mode:
authoraldyh <aldyh@138bc75d-0d04-0410-961f-82ee72b054a4>2012-01-04 14:32:54 +0000
committeraldyh <aldyh@138bc75d-0d04-0410-961f-82ee72b054a4>2012-01-04 14:32:54 +0000
commit300eddbaf63d9c1e15e4d65948363826b8bf04a0 (patch)
treed76d4e9878a22fccb8ef2ffc332071f5ac6e5712 /gcc/trans-mem.c
parent4fd5163b8c4c4f51555f8e37e8db015a7b1005d0 (diff)
downloadgcc-300eddbaf63d9c1e15e4d65948363826b8bf04a0.tar.gz
PR middle-end/51696
* trans-mem.c (diagnose_tm_1): Display indirect calls with no name correctly. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@182876 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/trans-mem.c')
-rw-r--r--gcc/trans-mem.c26
1 files changed, 20 insertions, 6 deletions
diff --git a/gcc/trans-mem.c b/gcc/trans-mem.c
index c0a8b8c8ac4..750f3a18624 100644
--- a/gcc/trans-mem.c
+++ b/gcc/trans-mem.c
@@ -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");
+ }
}
}
}