From: Segher Boessenkool Date: Tue, 15 Oct 2019 23:47:47 +0000 (+0200) Subject: genattrtab: Parenthesize expressions correctly (PR92107) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=f93701433432f27896183f57b82e9d2b22998c0f;p=gcc.git genattrtab: Parenthesize expressions correctly (PR92107) As PR92107 shows, genattrtab doesn't parenthesize expressions correctly (or at all, even). This fixes it. PR rtl-optimization/92107 * genattrtab.c (write_attr_value) : Parenthesize the expression written. From-SVN: r277023 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 2320abc0dd2..175ecd9224f 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2019-10-15 Segher Boessenkool + + PR rtl-optimization/92107 + * genattrtab.c (write_attr_value) : Parenthesize the + expression written. + 2019-10-15 Iain Sandoe * config/darwin.c: Update description of fix and continue. diff --git a/gcc/genattrtab.c b/gcc/genattrtab.c index cdf0b5c12dc..2fd8593d90a 100644 --- a/gcc/genattrtab.c +++ b/gcc/genattrtab.c @@ -4425,11 +4425,11 @@ write_attr_value (FILE *outf, class attr_desc *attr, rtx value) goto do_operator; do_operator: + fprintf (outf, "("); write_attr_value (outf, attr, XEXP (value, 0)); - fputc (' ', outf); - fputc (op, outf); - fputc (' ', outf); + fprintf (outf, " %c ", op); write_attr_value (outf, attr, XEXP (value, 1)); + fprintf (outf, ")"); break; case IF_THEN_ELSE: