From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 419D0383543A; Sat, 13 Mar 2021 16:49:02 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 419D0383543A From: "wsnyder at wsnyder dot org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/99579] New: gmon.out not created with -O0 but otherwise is Date: Sat, 13 Mar 2021 16:49:01 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: 9.3.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: wsnyder at wsnyder 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: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone attachments.created 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 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Mar 2021 16:49:02 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D99579 Bug ID: 99579 Summary: gmon.out not created with -O0 but otherwise is Product: gcc Version: 9.3.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: wsnyder at wsnyder dot org Target Milestone: --- Created attachment 50382 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=3D50382&action=3Dedit Testcase =3D=3D Description Type "make" in this tarball's directory. This will show (extra lines omitted): g++ -pg -O0 -c -o Vt_case_huge_prof__main.o Vt_case_huge_prof__main.ii @@@@@ Did we get a gmon? make: [Makefile:15: x] Error 1 (ignored) g++ -pg -Os -c -o Vt_case_huge_prof__main.o Vt_case_huge_prof__main.ii @@@@@ Did we get a gmon? 4554816 28 -rw-rw-r-- 1 user user 26943 Mar 13 11:33 ./gmon.= out g++ -pg -O0 -c -o Vt_case_huge_prof__main.o Vt_case_huge_prof__main__ok= .ii @@@@@ Did we get a gmon? 4554816 884 -rw-rw-r-- 1 user user 897414 Mar 13 11:33 ./gmon.= out In short gcc -pg with -O0 is not creating a gmon. The problem goes away using -Os. The problem goes away if line 60549 of ~/d/case/Vt_case_huge_prof__main.ii std::array __Vtablechg1; is changed into CData __Vtablechg1[16384]; (The original program requires a unique class, not a std::array, so using C-style arrays is unfortunately not a workaround in my application.) While this "feels" like a memory corruption sort of bug,=20 the program is sanitizer and warning clean. =3D=3D gcc --version gcc (Ubuntu 9.3.0-17ubuntu1~20.04) 9.3.0 Copyright (C) 2019 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. =3D=3D cat /etc/*release DISTRIB_DESCRIPTION=3D"Ubuntu 20.04 LTS"=