1 diff -cr gcc-orig/cgraph.c gcc/cgraph.c
2 *** gcc-orig/cgraph.c Sat Apr 9 02:13:35 2005
3 --- gcc/cgraph.c Sat Dec 15 09:54:04 2007
7 cgraph_node (tree decl)
9 struct cgraph_node key, *node, **slot;
12 gcc_assert (TREE_CODE (decl) == FUNCTION_DECL);
16 node = cgraph_create_node ();
19 ! if (DECL_CONTEXT (decl) && TREE_CODE (DECL_CONTEXT (decl)) == FUNCTION_DECL)
21 ! node->origin = cgraph_node (DECL_CONTEXT (decl));
22 ! node->next_nested = node->origin->nested;
23 ! node->origin->nested = node;
28 node = cgraph_create_node ();
31 ! if (!DECL_NO_STATIC_CHAIN (decl))
33 ! context = decl_function_context (decl);
36 ! node->origin = cgraph_node (context);
37 ! node->next_nested = node->origin->nested;
38 ! node->origin->nested = node;
43 diff -cr gcc-orig/config/i386/i386.c gcc/config/i386/i386.c
44 *** gcc-orig/config/i386/i386.c Wed May 16 19:52:55 2007
45 --- gcc/config/i386/i386.c Sat Dec 15 09:54:04 2007
49 frame->red_zone_size = 0;
50 frame->to_allocate -= frame->red_zone_size;
51 frame->stack_pointer_offset -= frame->red_zone_size;
54 + /* As above, skip return address */
55 + frame->stack_pointer_offset = UNITS_PER_WORD;
58 fprintf (stderr, "nregs: %i\n", frame->nregs);
59 fprintf (stderr, "size: %i\n", size);
62 output_set_got (tmp, NULL_RTX);
65 ! output_asm_insn ("mov{l}\t{%0@GOT(%1), %1|%1, %0@GOT[%1]}", xops);
66 output_asm_insn ("jmp\t{*}%1", xops);
70 output_set_got (tmp, NULL_RTX);
73 ! output_asm_insn ("mov{l}\t{%a0@GOT(%1), %1|%1, %a0@GOT[%1]}", xops);
74 output_asm_insn ("jmp\t{*}%1", xops);
77 diff -cr gcc-orig/config/rs6000/rs6000.c gcc/config/rs6000/rs6000.c
78 *** gcc-orig/config/rs6000/rs6000.c Thu Jul 5 18:26:15 2007
79 --- gcc/config/rs6000/rs6000.c Sat Dec 15 09:54:04 2007
83 C is 0. Fortran is 1. Pascal is 2. Ada is 3. C++ is 9.
84 Java is 13. Objective-C is 14. */
85 ! if (! strcmp (language_string, "GNU C"))
87 else if (! strcmp (language_string, "GNU F77")
88 || ! strcmp (language_string, "GNU F95"))
91 C is 0. Fortran is 1. Pascal is 2. Ada is 3. C++ is 9.
92 Java is 13. Objective-C is 14. */
93 ! if (! strcmp (language_string, "GNU C") ||
94 ! ! strcmp (language_string, "GNU D"))
96 else if (! strcmp (language_string, "GNU F77")
97 || ! strcmp (language_string, "GNU F95"))
98 diff -cr gcc-orig/convert.c gcc/convert.c
99 *** gcc-orig/convert.c Thu Nov 2 12:43:32 2006
100 --- gcc/convert.c Sat Dec 15 09:54:04 2007
108 /* APPLE LOCAL begin AltiVec */
110 #include "c-common.h"
111 /* APPLE LOCAL end AltiVec */
114 #include "langhooks.h"
123 /* APPLE LOCAL begin AltiVec */
124 /* Build a COMPOUND_LITERAL_EXPR. TYPE is the type given in the compound
125 literal. INIT is a CONSTRUCTOR that initializes the compound literal. */
131 /* APPLE LOCAL end AltiVec */
134 /* Convert EXPR to the vector type TYPE in the usual ways. */
139 error ("can't convert between vector values of different size");
140 return error_mark_node;
143 /* APPLE LOCAL begin AltiVec */
144 if (TREE_CODE (type) == VECTOR_TYPE
145 && TREE_CODE (TREE_TYPE (expr)) == VECTOR_TYPE
149 /* converting a constant vector to new vector type with Motorola Syntax. */
150 return convert (type, build_compound_literal_vector (TREE_TYPE (expr), expr));
151 /* APPLE LOCAL end AltiVec */
154 /* APPLE LOCAL mainline 4253848 */
155 return build1 (VIEW_CONVERT_EXPR, type, expr);
156 diff -cr gcc-orig/dwarf2out.c gcc/dwarf2out.c
157 *** gcc-orig/dwarf2out.c Tue Mar 27 02:05:04 2007
158 --- gcc/dwarf2out.c Sat Dec 15 09:54:04 2007
161 /* APPLE LOCAL begin mainline 2006-03-24 4485597 */
162 return (lang == DW_LANG_C || lang == DW_LANG_C89 || lang == DW_LANG_ObjC
163 || lang == DW_LANG_C99
164 ! || lang == DW_LANG_C_plus_plus || lang == DW_LANG_ObjC_plus_plus);
165 /* APPLE LOCAL end mainline 2006-03-24 4485597 */
169 /* APPLE LOCAL begin mainline 2006-03-24 4485597 */
170 return (lang == DW_LANG_C || lang == DW_LANG_C89 || lang == DW_LANG_ObjC
171 || lang == DW_LANG_C99
172 ! || lang == DW_LANG_C_plus_plus || lang == DW_LANG_ObjC_plus_plus
173 ! || lang == DW_LANG_D);
174 /* APPLE LOCAL end mainline 2006-03-24 4485597 */
180 else if (strcmp (language_string, "GNU Objective-C++") == 0)
181 language = DW_LANG_ObjC_plus_plus;
182 /* APPLE LOCAL end mainline 2006-03-24 4485597 */
183 + else if (strcmp (language_string, "GNU D") == 0)
184 + language = DW_LANG_D;
186 language = DW_LANG_C89;
188 diff -cr gcc-orig/expr.c gcc/expr.c
189 *** gcc-orig/expr.c Tue Jul 3 15:11:00 2007
190 --- gcc/expr.c Sat Dec 15 09:54:04 2007
194 /* Lowered by gimplify.c. */
197 + case STATIC_CHAIN_EXPR:
198 + case STATIC_CHAIN_DECL:
199 + /* Lowered by tree-nested.c */
200 + gcc_unreachable ();
203 return get_exception_pointer (cfun);
205 diff -cr gcc-orig/function.c gcc/function.c
206 *** gcc-orig/function.c Tue Jun 19 12:30:52 2007
207 --- gcc/function.c Sat Dec 15 09:54:04 2007
210 FUNCTION_ARG_ADVANCE (all.args_so_far, data.promoted_mode,
211 data.passed_type, data.named_arg);
213 ! assign_parm_adjust_stack_rtl (&data);
215 if (assign_parm_setup_block_p (&data))
216 assign_parm_setup_block (&all, parm, &data);
218 FUNCTION_ARG_ADVANCE (all.args_so_far, data.promoted_mode,
219 data.passed_type, data.named_arg);
222 ! assign_parm_adjust_stack_rtl (&data);
224 if (assign_parm_setup_block_p (&data))
225 assign_parm_setup_block (&all, parm, &data);
229 /* Output all parameter conversion instructions (possibly including calls)
230 now that all parameters have been copied out of hard registers. */
231 ! emit_insn (all.conversion_insns);
233 /* If we are receiving a struct value address as the first argument, set up
234 the RTL for the function result. As this might require code to convert
237 /* Output all parameter conversion instructions (possibly including calls)
238 now that all parameters have been copied out of hard registers. */
240 ! emit_insn (all.conversion_insns);
242 /* If we are receiving a struct value address as the first argument, set up
243 the RTL for the function result. As this might require code to convert
247 struct assign_parm_data_all all;
248 tree fnargs, parm, stmts = NULL;
253 assign_parms_initialize_all (&all);
254 fnargs = assign_parms_augmented_arg_list (&all);
258 tree parm = cfun->static_chain_decl;
259 rtx local = gen_reg_rtx (Pmode);
261 - set_decl_incoming_rtl (parm, static_chain_incoming_rtx);
262 SET_DECL_RTL (parm, local);
263 mark_reg_pointer (local, TYPE_ALIGN (TREE_TYPE (TREE_TYPE (parm))));
265 ! emit_move_insn (local, static_chain_incoming_rtx);
268 /* If the function receives a non-local goto, then store the
270 tree parm = cfun->static_chain_decl;
271 rtx local = gen_reg_rtx (Pmode);
273 SET_DECL_RTL (parm, local);
274 mark_reg_pointer (local, TYPE_ALIGN (TREE_TYPE (TREE_TYPE (parm))));
276 ! if (! cfun->custom_static_chain)
278 ! set_decl_incoming_rtl (parm, static_chain_incoming_rtx);
279 ! emit_move_insn (local, static_chain_incoming_rtx);
281 ! /* else, the static chain will be set in the main body */
284 /* If the function receives a non-local goto, then store the
297 diff -cr gcc-orig/function.h gcc/function.h
298 *** gcc-orig/function.h Wed Jun 27 17:23:44 2007
299 --- gcc/function.h Sat Dec 15 10:19:28 2007
303 unsigned int calls_builtin_ret_addr : 1;
304 unsigned int calls_builtin_frame_addr : 1;
305 /* APPLE LOCAL end ARM reliable backtraces */
307 + /* Nonzero if static chain is initialized by something other than
308 + static_chain_incoming_rtx. */
309 + unsigned int custom_static_chain : 1;
311 + /* Nonzero if no code should be generated for prologues, copying
312 + parameters, etc. */
313 + unsigned int naked : 1;
316 /* The function currently being compiled. */
317 diff -cr gcc-orig/gcc.c gcc/gcc.c
318 *** gcc-orig/gcc.c Thu Jun 28 13:01:41 2007
319 --- gcc/gcc.c Sat Dec 15 09:54:05 2007
323 /* Flag set by cppspec.c to 1. */
326 + /* Flag set by drivers needing Pthreads. */
329 /* Flag saying to pass the greatest exit code returned by a sub-process
330 to the calling program. */
331 static int pass_exit_codes;
335 assembler has done its job.
336 %D Dump out a -L option for each directory in startfile_prefixes.
337 If multilib_dir is set, extra entries are generated with it affixed.
338 + %N Output the currently selected multilib directory name.
339 %l process LINK_SPEC as a spec.
340 %L process LIB_SPEC as a spec.
341 %G process LIBGCC_SPEC as a spec.
348 + #define GCC_SPEC_FORMAT_4 1
350 /* Record the mapping from file suffixes for compilation specs. */
362 if ((save_temps_flag || report_times) && use_pipes)
364 /* -save-temps overrides -pipe, so that temp files are produced */
373 + switches[n_switches].part1 = "pthread";
374 + switches[n_switches].args = 0;
375 + switches[n_switches].live_cond = SWITCH_OK;
376 + /* Do not print an error if there is not expansion for -pthread. */
377 + switches[n_switches].validated = 1;
378 + switches[n_switches].ordering = 0;
383 switches[n_switches].part1 = 0;
384 infiles[n_infiles].name = 0;
396 + obstack_grow (&obstack, "-fmultilib-dir=",
397 + strlen ("-fmultilib-dir="));
398 + obstack_grow (&obstack, multilib_dir,
399 + strlen (multilib_dir));
403 /* Here we define characters other than letters and digits. */
406 diff -cr gcc-orig/gcc.h gcc/gcc.h
407 *** gcc-orig/gcc.h Fri Mar 4 15:17:11 2005
408 --- gcc/gcc.h Sat Dec 15 09:54:05 2007
411 || (CHAR) == 'L' || (CHAR) == 'A' || (CHAR) == 'V' \
412 /* APPLE LOCAL frameworks */ \
414 ! || (CHAR) == 'B' || (CHAR) == 'b')
416 /* This defines which multi-letter switches take arguments. */
419 || (CHAR) == 'L' || (CHAR) == 'A' || (CHAR) == 'V' \
420 /* APPLE LOCAL frameworks */ \
422 ! || (CHAR) == 'B' || (CHAR) == 'b' || (CHAR) == 'J')
424 /* This defines which multi-letter switches take arguments. */
426 diff -cr gcc-orig/gimplify.c gcc/gimplify.c
427 *** gcc-orig/gimplify.c Mon Jun 18 18:03:55 2007
428 --- gcc/gimplify.c Sat Dec 15 09:54:05 2007
435 + case STATIC_CHAIN_EXPR:
436 + /* The argument is used as information only. No need to gimplify */
437 + case STATIC_CHAIN_DECL:
444 diff -cr gcc-orig/tree-dump.c gcc/tree-dump.c
445 *** gcc-orig/tree-dump.c Tue Feb 15 10:53:52 2005
446 --- gcc/tree-dump.c Sat Dec 15 09:54:05 2007
450 dump_child ("args", TREE_OPERAND (t, 1));
453 + case STATIC_CHAIN_EXPR:
454 + dump_child ("func", TREE_OPERAND (t, 0));
458 dump_child ("elts", CONSTRUCTOR_ELTS (t));
460 diff -cr gcc-orig/tree-gimple.c gcc/tree-gimple.c
461 *** gcc-orig/tree-gimple.c Sat Jul 9 18:14:08 2005
462 --- gcc/tree-gimple.c Sat Dec 15 09:54:05 2007
469 + case STATIC_CHAIN_EXPR: /* not sure if this is right...*/
470 + case STATIC_CHAIN_DECL:
476 || TREE_CODE (t) == WITH_SIZE_EXPR
477 /* These are complex lvalues, but don't have addresses, so they
479 ! || TREE_CODE (t) == BIT_FIELD_REF);
482 /* Return true if T is a GIMPLE condition. */
484 || TREE_CODE (t) == WITH_SIZE_EXPR
485 /* These are complex lvalues, but don't have addresses, so they
487 ! || TREE_CODE (t) == BIT_FIELD_REF
488 ! /* This is an lvalue because it will be replaced with the real
489 ! static chain decl. */
490 ! || TREE_CODE (t) == STATIC_CHAIN_DECL);
493 /* Return true if T is a GIMPLE condition. */
494 diff -cr gcc-orig/tree-inline.c gcc/tree-inline.c
495 *** gcc-orig/tree-inline.c Thu Jun 28 19:17:08 2007
496 --- gcc/tree-inline.c Sat Dec 15 09:54:05 2007
502 ! if (TREE_CODE (*tp) == MODIFY_EXPR
503 && TREE_OPERAND (*tp, 0) == TREE_OPERAND (*tp, 1)
504 && (lang_hooks.tree_inlining.auto_var_in_fn_p
505 (TREE_OPERAND (*tp, 0), fn)))
510 ! if (! id->cloning_p && ! id->saving_p &&
511 ! TREE_CODE (*tp) == MODIFY_EXPR &&
512 ! TREE_OPERAND (*tp, 0) ==
513 ! DECL_STRUCT_FUNCTION (fn)->static_chain_decl)
515 ! /* Don't use special methods to initialize the static chain
516 ! if expanding inline. If this code could somehow be
517 ! expanded in expand_start_function, it would not be
518 ! necessary to deal with it here. */
519 ! *tp = build_empty_stmt ();
521 ! else if (TREE_CODE (*tp) == MODIFY_EXPR
522 && TREE_OPERAND (*tp, 0) == TREE_OPERAND (*tp, 1)
523 && (lang_hooks.tree_inlining.auto_var_in_fn_p
524 (TREE_OPERAND (*tp, 0), fn)))
525 diff -cr gcc-orig/tree-nested.c gcc/tree-nested.c
526 *** gcc-orig/tree-nested.c Mon Aug 8 15:02:59 2005
527 --- gcc/tree-nested.c Sat Dec 15 09:54:05 2007
534 + enum tree_code code;
536 type = get_frame_type (info->outer);
537 type = build_pointer_type (type);
540 Note also that it's represented as a parameter. This is more
541 close to the truth, since the initial value does come from
543 ! decl = build_decl (PARM_DECL, create_tmp_var_name ("CHAIN"), type);
544 DECL_ARTIFICIAL (decl) = 1;
545 DECL_IGNORED_P (decl) = 1;
546 TREE_USED (decl) = 1;
547 DECL_CONTEXT (decl) = info->context;
548 ! DECL_ARG_TYPE (decl) = type;
550 /* Tell tree-inline.c that we never write to this variable, so
551 it can copy-prop the replacement value immediately. */
553 Note also that it's represented as a parameter. This is more
554 close to the truth, since the initial value does come from
556 ! /* If the function has a custom static chain, a VAR_DECL is more
558 ! code = DECL_STRUCT_FUNCTION (info->context)->custom_static_chain ?
559 ! VAR_DECL : PARM_DECL;
560 ! decl = build_decl (code, create_tmp_var_name ("CHAIN"), type);
561 DECL_ARTIFICIAL (decl) = 1;
562 DECL_IGNORED_P (decl) = 1;
563 TREE_USED (decl) = 1;
564 DECL_CONTEXT (decl) = info->context;
565 ! if (TREE_CODE (decl) == PARM_DECL)
566 ! DECL_ARG_TYPE (decl) = type;
568 /* Tell tree-inline.c that we never write to this variable, so
569 it can copy-prop the replacement value immediately. */
574 if (info->context == target_context)
576 + /* might be doing something wrong to need the following line.. */
577 + get_frame_type (info);
578 x = build_addr (info->frame_decl);
584 if (DECL_NO_STATIC_CHAIN (decl))
587 + /* Don't use a trampoline for a static reference. */
588 + if (TREE_STATIC (t))
591 /* Lookup the immediate parent of the callee, as that's where
592 we need to insert the trampoline. */
593 for (i = info; i->context != target_context; i = i->outer)
597 = get_static_chain (info, target_context, &wi->tsi);
600 + case STATIC_CHAIN_EXPR:
601 + *tp = get_static_chain (info, TREE_OPERAND (t, 0), &wi->tsi);
604 + case STATIC_CHAIN_DECL:
605 + *tp = get_chain_decl (info);
613 tree x = build (COMPONENT_REF, TREE_TYPE (root->chain_field),
614 root->frame_decl, root->chain_field, NULL_TREE);
615 x = build (MODIFY_EXPR, TREE_TYPE (x), x, get_chain_decl (root));
616 ! append_to_statement_list (x, &stmt_list);
619 /* If trampolines were created, then we need to initialize them. */
621 tree x = build (COMPONENT_REF, TREE_TYPE (root->chain_field),
622 root->frame_decl, root->chain_field, NULL_TREE);
623 x = build (MODIFY_EXPR, TREE_TYPE (x), x, get_chain_decl (root));
624 ! /* If the function has a custom static chain, chain_field must
625 ! be set after the static chain. */
626 ! if (DECL_STRUCT_FUNCTION (root->context)->custom_static_chain)
628 ! /* Should use walk_function instead. */
629 ! tree_stmt_iterator i =
630 ! tsi_start ( BIND_EXPR_BODY (DECL_SAVED_TREE (context)));
631 ! while (!tsi_end_p (i))
633 ! tree t = tsi_stmt (i);
634 ! if (TREE_CODE (t) == MODIFY_EXPR &&
635 ! TREE_OPERAND (t, 0) == root->chain_decl)
637 ! tsi_link_after(& i, x, TSI_SAME_STMT);
642 ! gcc_assert(x == NULL_TREE);
645 ! append_to_statement_list (x, &stmt_list);
648 /* If trampolines were created, then we need to initialize them. */
649 diff -cr gcc-orig/tree-pretty-print.c gcc/tree-pretty-print.c
650 *** gcc-orig/tree-pretty-print.c Thu Dec 9 05:54:50 2004
651 --- gcc/tree-pretty-print.c Sat Dec 15 09:54:05 2007
655 pp_string (buffer, " [tail call]");
658 + case STATIC_CHAIN_EXPR:
659 + pp_string (buffer, "<<static chain of ");
660 + dump_generic_node (buffer, TREE_OPERAND (node, 0), spc, flags, false);
661 + pp_string (buffer, ">>");
664 + case STATIC_CHAIN_DECL:
665 + pp_string (buffer, "<<static chain decl>>");
668 case WITH_CLEANUP_EXPR:
671 diff -cr gcc-orig/tree-sra.c gcc/tree-sra.c
672 *** gcc-orig/tree-sra.c Sat May 19 00:56:18 2007
673 --- gcc-orig/tree-sra.c Fri Mar 7 13:43:03 2008
679 bool saw_one_field = false;
680 + tree last_offset = size_zero_node;
683 for (t = TYPE_FIELDS (type); t ; t = TREE_CHAIN (t))
684 if (TREE_CODE (t) == FIELD_DECL)
688 && (tree_low_cst (DECL_SIZE (t), 1)
689 != TYPE_PRECISION (TREE_TYPE (t))))
691 + /* Reject aliased fields created by GDC for anonymous unions. */
692 + cmp = fold_binary_to_constant (LE_EXPR, boolean_type_node,
693 + DECL_FIELD_OFFSET (t), last_offset);
694 + if (cmp == NULL_TREE || TREE_CODE (cmp) != INTEGER_CST || TREE_INT_CST_LOW (cmp))
697 saw_one_field = true;
699 diff -cr gcc-orig/tree.def gcc/tree.def
700 *** gcc-orig/tree.def Mon Oct 3 16:31:24 2005
701 --- gcc/tree.def Sat Dec 15 09:54:05 2007
705 Operand 2 is the static chain argument, or NULL. */
706 DEFTREECODE (CALL_EXPR, "call_expr", tcc_expression, 3)
708 + /* Operand 0 is the FUNC_DECL of the outer function for
709 + which the static chain is to be computed. */
710 + DEFTREECODE (STATIC_CHAIN_EXPR, "static_chain_expr", tcc_expression, 1)
712 + /* Represents a function's static chain. It can be used as an lvalue. */
713 + DEFTREECODE (STATIC_CHAIN_DECL, "static_chain_decl", tcc_expression, 0)
715 /* Specify a value to compute along with its corresponding cleanup.
716 Operand 0 is the cleanup expression.
717 The cleanup is executed by the first enclosing CLEANUP_POINT_EXPR,
721 /* APPLE LOCAL begin AV vmul_uch --haifa */
722 /* Used during vectorization to represent computation idioms. */
723 ! DEFTREECODE (MULT_UCH_EXPR, "mult_uch", '2', 2)
724 /* APPLE LOCAL end AV vmul_uch --haifa */
726 /* Value handles. Artificial nodes to represent expressions in
729 /* APPLE LOCAL begin AV vmul_uch --haifa */
730 /* Used during vectorization to represent computation idioms. */
731 ! DEFTREECODE (MULT_UCH_EXPR, "mult_uch", tcc_binary, 2)
732 /* APPLE LOCAL end AV vmul_uch --haifa */
734 /* Value handles. Artificial nodes to represent expressions in