https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83505
Martin Liška <marxin at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEW Last reconfirmed| |2017-12-20 CC| |mpolacek at gcc dot gnu.org Assignee|unassigned at gcc dot gnu.org |marxin at gcc dot gnu.org Ever confirmed|0 |1 --- Comment #2 from Martin Liška <marxin at gcc dot gnu.org> --- Confirmed. There are some interesting observations I've just done: G++ FE optimizes out 'if (1)' condition, while C keeps it: C: { int t = 1; int * p = &t; int t = 1; int * p = &t; if (1) { if (0) { return 0; } return 1; } } return 0; t = {CLOBBER}; t = {CLOBBER}; C++: { int t = 1; int * p = &t; <<cleanup_point int t = 1;>>; int * p = &t; if (0) { return <retval> = 0; } return <retval> = 1; } return <retval> = 0; Which leads to different EH tree creation. In C, we have ndests == 2, thus we copy BB with clobber of t: t = {CLOBBER}; Then later on, one of these blocks is removed and the one with location set to 'return 0' wins. That leads me to question whether we should emit location of clobbers to gcno files. I have to think about it more. Marek is the described FE behavior expected? Anyway, thanks for the report.