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]

Re: [PATCH] fixing typo in expr.c to allow proper recognition of complex addresses in some arches.


> Thanks.  Installed on the trunk.

Well, no, that will be problematic for some architectures.  The history of 
this piece of code is complicated and it's admittedly lacking a comment, but 
the purpose of the block is clear enough:

	op0 = expand_expr (base, NULL_RTX, VOIDmode, EXPAND_SUM);
	op0 = memory_address_addr_space (address_mode, op0, as);
	if (!integer_zerop (TREE_OPERAND (exp, 1)))
	  {
	    rtx off
	      = immed_double_int_const (mem_ref_offset (exp), address_mode);
	    op0 = simplify_gen_binary (PLUS, address_mode, op0, off);
	  }
	op0 = memory_address_addr_space (mode, op0, as);

The offset computation is done in address_mode and then, only at the end, 
converted to mode.

-- 
Eric Botcazou


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