public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug testsuite/108192] New: g++.dg/cet-notrack-1.C searching for wrong function on mingw
@ 2022-12-21  5:14 nightstrike at gmail dot com
  2022-12-21 18:06 ` [Bug testsuite/108192] " hjl.tools at gmail dot com
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: nightstrike at gmail dot com @ 2022-12-21  5:14 UTC (permalink / raw)
  To: gcc-bugs

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.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug testsuite/108192] g++.dg/cet-notrack-1.C searching for wrong function on mingw
  2022-12-21  5:14 [Bug testsuite/108192] New: g++.dg/cet-notrack-1.C searching for wrong function on mingw nightstrike at gmail dot com
@ 2022-12-21 18:06 ` hjl.tools at gmail dot com
  2022-12-21 23:29 ` nightstrike at gmail dot com
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: hjl.tools at gmail dot com @ 2022-12-21 18:06 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from H.J. Lu <hjl.tools at gmail dot com> ---
Since Windows doesn't support IBT, this test can be limited to Linux.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug testsuite/108192] g++.dg/cet-notrack-1.C searching for wrong function on mingw
  2022-12-21  5:14 [Bug testsuite/108192] New: g++.dg/cet-notrack-1.C searching for wrong function on mingw nightstrike at gmail dot com
  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
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: nightstrike at gmail dot com @ 2022-12-21 23:29 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from nightstrike <nightstrike at gmail dot com> ---
(In reply to H.J. Lu from comment #1)
> Since Windows doesn't support IBT, this test can be limited to Linux.

I don't know what IBT is, but if I change the two printf's to puts(), the tests
pass.  So, maybe they don't have to be skipped?

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug testsuite/108192] g++.dg/cet-notrack-1.C searching for wrong function on mingw
  2022-12-21  5:14 [Bug testsuite/108192] New: g++.dg/cet-notrack-1.C searching for wrong function on mingw nightstrike at gmail dot com
  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
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: nightstrike at gmail dot com @ 2023-01-07 10:05 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from nightstrike <nightstrike at gmail dot com> ---
Created attachment 54209
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=54209&action=edit
Patch to change printf to puts so it works everywhere

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug testsuite/108192] g++.dg/cet-notrack-1.C searching for wrong function on mingw
  2022-12-21  5:14 [Bug testsuite/108192] New: g++.dg/cet-notrack-1.C searching for wrong function on mingw nightstrike at gmail dot com
                   ` (2 preceding siblings ...)
  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
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: 10walls at gmail dot com @ 2023-01-08  1:36 UTC (permalink / raw)
  To: gcc-bugs

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

jon_y <10walls at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |10walls at gmail dot com

--- Comment #4 from jon_y <10walls at gmail dot com> ---
Is Nightstrike's patch OK?

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug testsuite/108192] g++.dg/cet-notrack-1.C searching for wrong function on mingw
  2022-12-21  5:14 [Bug testsuite/108192] New: g++.dg/cet-notrack-1.C searching for wrong function on mingw nightstrike at gmail dot com
                   ` (3 preceding siblings ...)
  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
  6 siblings, 0 replies; 8+ messages in thread
From: pinskia at gcc dot gnu.org @ 2023-01-08  1:38 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
(In reply to jon_y from comment #4)
> Is Nightstrike's patch OK?

I think it is correct but patches should goto gcc-patches@ really.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug testsuite/108192] g++.dg/cet-notrack-1.C searching for wrong function on mingw
  2022-12-21  5:14 [Bug testsuite/108192] New: g++.dg/cet-notrack-1.C searching for wrong function on mingw nightstrike at gmail dot com
                   ` (4 preceding siblings ...)
  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
  6 siblings, 0 replies; 8+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2023-01-28 16:32 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #6 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Jonathan Yong <jyong@gcc.gnu.org>:

https://gcc.gnu.org/g:6464409b0c7077e36858989b5dae302e2d26f45a

commit r13-5475-g6464409b0c7077e36858989b5dae302e2d26f45a
Author: Jonathan Yong <10walls@gmail.com>
Date:   Wed Jan 11 09:51:02 2023 +0000

    PR c/108192 - Fix test for mingw

    gcc/testsuite/ChangeLog:

            PR c/108192
            * g++.dg/cet-notrack-1.C: Use puts instead of printf,
            so function call is not mangled by __mingw_printf when
            doing assembly symbol inspection.

    Signed-off-by: Jonathan Yong <10walls@gmail.com>

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug testsuite/108192] g++.dg/cet-notrack-1.C searching for wrong function on mingw
  2022-12-21  5:14 [Bug testsuite/108192] New: g++.dg/cet-notrack-1.C searching for wrong function on mingw nightstrike at gmail dot com
                   ` (5 preceding siblings ...)
  2023-01-28 16:32 ` cvs-commit at gcc dot gnu.org
@ 2024-02-18  2:20 ` jyong at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: jyong at gcc dot gnu.org @ 2024-02-18  2:20 UTC (permalink / raw)
  To: gcc-bugs

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

jyong at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jyong at gcc dot gnu.org
         Resolution|---                         |FIXED
             Status|UNCONFIRMED                 |RESOLVED

--- Comment #7 from jyong at gcc dot gnu.org ---
Changed to use __mingw_*printf.

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2024-02-18  2:20 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-12-21  5:14 [Bug testsuite/108192] New: g++.dg/cet-notrack-1.C searching for wrong function on mingw nightstrike at gmail dot com
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

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).