https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77813
Bug ID: 77813 Summary: __TMC_END__ - __TMC_LIST__ == 0 Product: gcc Version: 7.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: libgcc Assignee: unassigned at gcc dot gnu.org Reporter: glisse at gcc dot gnu.org Target Milestone: --- Target: powerpc64le-unknown-linux-gnu In crtstuff.c, function deregister_tm_clones contains this code: if (__TMC_END__ - __TMC_LIST__ == 0) this currently gives, in the original dump if (((unsigned long) &__TMC_END__ + 7) - (unsigned long) &__TMC_LIST__ <= 14) I was testing an optimization that allows us to get instead if ((long int) &__TMC_END__ == (long int) &__TMC_LIST__) During forwprop, the match.pd pattern (cmp (convert1?@2 addr@0) (convert2? addr@1)) applies and we fold this to 0. In the libitm testsuite, most runtime tests then segfault. It seems that either the optimization to compare addresses is too eager, or the code in crtstuff.c doesn't mark the variables appropriately...