https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116156
Andrew Pinski <pinskia at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEW Last reconfirmed| |2024-07-31 Ever confirmed|0 |1 --- Comment #6 from Andrew Pinski <pinskia at gcc dot gnu.org> --- Confirmed. The first difference in the IR is in forwprop3: Removing dead stmt:x_density_8(ab) = x_density_17; is removed with -g while not removed without -g. In the case of it was used with: x_density_8(ab) = x_density_17; # DEBUG x_densityD.4428 => x_density_8(ab) I am 99% sure this was introduced by r14-3982-g9ea74d235c7e78 . I have not checked if it is a bug in simple_dce_from_worklist or this loop is missing a check to see if the statement was a debug statement and not do it: + /* Queue old uses for simple DCE. */ + for (tree use : uses) + if (TREE_CODE (use) == SSA_NAME + && !SSA_NAME_IS_DEFAULT_DEF (use)) + bitmap_set_bit (simple_dce_worklist, + SSA_NAME_VERSION (use));