From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27784 invoked by alias); 29 May 2013 14:55:53 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 27765 invoked by uid 48); 29 May 2013 14:55:50 -0000 From: "tejohnson at google dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug rtl-optimization/57451] New: Incorrect debug ranges emitted for -freorder-blocks-and-partition -g Date: Wed, 29 May 2013 14:55:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: rtl-optimization X-Bugzilla-Version: 4.8.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: tejohnson at google dot com X-Bugzilla-Status: UNCONFIRMED 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 attachments.created Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2013-05/txt/msg02034.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57451 Bug ID: 57451 Summary: Incorrect debug ranges emitted for -freorder-blocks-and-partition -g Product: gcc Version: 4.8.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: rtl-optimization Assignee: unassigned at gcc dot gnu.org Reporter: tejohnson at google dot com Created attachment 30214 --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=30214&action=edit pr49115.C While fixing problems with -freorder-blocks-and-partition, I found that the debug ranges being emitted for split functions with -g are incorrect and leading to assembler errors. I've attached a simple reproducer (gcc/testsuite/g++.dg/torture/pr49115.C). To reproduce: $ g++ pr49115.C -O2 -o pr49115 -fprofile-generate $ pr49115 $ g++ pr49115.C -O2 -o pr49115 -fprofile-use -g -freorder-blocks-and-partition /tmp/ccStx78Y.s: Assembler messages: /tmp/ccStx78Y.s:325: Error: can't resolve `.text.unlikely' {.text.unlikely section} - `.LBB14' {.text.startup section} The problem is hidden if the last compile step is changed to drop either -g or -freorder-blocks-and-partition, or by adding -gdwarf-2 (which doesn't trigger debug_range support).