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] unreviewed patch (Bootstrap failure on ia64)


Hi Matt,
> I don't think his patch is correct.  simplify_gen_binary aborts
> because the mode is VOIDmode.  I'm testing the following patch on
> powerpc-unknown-linux-gnu, which fixes a number of the test suite
> failures.
>
> 	* builtins.c (expand_builtin_memcpy): Use mode of
> 	dest_addr for intermediate computation.

If a target's pointer type is 64-bits wide and len_rtx is only 32-bit,
wouldn't it make more sense to decrement the 32-bit value the promote,
instead of promoting both len_rtx and const1_rtx to ptr_mode to perform
the subtraction?

Personally, if people are unhappy with calculating the "delta" for
constant integers in expand_builtin_memcpy, I'd recommend Jakub's
suggestion:

enum machine_mode mode = GET_MODE (result);
if (mode == VOIDmode)
  mode == Pmode;
result = simplify_gen_binary (MINUS, mode, result, const1_rtx);
result = force_operand (result, NULL_RTX);

i.e. only resort to Pmode when we known both arguments are constants
so the expression will be evaluated at compile time.

Roger
--


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