[committed] analyzer: fix nondeterminism in logs

Message ID 20221124015221.3367288-1-dmalcolm@redhat.com
State New
Headers
Series [committed] analyzer: fix nondeterminism in logs |

Commit Message

David Malcolm Nov. 24, 2022, 1:52 a.m. UTC
  Successfully bootstrapped & regrtested on x86_64-pc-linux-gnu.
Pushed to trunk as r13-4275-ge0f18b87bfaf0b.

gcc/analyzer/ChangeLog:
	* checker-path.cc (checker_path::inject_any_inlined_call_events):
	Don't dump the address of the block when -fdump-noaddr.

Signed-off-by: David Malcolm <dmalcolm@redhat.com>
---
 gcc/analyzer/checker-path.cc | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
  

Patch

diff --git a/gcc/analyzer/checker-path.cc b/gcc/analyzer/checker-path.cc
index cbe24a2058a..221042ee010 100644
--- a/gcc/analyzer/checker-path.cc
+++ b/gcc/analyzer/checker-path.cc
@@ -273,8 +273,10 @@  checker_path::inject_any_inlined_call_events (logger *logger)
 	       !iter.done_p (); iter.next ())
 	    {
 	      logger->start_log_line ();
-	      logger->log_partial ("  %qE (%p), fndecl: %qE, callsite: 0x%x",
-				   iter.get_block (), iter.get_block (),
+	      logger->log_partial ("  %qE", iter.get_block ());
+	      if (!flag_dump_noaddr)
+		logger->log_partial (" (%p)", iter.get_block ());
+	      logger->log_partial (", fndecl: %qE, callsite: 0x%x",
 				   iter.get_fndecl (), iter.get_callsite ());
 	      if (iter.get_callsite ())
 		dump_location (logger->get_printer (), iter.get_callsite ());