aboutsummaryrefslogtreecommitdiff
path: root/gcc/trans-mem.c
diff options
context:
space:
mode:
authorAldy Hernandez <aldyh@redhat.com>2012-01-04 14:32:54 +0000
committerAldy Hernandez <aldyh@gcc.gnu.org>2012-01-04 14:32:54 +0000
commit3a54c4564436e79b70b8dd3b6651b7a2fbaea028 (patch)
treed76d4e9878a22fccb8ef2ffc332071f5ac6e5712 /gcc/trans-mem.c
parent17d038cd90a83ba09162aae38394c201a98d3a00 (diff)
downloadgcc-3a54c4564436e79b70b8dd3b6651b7a2fbaea028.zip
gcc-3a54c4564436e79b70b8dd3b6651b7a2fbaea028.tar.gz
gcc-3a54c4564436e79b70b8dd3b6651b7a2fbaea028.tar.bz2
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
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 c0a8b8c..750f3a1 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");
+ }
}
}
}