This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[lto]: patch committed to fix STRING_CSTs
- From: Kenneth Zadeck <zadeck at naturalbridge dot com>
- To: gcc-patches <gcc-patches at gcc dot gnu dot org>, Nathan Froyd <froydnj at codesourcery dot com>
- Date: Thu, 29 Nov 2007 11:05:20 -0500
- Subject: [lto]: patch committed to fix STRING_CSTs
STRING_CSTs almost always have types. The one case where this is left
out is for asm operands. This patch adds a type there so that the
serialization can be uniform.
2007-11-29 Kenneth Zadeck <zadeck@naturalbridge.com>
* lto-function-out.c (output_expr_operand): Fix STRING_CST to
always have type.
committed as revision 130515.
kenny
Index: lto-function-out.c
===================================================================
--- lto-function-out.c (revision 130513)
+++ lto-function-out.c (working copy)
@@ -1287,6 +1287,12 @@ output_expr_operand (struct output_block
case STRING_CST:
{
+ /* Most STRING_CSTs have a type when they get here. The ones
+ in the string operands of asms do not. Put something there
+ so that all STRING_CSTs can be handled uniformly. */
+ if (!TREE_TYPE (expr))
+ TREE_TYPE (expr) = void_type_node;
+
output_record_start (ob, expr, expr, LTO_string_cst);
output_string (ob, ob->main_stream,
TREE_STRING_POINTER (expr),