[Bug debug/94272] [8/9/10 Regression] -fcompare-debug failure (length) with -O -fnon-call-exceptions since r8-5241

jakub at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Mon Mar 23 12:39:52 GMT 2020


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?


More information about the Gcc-bugs mailing list