Request walking the subtrees only, leaving the current is_lhs/val_only
untouched.
(convert_non_local_reference): Likewise.
testsuite/
* gnat.dg/lhs_view_convert.adb: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@125646
138bc75d-0d04-0410-961f-
82ee72b054a4
+2007-06-12 Olivier Hainque <hainque@adacore.com>
+
+ * tree-nested.c (convert_local_reference): Handle VIEW_CONVERT_EXPR.
+ Request walking the subtrees only, leaving the current is_lhs/val_only
+ untouched.
+ (convert_non_local_reference): Likewise.
+
2007-06-12 Nathan Sidwell <nathan@codesourcery.com>
* config/m68k/m68k-devices.def (52221, 52223, 5253): New.
+2007-06-12 Olivier Hainque <hainque@adacore.com>
+
+ * gnat.dg/lhs_view_convert.adb: New test.
+
2007-06-12 Richard Guenther <rguenther@suse.de>
PR tree-optimization/15353
--- /dev/null
+-- { dg-do run }
+-- { dg-options "-gnatp" }
+
+procedure Lhs_View_Convert is
+
+ type Root is tagged record
+ RV : Natural;
+ end record;
+
+ type Derived is new Root with null record;
+
+ Root_Instance : Root := (RV => 1);
+
+ Derived_Instance : Derived;
+
+ procedure Process is
+ X : Natural := Derived_Instance.RV;
+ begin
+ null;
+ end;
+begin
+ Derived_Instance.RV := 2;
+
+ Root (Derived_Instance) := Root (Root_Instance);
+
+ if Derived_Instance.RV /= Root_Instance.RV then
+ raise Program_Error;
+ end if;
+end;
walk_tree (tp, convert_nonlocal_reference, wi, NULL);
break;
+ case VIEW_CONVERT_EXPR:
+ /* Just request to look at the subtrees, leaving val_only and lhs
+ untouched. This might actually be for !val_only + lhs, in which
+ case we don't want to force a replacement by a temporary. */
+ *walk_subtrees = 1;
+ break;
+
case OMP_PARALLEL:
save_suppress = info->suppress_expansion;
if (convert_nonlocal_omp_clauses (&OMP_PARALLEL_CLAUSES (t), wi))
wi->val_only = save_val_only;
break;
+ case VIEW_CONVERT_EXPR:
+ /* Just request to look at the subtrees, leaving val_only and lhs
+ untouched. This might actually be for !val_only + lhs, in which
+ case we don't want to force a replacement by a temporary. */
+ *walk_subtrees = 1;
+ break;
+
case OMP_PARALLEL:
save_suppress = info->suppress_expansion;
if (convert_local_omp_clauses (&OMP_PARALLEL_CLAUSES (t), wi))