From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5528 invoked by alias); 26 Feb 2006 20:22:19 -0000 Received: (qmail 5519 invoked by uid 48); 26 Feb 2006 20:22:17 -0000 Date: Sun, 26 Feb 2006 21:02:00 -0000 Subject: [Bug debug/26475] New: tree-ssa loses line numbers for initializations X-Bugzilla-Reason: CC Message-ID: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "drow at gcc dot gnu dot org" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2006-02/txt/msg02985.txt.bz2 List-Id: Here's a simple testcase. Compile with -O2 and look at the -fdump-tree-all-lineno dumps: int foo (int); int bar (int a) { int ndir = 0; int b; b = foo (a); while (b--) ndir = foo (ndir); } Early on, the ndir = 0 assignment is marked for line 4. Then the 0 gets propogated into a phi without a line number, which ends up associated with the while loop (in a larger testcase, with the end of the instruction before the loop instead of the start of the loop - not sure why a difference). The original assignment is DCE'd. Then an exactly identical initialization is rematerialized (not surprising), and the closest line number we could find was the line number of the statement before the phi. Obviously stepping over this in GDB looks unnecessarily strange. Perhaps some PHI arguments could have line number information to be used on edges when coming out of SSA? FYI, original testcase comes from GDB's selftest.exp; we get a very surprising line number associated with the first real instruction. -- Summary: tree-ssa loses line numbers for initializations Product: gcc Version: 4.0.3 Status: UNCONFIRMED Severity: normal Priority: P3 Component: debug AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: drow at gcc dot gnu dot org GCC host triplet: x86_64-pc-linux-gnu http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26475