From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id D77793858D3C; Fri, 19 Nov 2021 10:40:34 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D77793858D3C From: "marxin at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/103329] New: [11/12 Regression] Code divergence in debug info with -fdump-tree-original since r11-291-g0f50f6daa140186a Date: Fri, 19 Nov 2021 10:40:34 +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: 12.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: marxin at gcc dot gnu.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 cc target_milestone 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: Fri, 19 Nov 2021 10:40:35 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D103329 Bug ID: 103329 Summary: [11/12 Regression] Code divergence in debug info with -fdump-tree-original since r11-291-g0f50f6daa140186a Product: gcc Version: 12.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: marxin at gcc dot gnu.org CC: jason at gcc dot gnu.org Target Milestone: --- Since the revision, the following test-case: $ cat vectors.ii template struct __is_integer { enum { __value }; }; template ::__value> struct __promote { typedef double __type; }; template using __promote_2 =3D __promote<_Up>; template typename __promote_2<_Tp, _Up>::__type pow(_Tp, _Up) {} template struct Vector { typedef int iterator; virtual ~Vector(); }; template class DoFHandler; template struct MappingQ1 { MappingQ1(); static const unsigned vertex_mapping[]; }; template <> const unsigned MappingQ1<3>::vertex_mapping[]; struct DerivativeApproximation { template void approximate_second_derivative(const DoFHandler &, const InputVector &, Vector &, unsigned); template struct SecondDerivative { typedef int Derivative; double derivative_norm(const Derivative &); }; }; template <> double DerivativeApproximation::SecondDerivative<3>::derivative_norm( const Derivative &) { int s(pow(s, 3)); } template void DerivativeApproximation::approximate_second_derivative( const DoFHandler &, const InputVector &, Vector &, unsigned= ) { static MappingQ1 index_interval; Vector::iterator derivative_norm_on_this_cell; } template void DerivativeApproximation::approximate_second_derivative( const DoFHandler<3> &, const double &, Vector &, unsigned); $ g++ -O1 -g -w -fPIC -shared vectors.ii -o 1 -fdump-tree-original=3D/dev/n= ull && cp 1 2 && g++ -O1 -g -w -fPIC -shared vectors.ii -o 1 && diff 1 2 Binary files 1 and 2 differ It makes difference in debug info: $ objdump -W 1 > 11 $ objdump -W 2 > 22 $ diff -u 11 22 ... Contents of the .eh_frame section: @@ -86,7 +86,7 @@ 0000000000000000 0000000000000000=20 Length: 60 Version: 2 - Offset into .debug_info: 0x395 + Offset into .debug_info: 0x3b2 Pointer Size: 8 Segment Size: 0 @@ -111,21 +111,21 @@ <1d> DW_AT_producer : (indirect string, offset: 0x32): GNU AS 2.37 <21> DW_AT_language : 32769 (MIPS assembler) Compilation Unit @ offset 0x23: - Length: 0x36e (32-bit) + Length: 0x38b (32-bit) Version: 5 Unit Type: DW_UT_compile (1) Abbrev Offset: 0x12 Pointer Size: 8 <0><2f>: Abbrev Number: 17 (DW_TAG_compile_unit) - <30> DW_AT_producer : (indirect string, offset: 0x2ab): GNU C++17 12.0.0 20211118 (experimental) -mtune=3Dgeneric -march=3Dx86-64 -g -O1 -fPIC + <30> DW_AT_producer : (indirect string, offset: 0x2c5): GNU C++17 12.0.0 20211118 (experimental) -mtune=3Dgeneric -march=3Dx86-64 -g -O1 -fPIC <34> DW_AT_language : 33 (C++14) <35> DW_AT_name : (indirect line string, offset: 0x19): vectors.ii <39> DW_AT_comp_dir : (indirect line string, offset: 0x24): /home/marxin/Programming/testcases <3d> DW_AT_ranges : 0x2d <41> DW_AT_low_pc : 0x0 <49> DW_AT_stmt_list : 0x67 ...=