aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-sra.c
diff options
context:
space:
mode:
authorAlexandre Oliva <aoliva@redhat.com>2007-02-19 06:22:43 +0000
committerAlexandre Oliva <aoliva@gcc.gnu.org>2007-02-19 06:22:43 +0000
commit300471993fe5472c86b85b88557520c30f1309d7 (patch)
tree9c14c73a9f5cce53ef28763e3e2677afa2c79789 /gcc/tree-sra.c
parent3328fbb7d159cce61987d8ad4373aa2b95370291 (diff)
downloadgcc-300471993fe5472c86b85b88557520c30f1309d7.zip
gcc-300471993fe5472c86b85b88557520c30f1309d7.tar.gz
gcc-300471993fe5472c86b85b88557520c30f1309d7.tar.bz2
tree-sra.c (sra_build_assignment): Replace assertion checking with a comment explaining why it can't be done.
* tree-sra.c (sra_build_assignment): Replace assertion checking with a comment explaining why it can't be done. From-SVN: r122123
Diffstat (limited to 'gcc/tree-sra.c')
-rw-r--r--gcc/tree-sra.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/gcc/tree-sra.c b/gcc/tree-sra.c
index a392589..cb8f63d 100644
--- a/gcc/tree-sra.c
+++ b/gcc/tree-sra.c
@@ -1731,12 +1731,14 @@ generate_element_ref (struct sra_elt *elt)
static tree
sra_build_assignment (tree dst, tree src)
{
-#if 0 /* ENABLE_CHECKING */
- /* This test ought to pass, but it is unfortunately too strict for
- now. */
- gcc_assert (TYPE_CANONICAL (TYPE_MAIN_VARIANT (TREE_TYPE (dst)))
- == TYPE_CANONICAL (TYPE_MAIN_VARIANT (TREE_TYPE (src))));
-#endif
+ /* It was hoped that we could perform some type sanity checking
+ here, but since front-ends can emit accesses of fields in types
+ different from their nominal types and copy structures containing
+ them as a whole, we'd have to handle such differences here.
+ Since such accesses under different types require compatibility
+ anyway, there's little point in making tests and/or adding
+ conversions to ensure the types of src and dst are the same.
+ So we just assume type differences at this point are ok. */
return build2 (GIMPLE_MODIFY_STMT, void_type_node, dst, src);
}