Hi,

this patch fixes the classification of the chars '{}<> ' in pp_write_text_as_dot_label_to_stream. They're currently marked as always-escape, but that's incorrect, they should be marked as escape-for-record.

Bootstrapped and reg-tested on x86_64.

Will commit to stage1 trunk as trivial.

Thanks,
- Tom
Fix record-shape escapes in pp_write_text_as_dot_label_to_stream

2016-04-04  Tom de Vries  <t...@codesourcery.com>

	* pretty-print.c (pp_write_text_as_dot_label_to_stream): Classify chars
	'{}<> ' as escape-for-record.

---
 gcc/pretty-print.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/gcc/pretty-print.c b/gcc/pretty-print.c
index f6e4b43..c3a90a7 100644
--- a/gcc/pretty-print.c
+++ b/gcc/pretty-print.c
@@ -170,19 +170,19 @@ pp_write_text_as_dot_label_to_stream (pretty_printer *pp, bool for_record)
 	  escape_char = true;
 	  break;
 
-	/* A pipe is only special for record-shape nodes.  */
+	/* The following characters are only special for record-shape nodes.  */
 	case '|':
+	case '{':
+	case '}':
+	case '<':
+	case '>':
+	case ' ':
 	  escape_char = for_record;
 	  break;
 
 	/* The following characters always have to be escaped
 	   for use in labels.  */
-	case '{':
-	case '}':
-	case '<':
-	case '>':
 	case '"':
-	case ' ':
 	  escape_char = true;
 	  break;
 

Reply via email to