Commit 9506aecb by Eric Botcazou Committed by Eric Botcazou

expr.c (expand_expr_real_1): Do not unnecessarily copy the object in the MEM_P case.

	* expr.c (expand_expr_real_1) <VIEW_CONVERT_EXPR>: Do not unnecessarily
	copy the object in the MEM_P case.

From-SVN: r192452
parent 0127aae4
2012-10-15 Eric Botcazou <ebotcazou@adacore.com>
* expr.c (expand_expr_real_1) <VIEW_CONVERT_EXPR>: Do not unnecessarily
copy the object in the MEM_P case.
2012-10-15 Richard Guenther <rguenther@suse.de> 2012-10-15 Richard Guenther <rguenther@suse.de>
* tree-streamer-out.c (streamer_pack_tree_bitfields): Back * tree-streamer-out.c (streamer_pack_tree_bitfields): Back
...@@ -37,7 +42,6 @@ ...@@ -37,7 +42,6 @@
(build_insn_chain): Use df_get_live_out instead of DF_LR_OUT. (build_insn_chain): Use df_get_live_out instead of DF_LR_OUT.
(do_reload): Remove the DF_LIVE problem for -O1. (do_reload): Remove the DF_LIVE problem for -O1.
2012-10-14 Steven Bosscher <steven@gcc.gnu.org> 2012-10-14 Steven Bosscher <steven@gcc.gnu.org>
PR rtl-optimization/54919 PR rtl-optimization/54919
...@@ -10270,10 +10270,15 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode, ...@@ -10270,10 +10270,15 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode,
{ {
enum insn_code icode; enum insn_code icode;
op0 = copy_rtx (op0);
if (TYPE_ALIGN_OK (type)) if (TYPE_ALIGN_OK (type))
set_mem_align (op0, MAX (MEM_ALIGN (op0), TYPE_ALIGN (type))); {
/* ??? Copying the MEM without substantially changing it might
run afoul of the code handling volatile memory references in
store_expr, which assumes that TARGET is returned unmodified
if it has been used. */
op0 = copy_rtx (op0);
set_mem_align (op0, MAX (MEM_ALIGN (op0), TYPE_ALIGN (type)));
}
else if (mode != BLKmode else if (mode != BLKmode
&& MEM_ALIGN (op0) < GET_MODE_ALIGNMENT (mode) && MEM_ALIGN (op0) < GET_MODE_ALIGNMENT (mode)
/* If the target does have special handling for unaligned /* If the target does have special handling for unaligned
......
2012-10-15 Eric Botcazou <ebotcazou@adacore.com>
* gnat.dg/unchecked_convert9.ad[sb]: New test.
2012-10-13 Jason Merrill <jason@redhat.com> 2012-10-13 Jason Merrill <jason@redhat.com>
* g++.dg/tls/thread_local7g.C: Require tls_native. * g++.dg/tls/thread_local7g.C: Require tls_native.
......
-- { dg-do compile }
-- { dg-options "-O -fdump-rtl-final" }
package body Unchecked_Convert9 is
procedure Proc is
L : Unsigned_32 := 16#55557777#;
begin
Var := Conv (L);
end;
end Unchecked_Convert9;
-- { dg-final { scan-rtl-dump-times "set \\(mem/v" 1 "final" } }
-- { dg-final { cleanup-rtl-dump "final" } }
with System;
with Ada.Unchecked_Conversion;
with Interfaces; use Interfaces;
package Unchecked_Convert9 is
type R is record
H : Unsigned_16;
L : Unsigned_16;
end record;
Var : R;
pragma Volatile (Var);
function Conv is new
Ada.Unchecked_Conversion (Source => Unsigned_32, Target => R);
procedure Proc;
end Unchecked_Convert9;
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