+2010-05-26 Eric Botcazou <ebotcazou@adacore.com>
+
+ * gimple.c (gimple_types_compatible_p): Return 0 for aggregate and
+ pointer types if they have different alignment or mode.
+
2010-05-26 Anatoly Sokolov <aesok@post.ru>
* config/sparc/sparc.h (FUNCTION_VALUE, FUNCTION_OUTGOING_VALUE,
if (TREE_CODE (t1) == VOID_TYPE)
return 1;
- /* For numerical types do some simple checks before doing three
- hashtable queries. */
+ /* Do some simple checks before doing three hashtable queries. */
if (INTEGRAL_TYPE_P (t1)
|| SCALAR_FLOAT_TYPE_P (t1)
|| FIXED_POINT_TYPE_P (t1)
/* For integral types fall thru to more complex checks. */
}
+ else if (AGGREGATE_TYPE_P (t1) || POINTER_TYPE_P (t1))
+ {
+ /* Can't be the same type if they have different alignment or mode. */
+ if (TYPE_ALIGN (t1) != TYPE_ALIGN (t2)
+ || TYPE_MODE (t1) != TYPE_MODE (t2))
+ return 0;
+ }
+
/* If the hash values of t1 and t2 are different the types can't
possibly be the same. This helps keeping the type-pair hashtable
small, only tracking comparisons for hash collisions. */
+2010-05-26 Eric Botcazou <ebotcazou@adacore.com>
+
+ * gnat.dg/lto10.adb: New test.
+ * gnat.dg/lto10_pkg.ads: New helper.
+
2010-05-26 Kai Tietz <kai.tietz@onevision.com>
* lib/target-supports.exp (check_effective_target_int128): New
--- /dev/null
+-- { dg-do run }
+-- { dg-options "-flto" { target lto } }
+
+with Lto10_Pkg; use Lto10_Pkg;
+
+procedure Lto10 is
+ A : Integer := Minus_One;
+ Pos : Position;
+begin
+ Pos := Pix.Pos;
+ if A /= Minus_One then
+ raise Program_Error;
+ end if;
+end;
--- /dev/null
+package Lto10_Pkg is
+
+ type U16 is mod 2 ** 16;
+
+ type Position is record
+ X, Y, Z : U16;
+ end record;
+ for Position'Size use 48;
+
+ type Pixel is record
+ Pos : Position;
+ end record;
+ pragma Pack (Pixel);
+
+ Minus_One : Integer := -1;
+ Pix : Pixel := (Pos => (X => 0, Y => 0, Z => 0));
+
+end Lto10_Pkg;