* Re: [lto] patch committed to fix calls and FUNCTION_DECLS
2007-08-28 17:05 ` Diego Novillo
@ 2007-08-28 17:45 ` Kenneth Zadeck
0 siblings, 0 replies; 3+ messages in thread
From: Kenneth Zadeck @ 2007-08-28 17:45 UTC (permalink / raw)
To: Diego Novillo; +Cc: Jim Blandy, Mark Mitchell, gcc-patches, William Maddox
[-- Attachment #1: Type: text/plain, Size: 780 bytes --]
Diego Novillo wrote:
> On 8/28/07, Kenneth Zadeck <zadeck@naturalbridge.com> wrote:
>
>
>> 2007-08-28 Kenneth Zadeck <zadeck@naturalbridge.com>
>>
>> * lto-function-out (output_expr_operand): Reorder the fields
>> in the stream for CALL_EXPRs.
>> (lto_static_init): Do not put out types for FUNCTION_DECLs.
>>
>
> The patch is missing. Also, could you describe what those problems
> were? It tends to be useful when doing archeology in the future.
>
> Thanks.
>
Sorry,
The patch fixes two problems:
First, the order of the operands for CALL_EXPRs being output was not the
order that was expected when reading them back in.
Second, FUNCTION_DECLS were being serialized without a type but the
reader was expecting one. They do not need a type.
Kenny
[-- Attachment #2: postmerge7.diff --]
[-- Type: text/x-patch, Size: 1304 bytes --]
Index: lto-function-out.c
===================================================================
--- lto-function-out.c (revision 127862)
+++ lto-function-out.c (working copy)
@@ -1232,17 +1232,19 @@ output_expr_operand (struct output_block
{
unsigned int count = TREE_INT_CST_LOW (TREE_OPERAND (expr, 0));
unsigned int i;
- output_uleb128 (ob, count);
/* Operand 2 is the call chain. */
if (TREE_OPERAND (expr, 2))
{
output_record_start (ob, expr, expr, LTO_call_expr1);
+ output_uleb128 (ob, count);
output_expr_operand (ob, TREE_OPERAND (expr, 2));
}
else
- output_record_start (ob, expr, expr, LTO_call_expr0);
-
+ {
+ output_record_start (ob, expr, expr, LTO_call_expr0);
+ output_uleb128 (ob, count);
+ }
output_expr_operand (ob, TREE_OPERAND (expr, 1));
for (i = 3; i < count; i++)
output_expr_operand (ob, TREE_OPERAND (expr, i));
@@ -1869,6 +1871,7 @@ lto_static_init (void)
RESET_BIT (lto_types_needed_for, ASM_EXPR);
RESET_BIT (lto_types_needed_for, CASE_LABEL_EXPR);
RESET_BIT (lto_types_needed_for, FIELD_DECL);
+ RESET_BIT (lto_types_needed_for, FUNCTION_DECL);
RESET_BIT (lto_types_needed_for, GIMPLE_MODIFY_STMT);
RESET_BIT (lto_types_needed_for, LABEL_DECL);
RESET_BIT (lto_types_needed_for, LABEL_EXPR);
^ permalink raw reply [flat|nested] 3+ messages in thread