https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104120
Richard Biener <rguenth at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Version|unknown |11.2.1 CC| |aoliva at gcc dot gnu.org Target Milestone|--- |10.4 --- Comment #4 from Richard Biener <rguenth at gcc dot gnu.org> --- With -fno-checking the profile is quite flat but we fully unroll the loops at -O1, duplicating the debug stmts while with -O2+ CD-DCE simply kills them off. I suppose -O1 lacks simple empty loop removal capability here. On a related note we miss removal of consecutive debug stmts that do not add any information - we end up with <bb 2> [local count: 975816]: [t.c:2:3] # DEBUG BEGIN_STMT [t.c:3:3] # DEBUG BEGIN_STMT # DEBUG i => 0 [t.c:3:17] # DEBUG BEGIN_STMT # DEBUG i => 0 # DEBUG j => 0 [t.c:4:19] # DEBUG BEGIN_STMT # DEBUG j => 0 # DEBUG k => 0 [t.c:5:21] # DEBUG BEGIN_STMT [t.c:6:13] # DEBUG sum => NULL # DEBUG k => 0 [t.c:6:9] # DEBUG BEGIN_STMT [t.c:6:13] # DEBUG sum => 1 [t.c:5:28] # DEBUG BEGIN_STMT # DEBUG k => 1 [t.c:5:21] # DEBUG BEGIN_STMT [t.c:6:13] # DEBUG sum => NULL # DEBUG k => 1 [t.c:6:9] # DEBUG BEGIN_STMT [t.c:6:13] # DEBUG sum => 1 [t.c:5:28] # DEBUG BEGIN_STMT # DEBUG k => 2 [t.c:5:21] # DEBUG BEGIN_STMT [t.c:6:13] # DEBUG sum => NULL ... I suppose with views we could indeed step through all (non-existant) stmts but then this support never materialized ...