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] fix Bugs 15109, 15108, 14472 and most likely 14440


Hi,

They're all really the same bug and should be duplicates.
All we have to do is look through NOP_EXPRs.

Bootstrapped and tested on x86-64-unknown-linux-gnu.
Post-merge, obviously.

Gr.
Steven


	* tree-tailcall.c (process_assignment): Look through NOP_EXPRs.
	(find_tail_calls): Likewise.

Index: tree-tailcall.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/Attic/tree-tailcall.c,v
retrieving revision 1.1.2.24
diff -c -3 -p -r1.1.2.24 tree-tailcall.c
*** tree-tailcall.c	18 Mar 2004 22:43:56 -0000	1.1.2.24
--- tree-tailcall.c	6 May 2004 22:58:25 -0000
*************** process_assignment (tree ass, tree stmt,
*** 261,266 ****
--- 261,271 ----
    tree src = TREE_OPERAND (ass, 1);
    enum tree_code code = TREE_CODE (src);
  
+   if (code == NOP_EXPR)
+     {
+       src = TREE_OPERAND (src, 0);
+       code = TREE_CODE (src);
+     }
    if (code == SSA_NAME)
      {
        if (src != *ass_var)
*************** find_tail_calls (basic_block bb, struct 
*** 467,474 ****
    if (ret_var
        && TREE_CODE (ret_var) == MODIFY_EXPR)
      {
        if (!tail_recursion
! 	  && TREE_CODE (TREE_OPERAND (ret_var, 1)) != SSA_NAME)
  	return;
  
        if (!process_assignment (ret_var, stmt, bsi, &m, &a, &ass_var))
--- 472,482 ----
    if (ret_var
        && TREE_CODE (ret_var) == MODIFY_EXPR)
      {
+       tree ret_expr = TREE_OPERAND (ret_var, 1);
        if (!tail_recursion
! 	  && TREE_CODE (ret_expr) != SSA_NAME
! 	  && ! (TREE_CODE (ret_expr) == NOP_EXPR
! 		&& TREE_CODE (TREE_OPERAND (ret_expr, 0)) == SSA_NAME))
  	return;
  
        if (!process_assignment (ret_var, stmt, bsi, &m, &a, &ass_var))


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