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]

Fix another ICE when building glibc (new patch)


> > > +     MEM_ATTRS (x) = get_mem_attrs (MEM_ALIAS_SET (x), t, MEM_OFFSET (x),
> > > + 				   MEM_SIZE (x), MEM_ALIGN (x), GET_MODE (x));
> > 
> > I have trouble beliving that it's ok to change MEM_EXPR and preserve
> > MEM_OFFSET, since the later is by definition relative to the former.
> > Why isn't this using set_mem_attributes?
> 
> When using set_mem_attributes instead of that MEM_ATTRS (x) = get_mem_attrs...
> I get testsuite failures in gcc.dg/compat/struct-by-value-1[3-8]:
> 
> /gcc-main.new/gcc/testsuite/gcc.dg/compat/struct-by-value-13_x.c:9: internal
> compiler error: in set_mem_attributes_minus_bitpos, at emit-rtl.c:1471
> 
> 
> Since the problem with copied decl in MEM_EXPR occurs only when splitting
> complex args, I'll fix it in function.c:assign_parms:5261 by using set_mem_expr.
> This is safe because fnargs is a copy of parm so there might be no problem
> with inconsistent MEM_OFFSET.

When splitting complex args, the args list is copied first. Finally
we copy DECL_RTL and DECL_INCOMING_RTL from the copy to the original tree node
for all non-complex args.
Attached patch sets the MEM_EXPR of the original arg's DECL_INCOMING_RTL to
the original arg.

Bootstrapped/regtested powerpc64.

Josef

2004-03-01  Josef Zlomek  <zlomekj@suse.cz>

	* function.c (assign_parms): Force
	MEM_EXPR (DECL_INCOMING_RTL (parm)) == parm.

Index: function.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/function.c,v
retrieving revision 1.496
diff -c -3 -p -r1.496 function.c
*** function.c	19 Feb 2004 08:00:47 -0000	1.496
--- function.c	1 Mar 2004 15:50:19 -0000
*************** assign_parms (tree fndecl)
*** 5259,5264 ****
--- 5259,5270 ----
  	    {
  	      SET_DECL_RTL (parm, DECL_RTL (fnargs));
  	      set_decl_incoming_rtl (parm, DECL_INCOMING_RTL (fnargs));
+ 
+ 	      /* Set MEM_EXPR to the original decl, i.e. to PARM,
+ 		 instead of the copy of decl, i.e. FNARGS.  */
+ 	      if (DECL_INCOMING_RTL (parm)
+ 		  && GET_CODE (DECL_INCOMING_RTL (parm)) == MEM)
+ 		set_mem_expr (DECL_INCOMING_RTL (parm), parm);
  	    }
  	  fnargs = TREE_CHAIN (fnargs);
  	}


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