1 diff -cr gcc-orig/cgraph.c gcc/cgraph.c
2 *** gcc-orig/cgraph.c Tue Mar 29 15:40:43 2005
3 --- gcc/cgraph.c Fri Nov 4 13:51:39 2005
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 Tue Sep 6 20:03:18 2005
45 --- gcc/config/i386/i386.c Fri Nov 4 13:51:39 2005
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);
65 ! output_asm_insn ("mov{l}\t{%0@GOT(%1), %1|%1, %0@GOT[%1]}", xops);
66 output_asm_insn ("jmp\t{*}%1", xops);
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 Mon Sep 12 14:45:00 2005
79 --- gcc/config/rs6000/rs6000.c Fri Nov 4 13:51:39 2005
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"))
100 diff -cr gcc-orig/dwarf2.h gcc/dwarf2.h
101 *** gcc-orig/dwarf2.h Wed Oct 6 20:27:15 2004
102 --- gcc/dwarf2.h Fri Nov 4 13:51:39 2005
106 DW_LANG_C99 = 0x000c,
107 DW_LANG_Ada95 = 0x000d,
108 DW_LANG_Fortran95 = 0x000e,
109 + DW_LANG_D = 0x0013,
111 DW_LANG_Mips_Assembler = 0x8001,
113 diff -cr gcc-orig/dwarf2out.c gcc/dwarf2out.c
114 *** gcc-orig/dwarf2out.c Thu Sep 1 14:04:38 2005
115 --- gcc/dwarf2out.c Fri Nov 4 13:51:39 2005
118 unsigned int lang = get_AT_unsigned (comp_unit_die, DW_AT_language);
120 return (lang == DW_LANG_C || lang == DW_LANG_C89
121 ! || lang == DW_LANG_C_plus_plus);
124 /* Return TRUE if the language is C++. */
126 unsigned int lang = get_AT_unsigned (comp_unit_die, DW_AT_language);
128 return (lang == DW_LANG_C || lang == DW_LANG_C89
129 ! || lang == DW_LANG_C_plus_plus
130 ! || lang == DW_LANG_D);
133 /* Return TRUE if the language is C++. */
137 language = DW_LANG_Pascal83;
138 else if (strcmp (language_string, "GNU Java") == 0)
139 language = DW_LANG_Java;
140 + else if (strcmp (language_string, "GNU D") == 0)
141 + language = DW_LANG_D;
143 language = DW_LANG_C89;
145 diff -cr gcc-orig/expr.c gcc/expr.c
146 *** gcc-orig/expr.c Sat Sep 10 01:03:28 2005
147 --- gcc/expr.c Fri Nov 4 13:51:39 2005
151 /* Lowered by gimplify.c. */
154 + case STATIC_CHAIN_EXPR:
155 + case STATIC_CHAIN_DECL:
156 + /* Lowered by tree-nested.c */
157 + gcc_unreachable ();
160 return get_exception_pointer (cfun);
162 diff -cr gcc-orig/function.c gcc/function.c
163 *** gcc-orig/function.c Thu Mar 10 15:11:04 2005
164 --- gcc/function.c Fri Nov 4 13:51:42 2005
167 FUNCTION_ARG_ADVANCE (all.args_so_far, data.promoted_mode,
168 data.passed_type, data.named_arg);
170 ! assign_parm_adjust_stack_rtl (&data);
172 if (assign_parm_setup_block_p (&data))
173 assign_parm_setup_block (&all, parm, &data);
175 FUNCTION_ARG_ADVANCE (all.args_so_far, data.promoted_mode,
176 data.passed_type, data.named_arg);
179 ! assign_parm_adjust_stack_rtl (&data);
181 if (assign_parm_setup_block_p (&data))
182 assign_parm_setup_block (&all, parm, &data);
186 /* Output all parameter conversion instructions (possibly including calls)
187 now that all parameters have been copied out of hard registers. */
188 ! emit_insn (all.conversion_insns);
190 /* If we are receiving a struct value address as the first argument, set up
191 the RTL for the function result. As this might require code to convert
194 /* Output all parameter conversion instructions (possibly including calls)
195 now that all parameters have been copied out of hard registers. */
197 ! emit_insn (all.conversion_insns);
199 /* If we are receiving a struct value address as the first argument, set up
200 the RTL for the function result. As this might require code to convert
204 struct assign_parm_data_all all;
205 tree fnargs, parm, stmts = NULL;
210 assign_parms_initialize_all (&all);
211 fnargs = assign_parms_augmented_arg_list (&all);
215 tree parm = cfun->static_chain_decl;
216 rtx local = gen_reg_rtx (Pmode);
218 - set_decl_incoming_rtl (parm, static_chain_incoming_rtx);
219 SET_DECL_RTL (parm, local);
220 mark_reg_pointer (local, TYPE_ALIGN (TREE_TYPE (TREE_TYPE (parm))));
222 ! emit_move_insn (local, static_chain_incoming_rtx);
225 /* If the function receives a non-local goto, then store the
227 tree parm = cfun->static_chain_decl;
228 rtx local = gen_reg_rtx (Pmode);
230 SET_DECL_RTL (parm, local);
231 mark_reg_pointer (local, TYPE_ALIGN (TREE_TYPE (TREE_TYPE (parm))));
233 ! if (! cfun->custom_static_chain)
235 ! set_decl_incoming_rtl (parm, static_chain_incoming_rtx);
236 ! emit_move_insn (local, static_chain_incoming_rtx);
238 ! /* else, the static chain will be set in the main body */
241 /* If the function receives a non-local goto, then store the
254 diff -cr gcc-orig/function.h gcc/function.h
255 *** gcc-orig/function.h Sun Feb 20 11:09:16 2005
256 --- gcc/function.h Fri Nov 4 13:51:42 2005
261 /* Nonzero if code to initialize arg_pointer_save_area has been emitted. */
262 unsigned int arg_pointer_save_area_init : 1;
264 + /* Nonzero if static chain is initialized by something other than
265 + static_chain_incoming_rtx. */
266 + unsigned int custom_static_chain : 1;
268 + /* Nonzero if no code should be generated for prologues, copying
269 + parameters, etc. */
270 + unsigned int naked : 1;
273 /* The function currently being compiled. */
274 diff -cr gcc-orig/gcc.c gcc/gcc.c
275 *** gcc-orig/gcc.c Sat Jan 21 13:38:48 2006
276 --- gcc/gcc.c Thu Mar 1 10:34:32 2007
280 /* Flag set by cppspec.c to 1. */
283 + /* Flag set by drivers needing Pthreads. */
286 /* Flag saying to pass the greatest exit code returned by a sub-process
287 to the calling program. */
288 static int pass_exit_codes;
292 assembler has done its job.
293 %D Dump out a -L option for each directory in startfile_prefixes.
294 If multilib_dir is set, extra entries are generated with it affixed.
295 + %N Output the currently selected multilib directory name.
296 %l process LINK_SPEC as a spec.
297 %L process LIB_SPEC as a spec.
298 %G process LIBGCC_SPEC as a spec.
305 + #define GCC_SPEC_FORMAT_4 1
307 /* Record the mapping from file suffixes for compilation specs. */
319 if ((save_temps_flag || report_times) && use_pipes)
321 /* -save-temps overrides -pipe, so that temp files are produced */
330 + switches[n_switches].part1 = "pthread";
331 + switches[n_switches].args = 0;
332 + switches[n_switches].live_cond = SWITCH_OK;
333 + /* Do not print an error if there is not expansion for -pthread. */
334 + switches[n_switches].validated = 1;
335 + switches[n_switches].ordering = 0;
340 switches[n_switches].part1 = 0;
341 infiles[n_infiles].name = 0;
353 + obstack_grow (&obstack, "-fmultilib-dir=",
354 + strlen ("-fmultilib-dir="));
355 + obstack_grow (&obstack, multilib_dir,
356 + strlen (multilib_dir));
360 /* Here we define characters other than letters and digits. */
363 diff -cr gcc-orig/gcc.c gcc/gcc.h
364 *** gcc-orig/gcc.h Fri Jun 24 22:02:01 2005
365 --- gcc/gcc.h Sun Mar 4 13:44:05 2007
368 || (CHAR) == 'e' || (CHAR) == 'T' || (CHAR) == 'u' \
369 || (CHAR) == 'I' || (CHAR) == 'm' || (CHAR) == 'x' \
370 || (CHAR) == 'L' || (CHAR) == 'A' || (CHAR) == 'V' \
371 ! || (CHAR) == 'B' || (CHAR) == 'b')
373 /* This defines which multi-letter switches take arguments. */
376 || (CHAR) == 'e' || (CHAR) == 'T' || (CHAR) == 'u' \
377 || (CHAR) == 'I' || (CHAR) == 'm' || (CHAR) == 'x' \
378 || (CHAR) == 'L' || (CHAR) == 'A' || (CHAR) == 'V' \
379 ! || (CHAR) == 'B' || (CHAR) == 'b' || (CHAR) == 'J')
381 /* This defines which multi-letter switches take arguments. */
383 diff -cr gcc-orig/gimplify.c gcc/gimplify.c
384 *** gcc-orig/gimplify.c Fri Sep 2 15:34:38 2005
385 --- gcc/gimplify.c Fri Nov 4 13:51:43 2005
392 + case STATIC_CHAIN_EXPR:
393 + /* The argument is used as information only. No need to gimplify */
394 + case STATIC_CHAIN_DECL:
401 diff -cr gcc-orig/tree-dump.c gcc/tree-dump.c
402 *** gcc-orig/tree-dump.c Tue Aug 23 07:39:43 2005
403 --- gcc/tree-dump.c Fri Nov 4 13:51:43 2005
407 dump_child ("args", TREE_OPERAND (t, 1));
410 + case STATIC_CHAIN_EXPR:
411 + dump_child ("func", TREE_OPERAND (t, 0));
415 dump_child ("elts", CONSTRUCTOR_ELTS (t));
417 diff -cr gcc-orig/tree-gimple.c gcc/tree-gimple.c
418 *** gcc-orig/tree-gimple.c Sat May 21 16:58:33 2005
419 --- gcc/tree-gimple.c Fri Nov 4 13:51:43 2005
426 + case STATIC_CHAIN_EXPR: /* not sure if this is right...*/
427 + case STATIC_CHAIN_DECL:
433 || TREE_CODE (t) == WITH_SIZE_EXPR
434 /* These are complex lvalues, but don't have addresses, so they
436 ! || TREE_CODE (t) == BIT_FIELD_REF);
439 /* Return true if T is a GIMPLE condition. */
441 || TREE_CODE (t) == WITH_SIZE_EXPR
442 /* These are complex lvalues, but don't have addresses, so they
444 ! || TREE_CODE (t) == BIT_FIELD_REF
445 ! /* This is an lvalue because it will be replaced with the real
446 ! static chain decl. */
447 ! || TREE_CODE (t) == STATIC_CHAIN_DECL);
450 /* Return true if T is a GIMPLE condition. */
451 diff -cr gcc-orig/tree-inline.c gcc/tree-inline.c
452 *** gcc-orig/tree-inline.c Fri Jul 8 23:38:56 2005
453 --- gcc/tree-inline.c Fri Nov 4 15:08:11 2005
459 ! if (TREE_CODE (*tp) == MODIFY_EXPR
460 && TREE_OPERAND (*tp, 0) == TREE_OPERAND (*tp, 1)
461 && (lang_hooks.tree_inlining.auto_var_in_fn_p
462 (TREE_OPERAND (*tp, 0), fn)))
467 ! if (! id->cloning_p && ! id->saving_p &&
468 ! TREE_CODE (*tp) == MODIFY_EXPR &&
469 ! TREE_OPERAND (*tp, 0) ==
470 ! DECL_STRUCT_FUNCTION (fn)->static_chain_decl)
472 ! /* Don't use special methods to initialize the static chain
473 ! if expanding inline. If this code could somehow be
474 ! expanded in expand_start_function, it would not be
475 ! necessary to deal with it here. */
476 ! *tp = build_empty_stmt ();
478 ! else if (TREE_CODE (*tp) == MODIFY_EXPR
479 && TREE_OPERAND (*tp, 0) == TREE_OPERAND (*tp, 1)
480 && (lang_hooks.tree_inlining.auto_var_in_fn_p
481 (TREE_OPERAND (*tp, 0), fn)))
482 diff -cr gcc-orig/tree-nested.c gcc/tree-nested.c
483 *** gcc-orig/tree-nested.c Mon Oct 3 18:01:55 2005
484 --- gcc/tree-nested.c Thu Jun 8 22:26:01 2006
491 + enum tree_code code;
493 type = get_frame_type (info->outer);
494 type = build_pointer_type (type);
497 Note also that it's represented as a parameter. This is more
498 close to the truth, since the initial value does come from
500 ! decl = build_decl (PARM_DECL, create_tmp_var_name ("CHAIN"), type);
501 DECL_ARTIFICIAL (decl) = 1;
502 DECL_IGNORED_P (decl) = 1;
503 TREE_USED (decl) = 1;
504 DECL_CONTEXT (decl) = info->context;
505 ! DECL_ARG_TYPE (decl) = type;
507 /* Tell tree-inline.c that we never write to this variable, so
508 it can copy-prop the replacement value immediately. */
510 Note also that it's represented as a parameter. This is more
511 close to the truth, since the initial value does come from
513 ! /* If the function has a custom static chain, a VAR_DECL is more
515 ! code = DECL_STRUCT_FUNCTION (info->context)->custom_static_chain ?
516 ! VAR_DECL : PARM_DECL;
517 ! decl = build_decl (code, create_tmp_var_name ("CHAIN"), type);
518 DECL_ARTIFICIAL (decl) = 1;
519 DECL_IGNORED_P (decl) = 1;
520 TREE_USED (decl) = 1;
521 DECL_CONTEXT (decl) = info->context;
522 ! if (TREE_CODE (decl) == PARM_DECL)
523 ! DECL_ARG_TYPE (decl) = type;
525 /* Tell tree-inline.c that we never write to this variable, so
526 it can copy-prop the replacement value immediately. */
531 if (info->context == target_context)
533 + /* might be doing something wrong to need the following line.. */
534 + get_frame_type (info);
535 x = build_addr (info->frame_decl);
541 if (DECL_NO_STATIC_CHAIN (decl))
544 + /* Don't use a trampoline for a static reference. */
545 + if (TREE_STATIC (t))
548 /* Lookup the immediate parent of the callee, as that's where
549 we need to insert the trampoline. */
550 for (i = info; i->context != target_context; i = i->outer)
554 = get_static_chain (info, target_context, &wi->tsi);
557 + case STATIC_CHAIN_EXPR:
558 + *tp = get_static_chain (info, TREE_OPERAND (t, 0), &wi->tsi);
561 + case STATIC_CHAIN_DECL:
562 + *tp = get_chain_decl (info);
570 tree x = build (COMPONENT_REF, TREE_TYPE (root->chain_field),
571 root->frame_decl, root->chain_field, NULL_TREE);
572 x = build (MODIFY_EXPR, TREE_TYPE (x), x, get_chain_decl (root));
573 ! append_to_statement_list (x, &stmt_list);
576 /* If trampolines were created, then we need to initialize them. */
578 tree x = build (COMPONENT_REF, TREE_TYPE (root->chain_field),
579 root->frame_decl, root->chain_field, NULL_TREE);
580 x = build (MODIFY_EXPR, TREE_TYPE (x), x, get_chain_decl (root));
581 ! /* If the function has a custom static chain, chain_field must
582 ! be set after the static chain. */
583 ! if (DECL_STRUCT_FUNCTION (root->context)->custom_static_chain)
585 ! /* Should use walk_function instead. */
586 ! tree_stmt_iterator i =
587 ! tsi_start ( BIND_EXPR_BODY (DECL_SAVED_TREE (context)));
588 ! while (!tsi_end_p (i))
590 ! tree t = tsi_stmt (i);
591 ! if (TREE_CODE (t) == MODIFY_EXPR &&
592 ! TREE_OPERAND (t, 0) == root->chain_decl)
594 ! tsi_link_after(& i, x, TSI_SAME_STMT);
600 ! gcc_assert(x == NULL_TREE);
603 ! append_to_statement_list (x, &stmt_list);
606 /* If trampolines were created, then we need to initialize them. */
607 diff -cr gcc-orig/tree-pretty-print.c gcc/tree-pretty-print.c
608 *** gcc-orig/tree-pretty-print.c Thu Dec 9 10:54:36 2004
609 --- gcc/tree-pretty-print.c Fri Nov 4 13:51:43 2005
613 pp_string (buffer, " [tail call]");
616 + case STATIC_CHAIN_EXPR:
617 + pp_string (buffer, "<<static chain of ");
618 + dump_generic_node (buffer, TREE_OPERAND (node, 0), spc, flags, false);
619 + pp_string (buffer, ">>");
622 + case STATIC_CHAIN_DECL:
623 + pp_string (buffer, "<<static chain decl>>");
626 case WITH_CLEANUP_EXPR:
629 diff -cr gcc-orig/tree-sra.c gcc/tree-sra.c
630 *** gcc-orig/tree-sra.c Fri Aug 5 16:39:04 2005
631 --- gcc/tree-sra.c Thu Jul 26 18:45:59 2007
637 bool saw_one_field = false;
638 + tree last_offset = size_zero_node;
641 for (t = TYPE_FIELDS (type); t ; t = TREE_CHAIN (t))
642 if (TREE_CODE (t) == FIELD_DECL)
646 && (tree_low_cst (DECL_SIZE (t), 1)
647 != TYPE_PRECISION (TREE_TYPE (t))))
649 + /* Reject aliased fields created by GDC for anonymous unions. */
650 + cmp = fold_binary_to_constant (LE_EXPR, boolean_type_node,
651 + DECL_FIELD_OFFSET (t), last_offset);
652 + if (cmp == NULL_TREE || TREE_CODE (cmp) != INTEGER_CST || TREE_INT_CST_LOW (cmp))
655 saw_one_field = true;
657 diff -cr gcc-orig/tree.def gcc/tree.def
658 *** gcc-orig/tree.def Sun Jan 23 15:05:34 2005
659 --- gcc/tree.def Fri Nov 4 13:51:43 2005
663 Operand 2 is the static chain argument, or NULL. */
664 DEFTREECODE (CALL_EXPR, "call_expr", tcc_expression, 3)
666 + /* Operand 0 is the FUNC_DECL of the outer function for
667 + which the static chain is to be computed. */
668 + DEFTREECODE (STATIC_CHAIN_EXPR, "static_chain_expr", tcc_expression, 1)
670 + /* Represents a function's static chain. It can be used as an lvalue. */
671 + DEFTREECODE (STATIC_CHAIN_DECL, "static_chain_decl", tcc_expression, 0)
673 /* Specify a value to compute along with its corresponding cleanup.
674 Operand 0 is the cleanup expression.
675 The cleanup is executed by the first enclosing CLEANUP_POINT_EXPR,
676 diff -cr gcc-orig/real.c gcc/real.c
677 *** gcc-orig/real.c Mon Sep 19 12:56:24 2005
678 --- gcc/real.c Tue Apr 25 21:18:32 2006
682 np2 = SIGNIFICAND_BITS - fmt->p * fmt->log2_b;
683 memset (r->sig, -1, SIGSZ * sizeof (unsigned long));
684 clear_significand_below (r, np2);
685 + if (REAL_MODE_FORMAT_COMPOSITE_P (mode))
686 + clear_significand_bit (r, SIGNIFICAND_BITS - fmt->pnan - 1);
689 /* Fills R with 2**N. */