This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[lto] Fix gcc.c-torture/execute/20081112-1.c
- From: Diego Novillo <dnovillo at google dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Tue, 12 May 2009 22:13:22 -0400
- Subject: [lto] Fix gcc.c-torture/execute/20081112-1.c
This patch fixes streaming of _CST nodes that had overflown. The
first part is to stream the overflow bit. Additionally, when a
constant is read from disk it is replicated before applying any
flags to avoid overwriting shared constants.
This fixes gcc.c-torture/execute/20081112-1.c.
Tested on x86_64.
Diego.
* lto-tree-flags.def: Add public_flag for INTEGER_CSTs.
* lto-function-in.c (input_expr_operand): If there are
flags to be added on constants, create a copy of RESULT.
Index: lto-tree-flags.def
===================================================================
--- lto-tree-flags.def (revision 147448)
+++ lto-tree-flags.def (working copy)
@@ -415,6 +415,7 @@
START_EXPR_CASE (INTEGER_CST)
ADD_EXPR_FLAG (static_flag)
+ ADD_EXPR_FLAG (public_flag)
END_EXPR_CASE (INTEGER_CST)
START_EXPR_CASE (INTEGER_TYPE)
Index: lto-function-in.c
===================================================================
--- lto-function-in.c (revision 147448)
+++ lto-function-in.c (working copy)
@@ -916,7 +916,14 @@ input_expr_operand (struct lto_input_blo
LTO_DEBUG_UNDENT();
if (flags)
- process_tree_flags (result, flags);
+ {
+ /* If we need to set flags on a constant, make a copy to avoid
+ clobbering shared constants. */
+ if (CONSTANT_CLASS_P (result))
+ result = copy_node (result);
+
+ process_tree_flags (result, flags);
+ }
if (needs_line_set)
set_line_info (data_in, result);