From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id A8BBB384AB5F; Mon, 22 Apr 2024 19:54:39 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A8BBB384AB5F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1713815679; bh=YVQRoIIrtH7Q0/ArBWr7oTUO9meIqqT2LAObx7iQhR8=; h=From:To:Subject:Date:From; b=Ep7JqTJRpjLBXbA+Z8Xajbif4/xvSbVUxgEblowfOCEXYD99xGkug2KfpnaWDWVWj vTs7LW6PFUKvxXO0ElD5Stt6RGVH3dA9Fz2ElaGqhNk52M+ESUS0SGl27tGaduitHI ows7wdpiPsfzPdZRjfdyyaTdAlCOaBOVOHAMUe58= From: "nisse at lysator dot liu.se" To: gcc-bugs@gcc.gnu.org Subject: [Bug driver/114813] New: powerpc64: Assembly option -many passed unconditionally, please drop, or make easily configurable Date: Mon, 22 Apr 2024 19:54:36 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: driver X-Bugzilla-Version: 12.2.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: nisse at lysator dot liu.se 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 bug_severity priority component assigned_to reporter target_milestone 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=3D114813 Bug ID: 114813 Summary: powerpc64: Assembly option -many passed unconditionally, please drop, or make easily configurable Product: gcc Version: 12.2.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: driver Assignee: unassigned at gcc dot gnu.org Reporter: nisse at lysator dot liu.se Target Milestone: --- Hi, my project includes C and assembly for a couple of different architectures and cpu flavors (with some runtime selection of which functions to use). I use the gcc driver for both .c and .s (preprocessed assembly) files. I would like each assembly file to declare the kind of processor it is intended for, to get compile-time errors if I accidentally use instructions not available for that processor. For powerpc64, there are assembly pseudoops for that; docs are a bit sketchy, but I think I should be able to use, e.g., .machine "power8" as annotation in the assembly input, and get an error from the assembler if I use instructions introduced in later processor versions. However, it turns out that gcc adds the command-line option -many when processing assembly files, which allows all instructions, and I = find no easy way to disable that. There may be a good reason for that option when processing files generated by the gcc compiler (e.g., use of inline asm for arbitrary processor variants), but it's unhelpful for my usecase, where I pass an assembly file as input to gcc. Example: $ powerpc64le-linux-gnu-gcc -v no-such-file.s Using built-in specs. COLLECT_GCC=3Dpowerpc64le-linux-gnu-gcc COLLECT_LTO_WRAPPER=3D/usr/lib/gcc-cross/powerpc64le-linux-gnu/12/lto-wrapp= er OFFLOAD_TARGET_NAMES=3Dnvptx-none OFFLOAD_TARGET_DEFAULT=3D1 Target: powerpc64le-linux-gnu Configured with: ../src/configure -v --with-pkgversion=3D'Debian 12.2.0-14' --with-bugurl=3Dfile:///usr/share/doc/gcc-12/README.Bugs --enable-languages=3Dc,ada,c++,go,d,fortran,objc,obj-c++,m2 --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 --enable-plug= in --enable-default-pie --with-system-zlib --enable-libphobos-checking=3Drelea= se --without-target-system-zlib --with-libphobos-druntime-only=3Dyes --enable-secureplt --enable-targets=3Dpowerpcle-linux --disable-multilib --enable-multiarch --disable-werror --with-long-double-128 --enable-offload-targets=3Dnvptx-none=3D/build/gcc-12-cross-7DlaPe/gcc-12-c= ross-15/gcc/debian/tmp-nvptx/usr --enable-offload-defaulted --enable-checking=3Drelease --build=3Dx86_64-lin= ux-gnu --host=3Dx86_64-linux-gnu --target=3Dpowerpc64le-linux-gnu --program-prefix=3Dpowerpc64le-linux-gnu- --includedir=3D/usr/powerpc64le-linux-gnu/include Thread model: posix Supported LTO compression algorithms: zlib zstd gcc version 12.2.0 (Debian 12.2.0-14)=20 COLLECT_GCC_OPTIONS=3D'-v' '-dumpdir' 'a-' /usr/lib/gcc-cross/powerpc64le-linux-gnu/12/../../../../powerpc64le-linux-g= nu/bin/as -v -a64 -mpower8 -many -mlittle -o /tmp/ccncUIii.o no-such-file.s GNU assembler version 2.40 (powerpc64le-linux-gnu) using BFD version (GNU Binutils for Debian) 2.40 Assembler messages: Error: can't open no-such-file.s for reading: No such file or directory Note the "-many" on the assembler invocation close to the end. If I look at the output of -dumpspecs, I see a "-many" at the end of the "*asm_cpu:" section. I don't understand the syntax, but it appears at the end with no qualifiers, and I guess that means it's unconditional. I've checked that I get a different command line, without -many, if I take that out from the specs section, and pass the modified specs file to the gcc -specs option, but that's a rather cumbersome workaround. Could the gcc driver drop the -many option, at least for the case that its input is a .s (assembly) file?=