I pushed for noble and resolute, not sure if fixing plucky and questing is worth the effort
** Summary changed: - Noble/1.83: compile error re: undefined behavior (fix available) + [SRU] Noble/1.83: compile error re: undefined behavior (fix available) ** Description changed: - https://github.com/boostorg/multiprecision/issues/733 + [ Impact ] + * Can't compile some multiprecision based applications with strict g++ compiler flags Using a specific simple Boost feature yields a compile error re: undefined behavior. See the GitHub bug for full details and a simple patch that solves the issue. Is it possible to rebuild the Ubuntu package so that applications can be compiled on Noble? Thanks. + + [ Test Plan ] + + #include <boost/multiprecision/cpp_int.hpp> + + using BigInt = boost::multiprecision::cpp_int; + + BigInt calcm(unsigned ls) { + return BigInt(1) << ls; + } + + https://github.com/boostorg/multiprecision/issues/733 + + g++ -O0 -fdiagnostics-color=always -Wall -Wextra -Wno-overloaded-virtual \ + -Wno-deprecated -Wno-deprecated-declarations -pedantic -O3 -DNDEBUG \ + -Wall -Wextra -Wno-overloaded-virtual -Wno-deprecated \ + -Wno-deprecated-declarations -pedantic -Werror -Wall -Wextra -Wswitch-enum \ + -std=gnu++20 \ + -c -o repro repro.cpp + + + failing build: + + inlined from 'BigInt calcm(size_t, size_t)' at repro.cpp:46:24, + inlined from 'void f(S*, S*)' at repro.cpp:51:36: + /usr/include/boost/multiprecision/cpp_int/bitwise.hpp:441:26: error: iteration 2305843009213693951 invokes undefined behavior [-Werror=aggressive-loop-optimizations] + 441 | pr[rs - 1 - i] = pr[rs - 1 - i - offset] << shift; + | ~~^ + /usr/include/boost/multiprecision/cpp_int/bitwise.hpp:439:18: note: within this loop + 439 | for (; rs - i >= 2 + offset; ++i) + | ~~~~~~~^~~~~~~~~~~~~ + + + working build: + g++ -O0 -fdiagnostics-color=always -Wall -Wextra -Wno-overloaded-virtual -Wno-deprecated -Wno-deprecated-declarations -pedantic -O3 -DNDEBUG -Wall -Wextra -Wno-overloaded-virtual -Wno-deprecated -Wno-deprecated-declarations -pedantic -Werror -Wall -Wextra -Wswitch-enum -std=gnu++20 -c -o repro test2.cpp + locutus@Unimatrix13-Noble:~/branches $ echo $? + 0 + + [ Other Info ] + * This is a cherry-pick of a minimal upstream change, already part of noble+ releases ** Also affects: boost1.83 (Ubuntu Resolute) Importance: Low Status: Triaged ** Also affects: boost1.83 (Ubuntu Questing) Importance: Undecided Status: New ** Also affects: boost1.83 (Ubuntu Plucky) Importance: Undecided Status: New ** Changed in: boost1.83 (Ubuntu Noble) Status: New => In Progress ** Changed in: boost1.83 (Ubuntu Resolute) Status: Triaged => Fix Committed ** Changed in: boost1.83 (Ubuntu Plucky) Status: New => In Progress ** Changed in: boost1.83 (Ubuntu Questing) Status: New => In Progress -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/2122352 Title: [SRU] Noble/1.83: compile error re: undefined behavior (fix available) To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/boost1.83/+bug/2122352/+subscriptions -- ubuntu-bugs mailing list [email protected] https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
