This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[lto] set alias info, poorly
- From: Nathan Froyd <froydnj at codesourcery dot com>
- To: gcc-patches at gcc dot gnu dot org
- Cc: zadeck at naturalbridge dot com
- Date: Thu, 6 Dec 2007 14:29:20 -0800
- Subject: [lto] set alias info, poorly
First, the good news about this patch: it fixes a few failing testcases.
The bad news is that it does it with a very heavy hammer. We say that
every type can alias every other type. Obviously this wreaks havoc with
all the clever alias analysis that has gone into GCC over the years.
There are better, cleverer, more involved ways that you could fix this.
But this demonstrably works right now. Ideas on what to do in the
future welcome.
Committed to the LTO branch.
-Nathan
2007-12-06 Nathan Froyd <froydnj@codesourcery.com>
* lto.c (lto_read_DIE): Set TYPE_ALIAS_SET where necessary.
Index: lto.c
===================================================================
--- lto.c (revision 130663)
+++ lto.c (working copy)
@@ -3253,7 +3253,13 @@ lto_read_DIE (lto_info_fd *fd, lto_conte
/* If this DIE refers to a type, cache the value so that future
references to the type can be processed quickly. */
if (val && TYPE_P (val))
- lto_cache_store_DIE (fd, die, val);
+ {
+ /* In the absence of a better solution, say that we alias
+ everything FIXME. */
+ TYPE_ALIAS_SET (val) = 0;
+
+ lto_cache_store_DIE (fd, die, val);
+ }
context->skip_non_parameters = saved_skip_non_parameters;
}