From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23907 invoked by alias); 13 May 2010 13:43:35 -0000 Received: (qmail 23535 invoked by uid 48); 13 May 2010 13:43:16 -0000 Date: Thu, 13 May 2010 13:43:00 -0000 Subject: [Bug debug/44113] New: bad X-Bugzilla-Reason: CC Message-ID: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "andi-gcc at firstfloor dot org" 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/msg01372.txt.bz2 With gdb 7.1 / gcc 4.5.0 I noticed that unrolled loops have very poor debugging information. The body cannot be single stepped, but a "next" in gdb jumps over the whole iteration space. For example: main() { int i; for (i = 0; i < 10; i++) printf("%d\n",i ); } compiled with -O3 -g (which results in auto unrolling) gives: (gdb) b main Breakpoint 1 at 0x400520: file tloop2.c, line 2. (gdb) r Starting program: /home2/andi/tsrc/tloop2 Breakpoint 1, main () at tloop2.c:2 2 { (gdb) n 5 printf("%d\n",i ); (gdb) n 0 1 2 3 4 5 6 7 8 6 } (gdb) Note the single next stepped over the complete loop execution. I would have expected next to only execute one iteration. Is this a problem of the loop unroller not describing the unrolled loop to the debugger? -- Summary: bad Product: gcc Version: 4.5.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: debug AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: andi-gcc at firstfloor dot org GCC host triplet: x86_64-linux GCC target triplet: x86_64-linux http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44113