https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83334
Bug ID: 83334
Summary: __builtin_ms_va_copy used in function with sysv_abi is
broken
Product: gcc
Version: 7.2.1
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: target
Assignee: unassigned at gcc dot gnu.org
Reporter: zenith432 at users dot sourceforge.net
Target Milestone: ---
Created attachment 42818
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=42818&action=edit
sample1.c and sample2.c in zip file
gcc -v
=======
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-redhat-linux/7/lto-wrapper
OFFLOAD_TARGET_NAMES=nvptx-none
OFFLOAD_TARGET_DEFAULT=1
Target: x86_64-redhat-linux
Configured with: ../configure --enable-bootstrap
--enable-languages=c,c++,objc,obj-c++,fortran,ada,go,lto --prefix=/usr
--mandir=/usr/share/man --infodir=/usr/share/info
--with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-shared
--enable-threads=posix --enable-checking=release --enable-multilib
--with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions
--enable-gnu-unique-object --enable-linker-build-id
--with-gcc-major-version-only --with-linker-hash-style=gnu --enable-plugin
--enable-initfini-array --with-isl --enable-libmpx
--enable-offload-targets=nvptx-none --without-cuda-driver
--enable-gnu-indirect-function --with-tune=generic --with-arch_32=i686
--build=x86_64-redhat-linux
Thread model: posix
gcc version 7.2.1 20170915 (Red Hat 7.2.1-2) (GCC)
=========
Attached are sample source files sample1.c, sample2.c. The only difference is
that funcb is ms_abi in sample2.c and sysv_abi in sample1.c
gcc -o sample1 sample1.c
gcc -o sample2 sample2.c
./sample2
6
./sample1
Segmentation fault (core dumped)