From c8c6145d0838c8a20ada42539f9123bfdc8ff51f Mon Sep 17 00:00:00 2001 From: David Malcolm Date: Thu, 25 Jun 2020 17:21:30 -0400 Subject: [PATCH 256/315] FIXME: favor RESULT_DECL over temporaries in readability --- gcc/analyzer/engine.cc | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/gcc/analyzer/engine.cc b/gcc/analyzer/engine.cc index 8c7983006a2..9b0092b7bbd 100644 --- a/gcc/analyzer/engine.cc +++ b/gcc/analyzer/engine.cc @@ -777,8 +777,19 @@ readability (const_tree expr) case PARM_DECL: case VAR_DECL: - /* Arbitrarily-chosen "high readability" value. */ - return 65536; + if (DECL_NAME (expr)) + /* Arbitrarily-chosen "high readability" value. */ + return 65536; + else + /* We don't want to print temporaries. For example, the C FE + prints them as e.g. "" where "xxxx" is the low 16 bits + of the tree pointer (see pp_c_tree_decl_identifier). */ + return -1; + + case RESULT_DECL: + /* Printing "" isn't ideal, but is less awful than + trying to print a temporary. */ + return 32768; default: return 0; -- 2.26.2