https://gcc.gnu.org/bugzilla/show_bug.cgi?id=124318
Bug ID: 124318
Summary: [16 Regression] nvptx vs. "ipa-devirt: Add speculative
direct calls based on stores to structures"
Product: gcc
Version: 16.0
Status: UNCONFIRMED
Keywords: testsuite-fail, wrong-code
Severity: normal
Priority: P3
Component: target
Assignee: tschwinge at gcc dot gnu.org
Reporter: tschwinge at gcc dot gnu.org
CC: jamborm at gcc dot gnu.org
Target Milestone: ---
Target: nvptx
For '--target=nvptx-none', I've "recently" observed a nontrivial amount of
GCC/Fortran test case regressions, all looking like:
ptxas /tmp/ccrx9EVs.o, line 1977; error : Call has wrong number of
parameters
ptxas /tmp/ccrx9EVs.o, line 3052; error : Call has wrong number of
parameters
ptxas fatal : Ptx assembly aborted due to errors
nvptx-as: ptxas returned 255 exit status
..., meaning that there are mismatching declarations/definitions of functions,
which I've bisected to commit
r16-6150-g7b3af2bfa1dee9a3e90de4d1c4bc03d73f825898 "ipa-devirt: Add speculative
direct calls based on stores to structures" synthesizing, for example, a 'call
__m1_MOD___final_m1_T,(%out_arg1,%out_arg2,%out_arg3);' for a '.visible .func
(.param .u32 %value_out) __m1_MOD___final_m1_T (.param .u64 %in_ar0, .param
.u64 %in_ar1, .param .u32 %in_ar2);'. This 'call' is missing to specify the
'.u32' return value, which indeed is unused in this case, but we still need to
properly emit it for PTX conformance. The issue goes away with
'-fno-speculatively-call-stored-functions'. I suspect that somewhere some DECL
is not being handled as it should be, but I'm still working on tracking down
whether it's the GCC/Fortran front end and/or
'-fspeculatively-call-stored-functions' and/or the GCC/nvptx back end doing
"something funny".