From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 427883858D1E; Mon, 6 Feb 2023 17:34:36 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 427883858D1E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1675704876; bh=AMNZWTzrjRl7H902m1LEkUm+USO0R7JcbuEPeCpTJ5g=; h=From:To:Subject:Date:In-Reply-To:References:From; b=pBfRs++cSv0IDYkRiAAZuWFI5ez7RStE3CGX9ivDj5DNSTEqFIXLpp+SxmRZxKlUi Tct4JcqclFHnaiU/kdqLhUcnVOfhBlaYbQ+Ud1AxxneoOrWbFciNC/i9NEmHgK8lqA n6jYsdtdJiWwCrbfca1xqNLVlMh47AG0nLLj630w= From: "zack+srcbugz at owlfolio dot org" To: gcc-bugs@gcc.gnu.org Subject: [Bug testsuite/108675] FAIL: gcc.c-torture/execute/builtins/*printf.c when stdio.h includes definitions Date: Mon, 06 Feb 2023 17:34:35 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: testsuite X-Bugzilla-Version: 13.0 X-Bugzilla-Keywords: testsuite-fail X-Bugzilla-Severity: normal X-Bugzilla-Who: zack+srcbugz at owlfolio dot org 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: Message-ID: In-Reply-To: References: 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=3D108675 --- Comment #6 from Zack Weinberg --- Note that what you (mingw) have in this header is a pretty serious anti-optimization. Functions that call __builtin_va_start cannot be inlined under any circumstances whatsoever (try tagging it __attribute__((always_inline)) and see what happens) so you're emitting a redundant copy of this function in every translation unit that calls fprint= f, and you're not getting any actual codegen improvement in exchange. You _could_ do like glibc bits/stdio2.h __mingw_ovr __attribute__((__format__ (gnu_printf, 1, 2))) __MINGW_ATTRIB_NONNULL(1) int printf (const char *__format, ...) { return __mingw_fprintf(stdout, __format, __builtin_va_arg_pack()); } but this doesn't let you synthesize a direct call to __mingw_vfprintf. I'd recommend scrapping the entire mess, abandoning the idea of getting dir= ect calls to v*printf/v*scanf, and using asm() symbol renaming to add the __min= gw_ prefix. That should also avoid stepping on the GCC testcases' toes.=