This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[tree-ssa] get_lineno and get_filename problem
- From: Jose Renau <renau at cs dot uiuc dot edu>
- To: gcc-patches at gcc dot gnu dot org
- Date: Wed, 15 Jan 2003 20:00:18 -0600 (CST)
- Subject: [tree-ssa] get_lineno and get_filename problem
Labels generated by gimplify_loop_expr do not have locus. Since no lineno
and filename can be extracted, -fdump-tree-ccp-details fails.
This patch returns -1 or "???" when an expression does not have a locus.
This is done by checking the locus existence when the lineno and the
filename is requested. (In annotate_stmt_with_file_line says that it does
not want to do emit a lineno filename for those labels, which is the
another option)
Bootstrapped with -O1 -fdump-tree-ccp-details -ftree-ccp on mipseb-linux
Index: tree-flow-inline.h
===================================================================
RCS file: /cvsroot/gcc/gcc/gcc/Attic/tree-flow-inline.h,v
retrieving revision 1.1.2.18
diff -c -3 -p -r1.1.2.18 tree-flow-inline.h
*** tree-flow-inline.h 15 Jan 2003 19:41:47 -0000 1.1.2.18
--- tree-flow-inline.h 16 Jan 2003 01:54:08 -0000
*************** get_lineno (expr)
*** 242,250 ****
if (expr == NULL_TREE)
return -1;
! if (TREE_CODE (expr) == COMPOUND_EXPR)
expr = TREE_OPERAND (expr, 0);
return TREE_LINENO (expr);
}
--- 242,253 ----
if (expr == NULL_TREE)
return -1;
! if (TREE_CODE (expr) == COMPOUND_EXPR)
expr = TREE_OPERAND (expr, 0);
+ if( !TREE_LOCUS(expr) )
+ return -1;
+
return TREE_LINENO (expr);
}
*************** get_filename (expr)
*** 257,262 ****
--- 260,268 ----
if (TREE_CODE (expr) == COMPOUND_EXPR)
expr = TREE_OPERAND (expr, 0);
+
+ if( !TREE_LOCUS(expr) )
+ return "???";
if (TREE_FILENAME (expr))
return TREE_FILENAME (expr);
--
-------------------------------------------------------------------
Jose Renau | "The difference between genius and stupidity
renau@uiuc.edu | is that genius has its limits" -Albert Einstein
-------------------------------------------------------------------