diff options
author | Richard Guenther <rguenther@suse.de> | 2011-05-30 14:55:03 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2011-05-30 14:55:03 +0000 |
commit | 17e99cdb2d3048641353093c53dd04e3e3f7e8aa (patch) | |
tree | a0ded474567f221de791b44b6555bfdd84406750 /gcc | |
parent | 42b05b6e884f5b14c3433f12593fe6accae5becf (diff) | |
download | gcc-17e99cdb2d3048641353093c53dd04e3e3f7e8aa.zip gcc-17e99cdb2d3048641353093c53dd04e3e3f7e8aa.tar.gz gcc-17e99cdb2d3048641353093c53dd04e3e3f7e8aa.tar.bz2 |
gimple.c (gimple_types_compatible_p_1): Compare record and union type members properly.
2011-05-30 Richard Guenther <rguenther@suse.de>
* gimple.c (gimple_types_compatible_p_1): Compare record
and union type members properly.
From-SVN: r174436
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/gimple.c | 12 |
2 files changed, 14 insertions, 3 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index ed73069..4a800f0 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,10 @@ 2011-05-30 Richard Guenther <rguenther@suse.de> + * gimple.c (gimple_types_compatible_p_1): Compare record + and union type members properly. + +2011-05-30 Richard Guenther <rguenther@suse.de> + PR tree-optimization/49210 * ipa-split.c (split_function): Care for the case where the call result is not trivially convertible to the result holding diff --git a/gcc/gimple.c b/gcc/gimple.c index e13b3ed..0cbd443 100644 --- a/gcc/gimple.c +++ b/gcc/gimple.c @@ -3772,10 +3772,16 @@ gimple_types_compatible_p_1 (tree t1, tree t2, type_pair_t p, f1 && f2; f1 = TREE_CHAIN (f1), f2 = TREE_CHAIN (f2)) { - /* The fields must have the same name, offset and type. */ + /* Different field kinds are not compatible. */ + if (TREE_CODE (f1) != TREE_CODE (f2)) + goto different_types; + /* Field decls must have the same name and offset. */ + if (TREE_CODE (f1) == FIELD_DECL + && (DECL_NONADDRESSABLE_P (f1) != DECL_NONADDRESSABLE_P (f2) + || !gimple_compare_field_offset (f1, f2))) + goto different_types; + /* All entities should have the same name and type. */ if (DECL_NAME (f1) != DECL_NAME (f2) - || DECL_NONADDRESSABLE_P (f1) != DECL_NONADDRESSABLE_P (f2) - || !gimple_compare_field_offset (f1, f2) || !gtc_visit (TREE_TYPE (f1), TREE_TYPE (f2), state, sccstack, sccstate, sccstate_obstack)) goto different_types; |