From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14485 invoked by alias); 19 May 2010 22:49:22 -0000 Received: (qmail 14435 invoked by uid 48); 19 May 2010 22:49:04 -0000 Date: Wed, 19 May 2010 22:49:00 -0000 Subject: [Bug debug/44205] New: Wrong .debug_line for -O0 -g X-Bugzilla-Reason: CC Message-ID: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "jan dot kratochvil at redhat dot com" 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 X-SW-Source: 2010-05/txt/msg02127.txt.bz2 extern int i; void f (void) { if (i) { if (i) i = 0; else i = 1; } else i = 2; } gcc -c -g objdump -dS i = 0; 18: c7 05 00 00 00 00 00 movl $0x0,0x0(%rip) # 22 1f: 00 00 00 else i = 1; 22: eb 16 jmp 3a 24: c7 05 00 00 00 00 01 movl $0x1,0x0(%rip) # 2e 2b: 00 00 00 2e: eb 0a jmp 3a jmp at offset 22 should belong to the "i = 0;" line. Problem reproduced on: gcc (GCC) 4.4.5 20100519 (prerelease) gcc (GCC) 4.5.1 20100519 (prerelease) gcc (GCC) 4.6.0 20100519 (experimental) gcc-4.4.3-4.fc12.x86_64 Correct output on: gcc-4.1.2-48.el5.x86_64 This will cause GDB to skip the line on `step' (which is a workaround in GDB for missing is_stmt info). Can GCC use its own new gdb guality framework to test it on its own? There was before: PR debug/29609, PR debug/36690, PR debug/37616 -- Summary: Wrong .debug_line for -O0 -g Product: gcc Version: 4.4.5 Status: UNCONFIRMED Severity: normal Priority: P3 Component: debug AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: jan dot kratochvil at redhat dot com GCC target triplet: x86_64-unknown-linux-gnu http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44205