Commit 46786144 by Segher Boessenkool

auto-inc-dec: Set alignment properly

When auto-inc-dec creates a new mem to compute the cost of doing some
transform, it forgets to copy over the alignment of the original mem.
This gives wrong costs, for example, for rs6000 a floating point load
or store is hugely expensive if unaligned.  This patch fixes it.


	* auto-inc-dec.c (attempt_change): Set the alignment of the
	temporary memory to that of the original.

From-SVN: r270419
parent f64e8977
2019-04-10 Joao Moreira <jmoreira@suse.de> 2019-04-17 Segher Boessenkool <segher@kernel.crashing.org>
* auto-inc-dec.c (attempt_change): Set the alignment of the
temporary memory to that of the original.
2019-04-17 Joao Moreira <jmoreira@suse.de>
* targhooks.c (default_print_patchable_function_entry): Emit * targhooks.c (default_print_patchable_function_entry): Emit
__patchable_function_entries section with writable flags to allow __patchable_function_entries section with writable flags to allow
...@@ -6,7 +11,7 @@ ...@@ -6,7 +11,7 @@
2019-04-17 Jonny Grant <jg@jguk.org> 2019-04-17 Jonny Grant <jg@jguk.org>
* collect2.c (main): Change gcc.gnu.org URL to HTTPS. * collect2.c (main): Change gcc.gnu.org URL to HTTPS.
2019-04-17 Jakub Jelinek <jakub@redhat.com> 2019-04-17 Jakub Jelinek <jakub@redhat.com>
......
...@@ -471,6 +471,7 @@ attempt_change (rtx new_addr, rtx inc_reg) ...@@ -471,6 +471,7 @@ attempt_change (rtx new_addr, rtx inc_reg)
int regno; int regno;
rtx mem = *mem_insn.mem_loc; rtx mem = *mem_insn.mem_loc;
machine_mode mode = GET_MODE (mem); machine_mode mode = GET_MODE (mem);
int align = MEM_ALIGN (mem);
rtx new_mem; rtx new_mem;
int old_cost = 0; int old_cost = 0;
int new_cost = 0; int new_cost = 0;
...@@ -478,6 +479,7 @@ attempt_change (rtx new_addr, rtx inc_reg) ...@@ -478,6 +479,7 @@ attempt_change (rtx new_addr, rtx inc_reg)
PUT_MODE (mem_tmp, mode); PUT_MODE (mem_tmp, mode);
XEXP (mem_tmp, 0) = new_addr; XEXP (mem_tmp, 0) = new_addr;
set_mem_align (mem_tmp, align);
old_cost = (set_src_cost (mem, mode, speed) old_cost = (set_src_cost (mem, mode, speed)
+ set_rtx_cost (PATTERN (inc_insn.insn), speed)); + set_rtx_cost (PATTERN (inc_insn.insn), speed));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment