https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119006

--- Comment #2 from Jeff Snyder <jeff-gcc at caffeinated dot me.uk> ---
Further simplified:

template<unsigned  N> struct FixedString {
    bool operator==(const char* rhs_) const { return rhs_ and not
__builtin_strcmp(_str, rhs_); }
    bool operator!=(const char* rhs_) const { return !(*this == rhs_); }
    char _str[N + 1];
};
int fixedString10User(const FixedString<10>& lhs, const char* rhs) {
    return lhs == rhs;
}
void checkString(FixedString<127> reason_) {
    if (reason_ != "StrOverTenChars") asm volatile("nop");
}
int main() {}


I also had to build with `-rdynamic` to repro without `checkString` being
omitted entirely. Observed on x86-64.

Reply via email to