From 3a54c4564436e79b70b8dd3b6651b7a2fbaea028 Mon Sep 17 00:00:00 2001 From: Aldy Hernandez Date: Wed, 4 Jan 2012 14:32:54 +0000 Subject: 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 --- gcc/trans-mem.c | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) (limited to 'gcc/trans-mem.c') 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 " "% function", fn); else - error_at (gimple_location (stmt), - "unsafe function call %qE within " - "% function", fn); + { + if (!DECL_P (fn) || DECL_NAME (fn)) + error_at (gimple_location (stmt), + "unsafe function call %qE within " + "% function", fn); + else + error_at (gimple_location (stmt), + "unsafe indirect function call within " + "% function"); + } } } } -- cgit v1.1