Starting with the merge of the openmp branch into the trunk (r0-73077-g953ff28998b59b), COMPOUND_EXPR started to be printed as `expr; , expr` which is wrong. This was due to the wrong conversion of dumping_stmts into `!(flags & TDF_SLIM)`. That is wrong as we are not dumping stmts at this point (`!(flags & TDF_SLIM)` was always true for this case as TDF_SLIM case was handled before hand). So switch it to be always false.
Bootstrapped and tested on x86_64-linux-gnu with no regressions. gcc/ChangeLog: PR middle-end/23872 * tree-pretty-print.cc (dump_generic_node <case COMPOUND_EXPR>): Fix calls to dump_generic_node and also remove unreachable code that is testing `flags & TDF_SLIM`. gcc/testsuite/ChangeLog: * gfortran.dg/gomp/atomic-21.f90: Update testcase for the removal of `;`. Signed-off-by: Andrew Pinski <quic_apin...@quicinc.com> --- gcc/testsuite/gfortran.dg/gomp/atomic-21.f90 | 4 ++-- gcc/tree-pretty-print.cc | 24 ++++++-------------- 2 files changed, 9 insertions(+), 19 deletions(-) diff --git a/gcc/testsuite/gfortran.dg/gomp/atomic-21.f90 b/gcc/testsuite/gfortran.dg/gomp/atomic-21.f90 index febcdbbacfb..35099294d7a 100644 --- a/gcc/testsuite/gfortran.dg/gomp/atomic-21.f90 +++ b/gcc/testsuite/gfortran.dg/gomp/atomic-21.f90 @@ -56,7 +56,7 @@ subroutine foobar() endif ! TARGET_EXPR <D.4244, 0> = #pragma omp atomic capture acq_rel -! TARGET_EXPR <D.4242, &nn> = NON_LVALUE_EXPR <TARGET_EXPR <D.4243, 0> = *TARGET_EXPR <D.4242, &nn> == oo> ? pp : *TARGET_EXPR <D.4242, &nn>;, if (TARGET_EXPR <D.4243, 0>) +! TARGET_EXPR <D.4242, &nn> = NON_LVALUE_EXPR <TARGET_EXPR <D.4243, 0> = *TARGET_EXPR <D.4242, &nn> == oo> ? pp : *TARGET_EXPR <D.4242, &nn>, if (TARGET_EXPR <D.4243, 0>) ! { ! <<< Unknown tree: void_cst >>> ! } @@ -66,7 +66,7 @@ subroutine foobar() ! }; ! ! { dg-final { scan-tree-dump-times "TARGET_EXPR <D.\[0-9\]+, 0> = #pragma omp atomic capture acq_rel" 1 "original" } } -! { dg-final { scan-tree-dump-times "TARGET_EXPR <D.\[0-9\]+, &nn> = NON_LVALUE_EXPR <TARGET_EXPR <D.\[0-9\]+, 0> = \\*TARGET_EXPR <D.\[0-9\]+, &nn> == oo> \\? pp : \\*TARGET_EXPR <D.\[0-9\]+, &nn>;, if \\(TARGET_EXPR <D.\[0-9\]+, 0>\\)" 1 "original" } } +! { dg-final { scan-tree-dump-times "TARGET_EXPR <D.\[0-9\]+, &nn> = NON_LVALUE_EXPR <TARGET_EXPR <D.\[0-9\]+, 0> = \\*TARGET_EXPR <D.\[0-9\]+, &nn> == oo> \\? pp : \\*TARGET_EXPR <D.\[0-9\]+, &nn>, if \\(TARGET_EXPR <D.\[0-9\]+, 0>\\)" 1 "original" } } ! { dg-final { scan-tree-dump-times "<<< Unknown tree: void_cst >>>" 1 "original" } } ! { dg-final { scan-tree-dump-times "qq = TARGET_EXPR <D.\[0-9\]+, 0>;" 1 "original" } } diff --git a/gcc/tree-pretty-print.cc b/gcc/tree-pretty-print.cc index c935a7da7d1..f9ad8562078 100644 --- a/gcc/tree-pretty-print.cc +++ b/gcc/tree-pretty-print.cc @@ -2856,31 +2856,21 @@ dump_generic_node (pretty_printer *pp, tree node, int spc, dump_flags_t flags, } dump_generic_node (pp, TREE_OPERAND (node, 0), - spc, flags, !(flags & TDF_SLIM)); - if (flags & TDF_SLIM) - newline_and_indent (pp, spc); - else - { - pp_comma (pp); - pp_space (pp); - } + spc, flags, false); + pp_comma (pp); + pp_space (pp); for (tp = &TREE_OPERAND (node, 1); TREE_CODE (*tp) == COMPOUND_EXPR; tp = &TREE_OPERAND (*tp, 1)) { dump_generic_node (pp, TREE_OPERAND (*tp, 0), - spc, flags, !(flags & TDF_SLIM)); - if (flags & TDF_SLIM) - newline_and_indent (pp, spc); - else - { - pp_comma (pp); - pp_space (pp); - } + spc, flags, false); + pp_comma (pp); + pp_space (pp); } - dump_generic_node (pp, *tp, spc, flags, !(flags & TDF_SLIM)); + dump_generic_node (pp, *tp, spc, flags, false); } break; -- 2.43.0