summaryrefslogtreecommitdiff
path: root/gcc/gimple.c
diff options
context:
space:
mode:
authorebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4>2010-05-26 17:57:30 +0000
committerebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4>2010-05-26 17:57:30 +0000
commit895241b460d4ca6822a2d44b6b2dca7e486a2ad4 (patch)
treee7de8d484424021858dfc03cb0ea221d07c05c0b /gcc/gimple.c
parentc03b5ae801800b3857ce83b544a1d42b16412eb7 (diff)
downloadgcc-895241b460d4ca6822a2d44b6b2dca7e486a2ad4.tar.gz
* gimple.c (gimple_types_compatible_p): Return 0 for aggregate and
pointer types if they have different alignment or mode. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@159896 138bc75d-0d04-0410-961f-82ee72b054a4
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 07b91f81dc5..759caf2e0c3 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. */