This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[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
-------------------------------------------------------------------


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]