1 $DragonFly: src/gnu/usr.bin/cc3/cc_int/patches/Attic/function.c.patch,v 1.1 2004/03/05 21:38:44 joerg Exp $
3 ===================================================================
4 RCS file: /cvs/src/contrib/gcc-3.3/gcc/function.c,v
5 retrieving revision 1.1
6 diff -u -r1.1 function.c
7 --- function.c 2 Feb 2004 23:09:47 -0000 1.1
8 +++ function.c 4 Mar 2004 15:18:33 -0000
11 #include "integrate.h"
12 #include "langhooks.h"
13 +#include "protector.h"
15 #ifndef TRAMPOLINE_ALIGNMENT
16 #define TRAMPOLINE_ALIGNMENT FUNCTION_BOUNDARY
18 /* Array of INSN_UIDs to hold the INSN_UIDs for each sibcall epilogue
20 static GTY(()) varray_type sibcall_epilogue;
22 +/* Current boundary mark for character arrays. */
23 +int temp_boundary_mark = 0;
26 /* In order to evaluate some expressions, such as function calls returning
27 structures in memory, we need to temporarily allocate stack locations.
29 /* The size of the slot, including extra space for alignment. This
30 info is for combine_temp_slots. */
31 HOST_WIDE_INT full_size;
32 + /* Boundary mark of a character array and the others. This info is for propolice */
36 /* This structure is used to record MEMs or pseudos used to replace VAR, any
38 whose lifetime is controlled by CLEANUP_POINT_EXPRs. KEEP is 3
39 if we are to allocate something at an inner level to be treated as
40 a variable in the block (e.g., a SAVE_EXPR).
41 + KEEP is 5 if we allocate a place to return structure.
43 TYPE is the type that will be used for the stack slot. */
47 struct temp_slot *p, *best_p = 0;
49 + int char_array = (flag_propolice_protection
50 + && keep == 1 && search_string_def (type));
52 /* If SIZE is -1 it means that somebody tried to allocate a temporary
53 of a variable size. */
56 && objects_must_conflict_p (p->type, type)
57 && (best_p == 0 || best_p->size > p->size
58 - || (best_p->size == p->size && best_p->align > p->align)))
59 + || (best_p->size == p->size && best_p->align > p->align))
60 + && (! char_array || p->boundary_mark != 0))
62 if (p->align == align && p->size == size)
67 p->type = best_p->type;
68 + p->boundary_mark = best_p->boundary_mark;
73 p->full_size = frame_offset - frame_offset_old;
76 + p->boundary_mark = char_array?++temp_boundary_mark:0;
82 if (! q->in_use && GET_MODE (q->slot) == BLKmode)
84 - if (p->base_offset + p->full_size == q->base_offset)
85 + if (p->base_offset + p->full_size == q->base_offset &&
86 + p->boundary_mark == q->boundary_mark)
88 /* Q comes after P; combine Q into P. */
90 p->full_size += q->full_size;
93 - else if (q->base_offset + q->full_size == p->base_offset)
94 + else if (q->base_offset + q->full_size == p->base_offset &&
95 + p->boundary_mark == q->boundary_mark)
97 /* P comes after Q; combine P into Q. */
100 new = func->x_parm_reg_stack_loc[regno];
103 - new = assign_stack_local_1 (decl_mode, GET_MODE_SIZE (decl_mode), 0, func);
105 + assign_stack_local_1 (decl_mode, GET_MODE_SIZE (decl_mode), 0, func):
106 + assign_stack_local_for_pseudo_reg (decl_mode, GET_MODE_SIZE (decl_mode), 0);
109 PUT_MODE (reg, decl_mode);
110 @@ -3982,7 +3999,8 @@
111 constant with that register. */
112 temp = gen_reg_rtx (Pmode);
114 - if (validate_change (object, &XEXP (x, 1), temp, 0))
115 + if (validate_change (object, &XEXP (x, 1), temp, 0)
116 + && ! flag_propolice_protection)
117 emit_insn_before (gen_move_insn (temp, new_offset), object);