aboutsummaryrefslogtreecommitdiff
path: root/gcc/gimple.c
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@adacore.com>2010-05-26 17:57:30 +0000
committerEric Botcazou <ebotcazou@gcc.gnu.org>2010-05-26 17:57:30 +0000
commitc9549072bf0d3db00f8b89e4ed72d63e9eef3549 (patch)
treee7de8d484424021858dfc03cb0ea221d07c05c0b /gcc/gimple.c
parentdb94b0d8594de05c65ace54404d25739965162c7 (diff)
downloadgcc-c9549072bf0d3db00f8b89e4ed72d63e9eef3549.zip
gcc-c9549072bf0d3db00f8b89e4ed72d63e9eef3549.tar.gz
gcc-c9549072bf0d3db00f8b89e4ed72d63e9eef3549.tar.bz2
gimple.c (gimple_types_compatible_p): Return 0 for aggregate and pointer types if they have different alignment or mode.
* gimple.c (gimple_types_compatible_p): Return 0 for aggregate and pointer types if they have different alignment or mode. From-SVN: r159896
Diffstat (limited to 'gcc/gimple.c')
-rw-r--r--gcc/gimple.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/gcc/gimple.c b/gcc/gimple.c
index 07b91f8..759caf2 100644
--- a/gcc/gimple.c
+++ b/gcc/gimple.c
@@ -3299,8 +3299,7 @@ gimple_types_compatible_p (tree t1, tree t2)
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)
@@ -3334,6 +3333,14 @@ gimple_types_compatible_p (tree t1, tree t2)
/* 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. */