https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97160
Bug ID: 97160 Summary: Regression from GCC 8 optimizing to sincos on ppc64le Product: gcc Version: 10.2.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: target Assignee: unassigned at gcc dot gnu.org Reporter: fx at gnu dot org Target Milestone: --- Target: ppc64le Created attachment 49254 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=49254&action=edit Fortran benchmark I looked at the other case in a Fortran benchmark set where GCC does badly on ppc64le with GCC 10. The problem seems to be in the middle end, though, not Fortran. This case is heavy on trig functions, and I found that gfortran 10 and 9 miss the optimization of converting sin+cos to sincos which is done by 8 on ppc64le and also by 10 on x86_64. I tried a simple example rather than the whole thing, but couldn't quickly reproduce the effect out of context, so it may be rather specific to this case. I'll attach the original 1400-line single routine (!) but I could take quick suggestions to narrow down the issue. With gfortran 10.2 (and similarly with 9) on RHEL7 POWER9 the top of the perf profile resulting from "gfortran -Ofast" is 43.60% mp_prop_design libm-2.17.so [.] __cos 28.85% mp_prop_design mp_prop_design [.] MAIN__ 24.40% mp_prop_design libm-2.17.so [.] __sin 1.04% mp_prop_design libm-2.17.so [.] __sincos With gfortran 8 (from "advanced toolkit 12") it's 78.49% a.out mp_prop_design [.] MAIN__ 20.29% a.out libm-2.28.so [.] __sincos 1.14% a.out libm-2.28.so [.] __tan (Those look as if they're from different systems because AT 12 picks up its own glibc when you set up the environment.)