Description of problem: Looks like gcc 12 miscompiles a test from the orc project on aarch64. This happens with the default -O2 in the project, after switching to -O1 or -O0 (eg. via CFLAGS=-O1 meson ..) all tests are passing. Also it should be a regression from F-35/GCC 11 where the tests were passing with the default flags. I have identified the problematic source file to be build/testsuite/orcc/orc_test.c which generated during the build. Keeping everything else as is, but adding #pragma GCC optimize("O1") on top of the file makes the tests pass again. The problem is that this file is 18k lines with 10k in main(). Interestingly switching back to -O2 via a #pragma somewhere in the "middle" (line ~5498) keeps the tests passing, moving the #pragma to the top (up 1 function) it fails again. Seems it is required to use the ninja command (ninja -v test) to recompiled the modified orc_test.c and re-run the tests, probably due some environment setup (paths, ...). I haven't looked at the details yet. Version-Release number of selected component (if applicable): gcc-12.2.1-2.fc36.aarch64 How reproducible: 100% Steps to Reproduce: 1. git clone https://gitlab.freedesktop.org/gstreamer/orc 2. cd orc; mkdir build; cd build 3. meson .. 4. ninja -v all 5. ninja -v test Actual results: ... orc_composite_over_n_8888_8888_ca_2d: backup function : PASSED compiled function: PASSED cogorc_resample_horiz_1tap: backup function : PASSED compiled function: COMPILE FAILED cogorc_resample_horiz_2tap: backup function : PASSED compiled function: COMPILE FAILED test_float_constant_1: backup function : PASSED compiled function: PASSED ... Summary of Failures: 12/13 orc_test FAIL 0.27s exit status 1 Ok: 12 Expected Fail: 0 Fail: 1 Unexpected Pass: 0 Skipped: 0 Timeout: 0 Expected results: all tests pass
Created attachment 1922804 [details] preprocessed source command line is cc -Itestsuite/orcc/orc_test.p -Itestsuite/orcc -I../testsuite/orcc -I. -I.. -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -O2 -g -DHAVE_CONFIG_H -fvisibility=hidden -pthread -MD -MQ testsuite/orcc/orc_test.p/meson-generated_.._orc_test.c.o -MF testsuite/orcc/orc_test.p/meson-generated_.._orc_test.c.o.d -o testsuite/orcc/orc_test.p/meson-generated_.._orc_test.c.o -c testsuite/orcc/orc_test.c
building with CFLAGS=-fsanitize=undefined gives the message bellow, but the tests pass ... [3/119] cc -Iorc/liborc-0.4.so.0.33.0.p -Iorc -I../orc -I. -I.. -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -O2 -g -DHAVE_CONFIG_H -fvisibility=hidden -fsanitize=undefined -fPIC -pthread -DORC_ENABLE_UNSTABLE_API -D_GNU_SOURCE -DBUILDING_ORC -MD -MQ orc/liborc-0.4.so.0.33.0.p/orccodemem.c.o -MF orc/liborc-0.4.so.0.33.0.p/orccodemem.c.o.d -o orc/liborc-0.4.so.0.33.0.p/orccodemem.c.o -c ../orc/orccodemem.c ../orc/orccodemem.c: In function ‘orc_code_region_allocate_codemem_dual_map.constprop’: ../orc/orccodemem.c:222:3: warning: null destination pointer [-Wformat-overflow=] 222 | sprintf(filename, "%s/orcexec.XXXXXX", dir); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Sorry for the delay, bisected to https://gcc.gnu.org/r12-4240 which enabled -ftree-vectorize by default at -O2. The failure reproduces even with latest GCC trunk at -O2, doesn't reproduce with -O2 -fno-tree-vectorize. r11-1 (i.e. GCC 11 branchpoint) doesn't reproduce it with -O2 -ftree-vectorize though, so I'll bisect where it started.
With -O2 -ftree-vectorize bisected to https://gcc.gnu.org/r11-5160 , will continue tomorrow.
This message is a reminder that Fedora Linux 36 is nearing its end of life. Fedora will stop maintaining and issuing updates for Fedora Linux 36 on 2023-05-16. It is Fedora's policy to close all bug reports from releases that are no longer maintained. At that time this bug will be closed as EOL if it remains open with a 'version' of '36'. Package Maintainer: If you wish for this bug to remain open because you plan to fix it in a currently maintained version, change the 'version' to a later Fedora Linux version. Note that the version field may be hidden. Click the "Show advanced fields" button if you do not see it. Thank you for reporting this issue and we are sorry that we were not able to fix it before Fedora Linux 36 is end of life. If you would still like to see this bug fixed and are able to reproduce it against a later version of Fedora Linux, you are encouraged to change the 'version' to a later version prior to this bug being closed.
Fedora Linux 36 entered end-of-life (EOL) status on 2023-05-16. Fedora Linux 36 is no longer maintained, which means that it will not receive any further security or bug fix updates. As a result we are closing this bug. If you can reproduce this bug against a currently maintained version of Fedora Linux please feel free to reopen this bug against that version. Note that the version field may be hidden. Click the "Show advanced fields" button if you do not see the version field. If you are unable to reopen this bug, please file a new report against an active release. Thank you for reporting this bug and we are sorry it could not be fixed.