[Bug middle-end/118758] [15 regression] ok code with -O2, but wrong code with -O3
sjames at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Wed Feb 5 17:31:23 GMT 2025
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118758
Sam James <sjames at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |sjames at gcc dot gnu.org
--- Comment #4 from Sam James <sjames at gcc dot gnu.org> ---
In case it's useful for you David, what I do (in addition to the script I gave
you before), is something like:
# Figure out where the first difference is
$ diff -u <(gcc-14 test.c -o test -O3 && ./test 1) <(gcc-15 test.c -o test2 -O3
&& ./test2 1)
# Patch in an abort on that first difference to allow cvise to kill as much as
possible
```
--- a/pr118758.c
+++ b/pr118758.c
@@ -3967,6 +3967,9 @@
transparent_crc (uint64_t val, char* vname, int flag)
{
crc32_8bytes(val);
+ if (strcmp(vname, "g_96") == 0 && (crc32_context ^ 0xFFFFFFFFUL) !=
0xAC52A137)
+ __builtin_abort();
+
if (flag) {
printf("...checksum after hashing %s : %lX\n", vname, crc32_context ^
0xFFFFFFFFUL);
}
```
then cvise with a bunch of sanitizer + warning checks and so on to make sure it
only dies with 15 and not 14.
More information about the Gcc-bugs
mailing list