https://gcc.gnu.org/bugzilla/show_bug.cgi?id=124213
Bug ID: 124213
Summary: gcc.dg/ipa/ipa-icf-38.c fails scan-wpa-ipa-dump and
scan-ltrans-tree-dump-not tests
Product: gcc
Version: 15.2.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: other
Assignee: unassigned at gcc dot gnu.org
Reporter: azoff at gcc dot gnu.org
Target Milestone: ---
The test gcc.dg/ipa/ipa-icf-38.c fails for multiple arm-none-eabi targets when
-mfpu=auto is used.
For -mfloat-abi=soft targets, the tests pass if -mfpu=auto is removed.
For -mfloat-abi=hard targets, the tests pass if -mfpu=auto is replaced with the
actual FPU for the target (i.e. manually expanding to the same FPU that auto
should have selected).
Example failure with -mfloat-abi=soft:
Testing ipa/ipa-icf-38.c
doing compile
Executing on host: /build/r16-7367-g7b2e9d01d325f0/bin/arm-none-eabi-gcc
/build/gcc_src/gcc/testsuite/gcc.dg/ipa/ipa-icf-38.c -mthumb -march=armv6s-m
-mtune=cortex-m0 -mfloat-abi=soft -mfpu=auto -dumpbase ""
-fdiagnostics-plain-output -O2 -fdump-ipa-icf-optimized -flto
-fdump-tree-optimized -fno-ipa-vrp -flto-partition=one
/build/gcc_src/gcc/testsuite/gcc.dg/ipa/ipa-icf-38a.c -dumpbase ""
--specs=rdimon.specs -o ipa-icf-38.exe (timeout = 800)
spawn -ignore SIGHUP /build/r16-7367-g7b2e9d01d325f0/bin/arm-none-eabi-gcc
/build/gcc_src/gcc/testsuite/gcc.dg/ipa/ipa-icf-38.c -mthumb -march=armv6s-m
-mtune=cortex-m0 -mfloat-abi=soft -mfpu=auto -dumpbase
-fdiagnostics-plain-output -O2 -fdump-ipa-icf-optimized -flto
-fdump-tree-optimized -fno-ipa-vrp -flto-partition=one
/build/gcc_src/gcc/testsuite/gcc.dg/ipa/ipa-icf-38a.c -dumpbase
--specs=rdimon.specs -o ipa-icf-38.exe
pid is 13289 -13289
pid is -1
output is status 0
PASS: gcc.dg/ipa/ipa-icf-38.c (test for excess errors)
FAIL: gcc.dg/ipa/ipa-icf-38.c scan-wpa-ipa-dump icf "Semantic equality
hit:foo/[0-9+]+->bar/[0-9+]+"
FAIL: gcc.dg/ipa/ipa-icf-38.c scan-wpa-ipa-dump icf "Equal symbols: 1"
PASS: gcc.dg/ipa/ipa-icf-38.c scan-ltrans-tree-dump optimized "Function foo"
FAIL: gcc.dg/ipa/ipa-icf-38.c scan-ltrans-tree-dump-not optimized "Function
bar"
Example failure with -mfloat-abi=hard:
Testing ipa/ipa-icf-38.c
doing compile
Executing on host: /build/r16-7367-g7b2e9d01d325f0/bin/arm-none-eabi-gcc
/build/gcc_src/gcc/testsuite/gcc.dg/ipa/ipa-icf-38.c -mthumb
-march=armv7e-m+fp -mtune=cortex-m4 -mfloat-abi=hard -mfpu=auto -dumpbase ""
-fdiagnostics-plain-output -O2 -fdump-ipa-icf-optimized -flto
-fdump-tree-optimized -fno-ipa-vrp -flto-partition=one
/build/gcc_src/gcc/testsuite/gcc.dg/ipa/ipa-icf-38a.c -dumpbase ""
--specs=rdimon.specs -o ipa-icf-38.exe (timeout = 800)
spawn -ignore SIGHUP /build/r16-7367-g7b2e9d01d325f0/bin/arm-none-eabi-gcc
/build/gcc_src/gcc/testsuite/gcc.dg/ipa/ipa-icf-38.c -mthumb -march=armv7e-m+fp
-mtune=cortex-m4 -mfloat-abi=hard -mfpu=auto -dumpbase
-fdiagnostics-plain-output -O2 -fdump-ipa-icf-optimized -flto
-fdump-tree-optimized -fno-ipa-vrp -flto-partition=one
/build/gcc_src/gcc/testsuite/gcc.dg/ipa/ipa-icf-38a.c -dumpbase
--specs=rdimon.specs -o ipa-icf-38.exe
pid is 22246 -22246
pid is -1
output is status 0
PASS: gcc.dg/ipa/ipa-icf-38.c (test for excess errors)
FAIL: gcc.dg/ipa/ipa-icf-38.c scan-wpa-ipa-dump icf "Semantic equality
hit:foo/[0-9+]+->bar/[0-9+]+"
FAIL: gcc.dg/ipa/ipa-icf-38.c scan-wpa-ipa-dump icf "Equal symbols: 1"
PASS: gcc.dg/ipa/ipa-icf-38.c scan-ltrans-tree-dump optimized "Function foo"
FAIL: gcc.dg/ipa/ipa-icf-38.c scan-ltrans-tree-dump-not optimized "Function
bar"
All versions of GCC that I've tried appears to have this issue, so I assume
that the issue has been here for a long time.
I don't know if this is limited to arm-none-eabi or a wider issue with the
-mfpu=auto option, so I used component "other".