https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94272
Jakub Jelinek <jakub at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |NEW Assignee|jakub at gcc dot gnu.org |unassigned at gcc dot gnu.org --- Comment #2 from Jakub Jelinek <jakub at gcc dot gnu.org> --- I'm afraid this is similar to the PR93786 and I don't have a good solution. This goes wrong during gimplification, we have: if (c != 0B && d != 0) { (void) 0; } else { # DEBUG BEGIN STMT; if (*e != 0) (void) 0; } When we call shortcut_cond_expr, the important difference is that without -g, TREE_SIDE_EFFECTS on else_ (which is in that case a COND_EXPR) is false, but with -g it is true (else_ is a STATEMENT_LIST with TREE_SIDE_EFFECTS set containing the DEBUG_BEGIN_STMT with TREE_SIDE_EFFECTS false and the COND_EXPR also with TREE_SIDE_EFFECTS clear. Alex?