Re: [PATCH] Fix COND_EXPR folding with CASE_LABEL_EXPRs (PR c++/83553)

2017-12-23 Thread Richard Biener
On December 23, 2017 9:33:03 AM GMT+01:00, Jakub Jelinek wrote: >Hi! > >The problem here is that for loops that have constant 0/false condition >the C++ FE wants to correctly emit if (0) { body; incr-expr; } >but doesn't just build3 (COND_EXPR, ...), but fold_build3, and >COND_EXPR >folding with

[PATCH] Fix COND_EXPR folding with CASE_LABEL_EXPRs (PR c++/83553)

2017-12-23 Thread Jakub Jelinek
Hi! The problem here is that for loops that have constant 0/false condition the C++ FE wants to correctly emit if (0) { body; incr-expr; } but doesn't just build3 (COND_EXPR, ...), but fold_build3, and COND_EXPR folding with constant condition optimizes away the unused branch completely if it does