diff options
author | Jan Hubicka <jh@suse.cz> | 2012-10-08 18:04:31 +0200 |
---|---|---|
committer | Jan Hubicka <hubicka@gcc.gnu.org> | 2012-10-08 16:04:31 +0000 |
commit | 2512a443d6c09f42c24dca5dfd4173cdef39c3b1 (patch) | |
tree | 88f8e127758fe18f6fb4dfd8a141d59f86238060 /gcc | |
parent | 7b19209f2934c0ac28445ff2032747552a390f2f (diff) | |
download | gcc-2512a443d6c09f42c24dca5dfd4173cdef39c3b1.zip gcc-2512a443d6c09f42c24dca5dfd4173cdef39c3b1.tar.gz gcc-2512a443d6c09f42c24dca5dfd4173cdef39c3b1.tar.bz2 |
lto.c (remember_with_vars): Also fixup INTEGER_CST.
* lto/lto.c (remember_with_vars): Also fixup INTEGER_CST.
(fixup_integer_cst): New functoin.
(lto_ft_type): Fixup BASETYPE of methods and offsets.
From-SVN: r192214
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/lto/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/lto/lto.c | 25 |
2 files changed, 31 insertions, 0 deletions
diff --git a/gcc/lto/ChangeLog b/gcc/lto/ChangeLog index 7218f48..3fc7136 100644 --- a/gcc/lto/ChangeLog +++ b/gcc/lto/ChangeLog @@ -1,3 +1,9 @@ +2012-10-08 Jan Hubicka <jh@suse.cz> + + * lto/lto.c (remember_with_vars): Also fixup INTEGER_CST. + (fixup_integer_cst): New functoin. + (lto_ft_type): Fixup BASETYPE of methods and offsets. + 2012-10-07 Jan Hubicka <jh@suse.cz> * lto.c (read_cgraph_and_symbols): Release type merging hash early; diff --git a/gcc/lto/lto.c b/gcc/lto/lto.c index d880c8a..81d7fb3 100644 --- a/gcc/lto/lto.c +++ b/gcc/lto/lto.c @@ -1408,11 +1408,36 @@ remember_with_vars (tree t) (tt) = GIMPLE_REGISTER_TYPE (tt); \ if (VAR_OR_FUNCTION_DECL_P (tt) && TREE_PUBLIC (tt)) \ remember_with_vars (t); \ + if (TREE_CODE (tt) == INTEGER_CST) \ + (tt) = fixup_integer_cst (tt); \ } \ } while (0) static void lto_fixup_types (tree); +/* Return integer_cst T with updated type. */ + +static tree +fixup_integer_cst (tree t) +{ + tree type = GIMPLE_REGISTER_TYPE (TREE_TYPE (t)); + + if (type == TREE_TYPE (t)) + return t; + + /* If overflow was set, streamer_read_integer_cst + produced local copy of T. */ + if (TREE_OVERFLOW (t)) + { + TREE_TYPE (t) = type; + return t; + } + else + /* Otherwise produce new shared node for the new type. */ + return build_int_cst_wide (type, TREE_INT_CST_LOW (t), + TREE_INT_CST_HIGH (t)); +} + /* Fix up fields of a tree_typed T. */ static void |