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] non-gimple statements produced by inliner


During compiling libstdc++ we produce non-gimple statements during
inlining by attempts to constant propagate arguments but turning them to
non-gimples during process.

Fixed by the attached patch I am going to commit as obvious.

Tested on i686-pc-gnu-linux.
2003-12-11  Jan Hubicka  <jh@suse.cz>
	* tree-inline.c (initialize_inlined_parameters): Disable
	constant propagation for non-gimple-min-invariant when
	preserving gimple form.
Index: tree-inline.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree-inline.c,v
retrieving revision 1.26.2.69
diff -c -3 -p -r1.26.2.69 tree-inline.c
*** tree-inline.c	9 Dec 2003 15:39:11 -0000	1.26.2.69
--- tree-inline.c	11 Dec 2003 21:07:09 -0000
*************** DECL_ARGUMENTS (fn);
*** 738,744 ****
  	     Theoretically, we could check the expression to see if
  	     all of the variables that determine its value are
  	     read-only, but we don't bother.  */
! 	  if (TREE_CONSTANT (value) || TREE_READONLY_DECL_P (value))
  	    {
  	      /* If this is a declaration, wrap it a NOP_EXPR so that
  		 we don't try to put the VALUE on the list of
--- 738,751 ----
  	     Theoretically, we could check the expression to see if
  	     all of the variables that determine its value are
  	     read-only, but we don't bother.  */
! 	  if ((TREE_CONSTANT (value) || TREE_READONLY_DECL_P (value))
! 	      /* We may produce non-gimple trees by adding NOPs or introduce
! 	         invalid sharing when operand is not really constant.
! 		 It is not big deal to prohibit constant propagation here as
! 		 we will constant propagate in DOM1 pass anyway.  */
! 	      && (!lang_hooks.gimple_before_inlining
! 		  || (is_gimple_min_invariant (value)
! 		      && TREE_TYPE (value) == TREE_TYPE (p))))
  	    {
  	      /* If this is a declaration, wrap it a NOP_EXPR so that
  		 we don't try to put the VALUE on the list of


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