+2011-07-25 Richard Sandiford <richard.sandiford@linaro.org>
+
+ PR tree-optimization/49809
+ * tree-ssa-phiopt.c (cond_if_else_store_replacement): Use
+ gimple_get_lhs instead of gimple_assign_lhs.
+
2011-07-25 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
* system.h [__cplusplus]: Wrap C function declarations in extern "C".
+2011-07-25 Richard Sandiford <richard.sandiford@linaro.org>
+
+ PR tree-optimization/49809
+ * gnat.dg/opt18.adb, gnat.dg/opt18.ads, gnat.dg/opt18_pkg.ads: New
+ test.
+
2011-07-25 Richard Guenther <rguenther@suse.de>
PR tree-optimization/49715
--- /dev/null
+-- { dg-do compile }
+-- { dg-options "-O3" }
+
+with Opt18_Pkg; use Opt18_Pkg;
+
+package body Opt18 is
+
+ function Mag (Item : in Cart_Vector_Type) return Float is
+ begin
+ return Sqrt (Item (X) * Item (X) + Item (Y) * Item (Y)
+ + Item (Z) * Item (Z));
+ end;
+
+ function Unit_Quaternion_To_Mag_Axis (Quaternion : in Unit_Quaternion_Type)
+ return Mag_Axis_Type is
+ Sin_Half : Float
+ := Mag (Cart_Vector_Type'(Quaternion.X, Quaternion.Y, Quaternion.Z));
+ begin
+ if Sin_Half > 3.0 * First_Order_Trig then
+ return
+ (Mag => Atan2 (Double_Trig (Unchecked_Trig_Pair (Sin_Half,
+ Quaternion.S))),
+ Axis => Unit_Vector_Type'(Quaternion.X / Sin_Half,
+ Quaternion.Y / Sin_Half,
+ Quaternion.Z / Sin_Half));
+ else
+ return (0.0, X_Unit);
+ end if;
+ end;
+
+end Opt18;
--- /dev/null
+package Opt18 is
+
+ type Cart_Axis_Type is (X, Y, Z);
+
+ type Cart_Vector_Type is array (Cart_Axis_Type) of Float;
+
+ function Mag (Item : in Cart_Vector_Type) return Float;
+
+ type Unit_Vector_Type is array (Cart_Axis_Type) of Float;
+
+ type Mag_Axis_Type is
+ record
+ Mag : Float;
+ Axis : Unit_Vector_Type;
+ end record;
+
+ type Unit_Quaternion_Type is record
+ X : Float;
+ Y : Float;
+ Z : Float;
+ S : Float;
+ end record;
+
+ function Unit_Quaternion_To_Mag_Axis (Quaternion : in Unit_Quaternion_Type)
+ return Mag_Axis_Type;
+
+ X_Unit : constant Unit_Vector_Type := (1.0, 0.0, 0.0);
+
+end Opt18;
--- /dev/null
+package Opt18_Pkg is
+
+ pragma Pure;
+
+ type Limit_Type is record
+ Low : Float;
+ High : Float;
+ end record;
+
+ function First_Order_Trig return Float;
+
+ type Trig_Pair_Type is
+ record
+ Sin : Float;
+ Cos : Float;
+ end record;
+
+ function Atan2 (Trig : in Trig_Pair_Type) return Float;
+
+ function Unchecked_Trig_Pair (Sin, Cos : in Float) return Trig_Pair_Type;
+
+ function Double_Trig (Trig : in Trig_Pair_Type) return Trig_Pair_Type;
+
+ function Sqrt (X : Float) return Float;
+
+end Opt18_Pkg;
continue;
then_store = DR_STMT (then_dr);
- then_lhs = gimple_assign_lhs (then_store);
+ then_lhs = gimple_get_lhs (then_store);
found = false;
FOR_EACH_VEC_ELT (data_reference_p, else_datarefs, j, else_dr)
continue;
else_store = DR_STMT (else_dr);
- else_lhs = gimple_assign_lhs (else_store);
+ else_lhs = gimple_get_lhs (else_store);
if (operand_equal_p (then_lhs, else_lhs, 0))
{