From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp001-out.apm-internet.net (smtp001-out.apm-internet.net [85.119.248.222]) by sourceware.org (Postfix) with ESMTPS id 7AED53858D3C for ; Sat, 15 Jan 2022 14:31:11 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 7AED53858D3C Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=sandoe.co.uk Authentication-Results: sourceware.org; spf=none smtp.mailfrom=sandoe.co.uk Received: (qmail 72962 invoked from network); 15 Jan 2022 14:31:09 -0000 X-APM-Out-ID: 16422570697296 X-APM-Authkey: 257869/1(257869/1) 5 Received: from unknown (HELO ?192.168.1.214?) (81.138.1.83) by smtp001.apm-internet.net with SMTP; 15 Jan 2022 14:31:09 -0000 Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.21\)) Subject: Re: Many analyzer failures on non-Linux system (x86_64-apple-darwin) From: Iain Sandoe In-Reply-To: <650EE35B-A344-49B7-8361-303B88696A3F@gmail.com> Date: Sat, 15 Jan 2022 14:31:09 +0000 Cc: David Malcolm , GCC Mailing List Content-Transfer-Encoding: quoted-printable Message-Id: References: <3BD093C3-178E-4B11-BDA1-9604ADCA4B04@gmail.com> <237CA1D3-29E0-4252-8EDC-DC562BA042A2@gmail.com> <650EE35B-A344-49B7-8361-303B88696A3F@gmail.com> To: FX X-Mailer: Apple Mail (2.3445.104.21) X-Spam-Status: No, score=-8.8 required=5.0 tests=BAYES_00, KAM_COUK, KAM_DMARC_STATUS, KAM_LAZY_DOMAIN_SECURITY, KAM_SHORT, RCVD_IN_DNSWL_LOW, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=no autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gcc@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Jan 2022 14:31:13 -0000 Hi FX, > On 15 Jan 2022, at 14:19, FX via Gcc wrote: >=20 >> The purpose of these asm tests is to verify that the analyzer doesn't >> get confused by various inline assembler directives used in the = source >> of the Linux kernel. So in theory they ought to work on any host, = with >> a gcc configured for a suitable target. >>=20 >> These tests are marked with "dg-do assemble" directives, which I'd >> hoped would mean it uses -S for the tests (to make a .s file), but >> looking at a log locally, it appears to be using -c (to make a .o >> file), so maybe that's what's going wrong for you as well? >=20 > The tests even compiled with -S still fail: I think the test should be =E2=80=9Cdg-do compile=E2=80=9D to stop at = assembler output =E2=80=A6=20 .. the stuff below indicates it is still trying to assemble the .s file. >=20 > spawn -ignore SIGHUP /Users/fx/ibin/gcc/xgcc -B/Users/fx/ibin/gcc/ = exceptions_enabled42475.cc -fdiagnostics-plain-output -S -o excep > tions_enabled42475.s > FAIL: gcc.dg/analyzer/torture/asm-x86-linux-cpuid-paravirt-1.c -O1 = (test for excess errors) > Excess errors: > = /Users/fx/gcc/gcc/testsuite/gcc.dg/analyzer/torture/asm-x86-linux-cpuid-pa= ravirt-1.c:27:3: warning: 'asm' operand 6 probably does not match = constraints > = /Users/fx/gcc/gcc/testsuite/gcc.dg/analyzer/torture/asm-x86-linux-cpuid-pa= ravirt-1.c:27:3: error: impossible constraint in 'asm' >=20 > It=E2=80=99s the same for the other four. >=20 >=20 > gcc.dg/analyzer/asm-x86-lp64-1.c is slightly different, there it=E2=80=99= s an assembler error: >=20 >=20 > /var/folders/_8/7ft0tbns6_l87s21n4s_1sc80000gn/T//cc4b3ybm.s:160:20: = error:unexpected token in '.section' directive > .pushsection .text > ^ > /var/folders/_8/7ft0tbns6_l87s21n4s_1sc80000gn/T//cc4b3ybm.s:162:2: = error: unknown directive > .type add_asm, @function > ^ > /var/folders/_8/7ft0tbns6_l87s21n4s_1sc80000gn/T//cc4b3ybm.s:167:13: = error: .popsection without corresponding .pushsection > .popsection These ^^ are ELF-isms***, so will not work on Darwin (but if the test = does not need to assemble, then that is academic). >>>> ## Builtin-related failures >>>>=20 >>>> Those four cases fail: >>>>=20 >>>> gcc.dg/analyzer/data-model-1.c >>>> gcc.dg/analyzer/pr103526.c >>>> gcc.dg/analyzer/taint-size-1.c >>>> gcc.dg/analyzer/write-to-string-literal-1.c >>=20 >> Can you file a bug about this and attach the preprocessed source from >> the test (using -E). >=20 > Done, it is https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D104042 I made a comment about how we might work around this for Darwin - but = OTOH, perhaps they should work with _FORTIFY_SOURCE !=3D 0 Iain *** no particular reason why Darwin could not have push/pop section but = that=E2=80=99s not implemented in either cctools or LLVM-based = assemblers for mach-o at present.