From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id EB1D33858C53; Thu, 9 Feb 2023 03:53:30 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org EB1D33858C53 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1675914810; bh=cREAG9iGb7tSsfq2lp62YlMIN9C0CafsK1bf45Y7bGQ=; h=From:To:Subject:Date:From; b=owq8t5aYtXJErMEN+Vs2q14MKeCMFxkscLcTKXPVphfWvIh3d0lg7+5d0aWk52+lb aLNyqvkEqzRD/kiI+BHow/8LahbPS1PcHJjTG8yNeR43W1637nvUJ61u9a3Gnbq7pP HDob5BIbQUlmnzOmTqMH4EvyJQD6IJc1yEOQgxn0= From: "rmclure at linux dot ibm.com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c/108734] New: powerpc: False Detection of __atomic_*_8 Builtins Date: Thu, 09 Feb 2023 03:53:29 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c X-Bugzilla-Version: 11.3.0 X-Bugzilla-Keywords: rejects-valid X-Bugzilla-Severity: normal X-Bugzilla-Who: rmclure at linux dot ibm.com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status keywords bug_severity priority component assigned_to reporter cc target_milestone attachments.created Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D108734 Bug ID: 108734 Summary: powerpc: False Detection of __atomic_*_8 Builtins Product: gcc Version: 11.3.0 Status: UNCONFIRMED Keywords: rejects-valid Severity: normal Priority: P3 Component: c Assignee: unassigned at gcc dot gnu.org Reporter: rmclure at linux dot ibm.com CC: bergner at gcc dot gnu.org Target Milestone: --- Created attachment 54440 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=3D54440&action=3Dedit False positive with __has_builtin Using built-in specs. COLLECT_GCC=3Dpowerpc-linux-gnu-gcc COLLECT_LTO_WRAPPER=3D/usr/lib/gcc-cross/powerpc-linux-gnu/12/lto-wrapper Target: powerpc-linux-gnu Configured with: ../src/configure -v --with-pkgversion=3D'Ubuntu 12.2.0-3ub= untu1' --with-bugurl=3Dfile:///usr/share/doc/gcc-12/README.Bugs --enable-languages=3Dc,ada,c++,go,d,fortran,objc,obj-c++ --prefix=3D/usr --with-gcc-major-version-only --program-suffix=3D-12 --enable-shared --enable-linker-build-id --libexecdir=3D/usr/lib --without-included-gettext --enable-threads=3Dposix --libdir=3D/usr/lib --enable-nls --with-sysroot=3D/ --enable-clocale=3Dgnu --enable-libstdcxx-debug --enable-libstdcxx-time=3Dy= es --with-default-libstdcxx-abi=3Dnew --enable-gnu-unique-object --disable-lib= itm --disable-libquadmath --disable-libquadmath-support --enable-plugin --with-system-zlib --enable-libphobos-checking=3Drelease --without-target-system-zlib --with-libphobos-druntime-only=3Dyes --enable-secureplt --disable-softfloat --with-cpu=3Ddefault32 --disable-sof= tfloat --enable-targets=3Dpowerpc-linux,powerpc64-linux --enable-multiarch --disable-werror --with-long-double-128 --enable-multilib --enable-checking=3Drelease --build=3Dpowerpc64le-linux-gnu --host=3Dpowerpc64le-linux-gnu --target=3Dpowerpc-linux-gnu --program-prefix=3Dpowerpc-linux-gnu- --includedir=3D/usr/powerpc-linux-gnu= /include Thread model: posix Supported LTO compression algorithms: zlib zstd gcc version 12.2.0 (Ubuntu 12.2.0-3ubuntu1) The attached program should compile on 32-bit systems, built with `powerpc-linux-gnu-gcc fail.c -o fail`. Instead, __has_builtin(__atomic_store_8) evaluates to true, and we get a li= nker error. ``` /usr/lib/gcc-cross/powerpc-linux-gnu/11/../../../../powerpc-linux-gnu/bin/l= d: /tmp/ccJ9g2pV.o: in function `main': fail.c:(.text+0x24): undefined reference to `__atomic_store_8' collect2: error: ld returned 1 exit status ```=