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]

[PATCH][RFC] Fix PR26421, improve find_used_portions


This patch improves find_used_portions to not take the whole structure
accessed just because its address is passed to a function.  This cuts
down the number of SFTs we (would) create for gfortran st_parm I/O
structure dramatically and solves the compile-time regression I invented
the write_only hack^Wbig hammer.

It seems this patch causes gcc.dg/tree-ssa/stdarg-5.c to ICE during
cplxlower in verify_ssa (thus RFC):

/abuild/rguenther/gcc/gcc/testsuite/gcc.dg/tree-ssa/stdarg-5.c: In 
function ?f7?:
/abuild/rguenther/gcc/gcc/testsuite/gcc.dg/tree-ssa/stdarg-5.c:108: 
internal compiler error: tree check: expected ssa_name, have 
name_memory_tag in verify_ssa, at tree-ssa.c:735

we don't like

addr.44_7 = &va_arg_tmp.41;
#   VUSE <SFT.154_105>;
D.2281_132 = REALPART_EXPR <*addr.44_7>;
#   VUSE <NMT.168>;
D.2282_133 = IMAGPART_EXPR <*addr.44_7>;

Otherwise bootstrapped and regtested on x86_64-unknown-linux-gnu.
Any ideas?  I'll dig further tomorrow.

Richard.


2006-02-22  Richard Guenther  <rguenther@suse.de>

	PR tree-optimization/26421
	* tree-ssa-alias.c (find_used_portions): Don't treat parameters
	in function calls that are ADDR_EXPRs as using the whole structure.


Index: tree-ssa-alias.c
===================================================================
*** tree-ssa-alias.c	(revision 111363)
--- tree-ssa-alias.c	(working copy)
*************** find_used_portions (tree *tp, int *walk_
*** 3075,3080 ****
--- 3075,3091 ----
  	  }
        }
        break;
+     case CALL_EXPR:
+       {
+ 	tree *arg;
+ 	for (arg = &TREE_OPERAND (*tp, 0); *arg; arg = &TREE_CHAIN (*arg))
+ 	  {
+ 	    if (TREE_CODE (*arg) != ADDR_EXPR)
+               find_used_portions (arg, walk_subtrees, NULL);
+ 	  }
+ 	*walk_subtrees = 0;
+ 	return NULL_TREE;
+       }
      case VAR_DECL:
      case PARM_DECL:
      case RESULT_DECL:


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