+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>
* tree-streamer-out.c (streamer_pack_tree_bitfields): Back
(build_insn_chain): Use df_get_live_out instead of DF_LR_OUT.
(do_reload): Remove the DF_LIVE problem for -O1.
-
2012-10-14 Steven Bosscher <steven@gcc.gnu.org>
PR rtl-optimization/54919
{
enum insn_code icode;
- op0 = copy_rtx (op0);
-
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
&& MEM_ALIGN (op0) < GET_MODE_ALIGNMENT (mode)
/* 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>
* g++.dg/tls/thread_local7g.C: Require tls_native.
--- /dev/null
+-- { 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" } }
--- /dev/null
+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;