Index: tools/Makefile.gnuhost =================================================================== RCS file: /cvsroot/src/tools/Makefile.gnuhost,v retrieving revision 1.45 diff -u -r1.45 Makefile.gnuhost --- tools/Makefile.gnuhost 13 Apr 2018 06:15:26 -0000 1.45 +++ tools/Makefile.gnuhost 15 Apr 2018 21:44:50 -0000 @@ -20,11 +20,6 @@ # Disable use of pre-compiled headers on Darwin. # GCC build exceeds the macOS clang default bracket nesting level of 256. BUILD_OSTYPE!= uname -s -.if ${BUILD_OSTYPE} == "Darwin" -HOST_CFLAGS+=-O2 -no-cpp-precomp -HOST_CFLAGS+=-O2 -no-cpp-precomp -fbracket-depth=512 -HOST_CXXFLAGS+= -fbracket-depth=512 -.endif MAKE_PROGRAM?= ${MAKE} .for i in 3 2 Index: external/gpl3/gcc/dist/gcc/genattrtab.c =================================================================== RCS file: /cvsroot/src/external/gpl3/gcc/dist/gcc/genattrtab.c,v retrieving revision 1.1.1.4 diff -u -r1.1.1.4 genattrtab.c --- external/gpl3/gcc/dist/gcc/genattrtab.c 2 Feb 2018 01:59:20 -0000 1.1.1.4 +++ external/gpl3/gcc/dist/gcc/genattrtab.c 15 Apr 2018 21:44:51 -0000 @@ -3416,7 +3416,10 @@ /* Given a piece of RTX, print a C expression to test its truth value to OUTF. We use AND and IOR both for logical and bit-wise operations, so - interpret them as logical unless they are inside a comparison expression. */ + interpret them as logical unless they are inside a comparison expression. + + An outermost pair of parentheses is emitted around this C expression unless + EMIT_PARENS is false. */ /* Interpret AND/IOR as bit-wise operations instead of logical. */ #define FLG_BITWISE 1 @@ -3432,16 +3435,16 @@ #define FLG_OUTSIDE_AND 8 static unsigned int -write_test_expr (FILE *outf, rtx exp, unsigned int attrs_cached, int flags) +write_test_expr (FILE *outf, rtx exp, unsigned int attrs_cached, int flags, + bool emit_parens = true) { int comparison_operator = 0; RTX_CODE code; struct attr_desc *attr; - /* In order not to worry about operator precedence, surround our part of - the expression with parentheses. */ + if (emit_parens) + fprintf (outf, "("); - fprintf (outf, "("); code = GET_CODE (exp); switch (code) { @@ -3575,8 +3578,18 @@ || GET_CODE (XEXP (exp, 1)) == EQ_ATTR || (GET_CODE (XEXP (exp, 1)) == NOT && GET_CODE (XEXP (XEXP (exp, 1), 0)) == EQ_ATTR))) - attrs_cached - = write_test_expr (outf, XEXP (exp, 1), attrs_cached, flags); + { + bool need_parens = true; + + /* No need to emit parentheses around the right-hand operand if we are + continuing a chain of && or || (or & or |). */ + if (GET_CODE (XEXP (exp, 1)) == code) + need_parens = false; + + attrs_cached + = write_test_expr (outf, XEXP (exp, 1), attrs_cached, flags, + need_parens); + } else write_test_expr (outf, XEXP (exp, 1), attrs_cached, flags | comparison_operator); @@ -3794,7 +3807,9 @@ GET_RTX_NAME (code)); } - fprintf (outf, ")"); + if (emit_parens) + fprintf (outf, ")"); + return attrs_cached; }