public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "nightstrike at gmail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug testsuite/108192] New: g++.dg/cet-notrack-1.C searching for wrong function on mingw
Date: Wed, 21 Dec 2022 05:14:34 +0000	[thread overview]
Message-ID: <bug-108192-4@http.gcc.gnu.org/bugzilla/> (raw)

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108192

            Bug ID: 108192
           Summary: g++.dg/cet-notrack-1.C searching for wrong function on
                    mingw
           Product: gcc
           Version: 13.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: testsuite
          Assignee: unassigned at gcc dot gnu.org
          Reporter: nightstrike at gmail dot com
  Target Milestone: ---

Created attachment 54139
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=54139&action=edit
cet-notrack-1.s

g++.dg/cet-notrack-1.C Tries to find 'call puts()' in the asm after calling
printf() on the c++ side.  On Mingw, we do magic things with converting
printf() into __mingw_ variants to support MS style printf and other things. 
So the assembler dump on mingw results in a call to __mingw_vfprintf in this
particular case.

It would likely be possible to fix the testcase by searching for "call
__mingw_*printf" or something, but I'm curious if this is really a case of a
missed optimization.  The strings in question are simple string literals, so we
don't care about mingw or ms special versions of printf, and a call to puts
should be fine.  I don't know if this testcase is specifically trying to
validate that optimization, but it at least indirectly revealed it.

Asm attached.

             reply	other threads:[~2022-12-21  5:14 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-21  5:14 nightstrike at gmail dot com [this message]
2022-12-21 18:06 ` [Bug testsuite/108192] " hjl.tools at gmail dot com
2022-12-21 23:29 ` nightstrike at gmail dot com
2023-01-07 10:05 ` nightstrike at gmail dot com
2023-01-08  1:36 ` 10walls at gmail dot com
2023-01-08  1:38 ` pinskia at gcc dot gnu.org
2023-01-28 16:32 ` cvs-commit at gcc dot gnu.org
2024-02-18  2:20 ` jyong at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-108192-4@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).