Allow implicit conversion "foo*?" to "void*"
[delight/core.git] / patches / patch-gcc-4.0.x
blob7bcd18ac0a9631b804e56c1f940642c03c5019a7
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
4 ***************
5 *** 170,175 ****
6 --- 170,176 ----
7   cgraph_node (tree decl)
8   {
9     struct cgraph_node key, *node, **slot;
10 +   tree context;
11   
12     gcc_assert (TREE_CODE (decl) == FUNCTION_DECL);
13   
14 ***************
15 *** 186,196 ****
16     node = cgraph_create_node ();
17     node->decl = decl;
18     *slot = node;
19 !   if (DECL_CONTEXT (decl) && TREE_CODE (DECL_CONTEXT (decl)) == FUNCTION_DECL)
20       {
21 !       node->origin = cgraph_node (DECL_CONTEXT (decl));
22 !       node->next_nested = node->origin->nested;
23 !       node->origin->nested = node;
24       }
25     return node;
26   }
27 --- 187,201 ----
28     node = cgraph_create_node ();
29     node->decl = decl;
30     *slot = node;
31 !   if (!DECL_NO_STATIC_CHAIN (decl))
32       {
33 !       context = decl_function_context (decl);
34 !       if (context)
35 !         {
36 !           node->origin = cgraph_node (context);
37 !           node->next_nested = node->origin->nested;
38 !           node->origin->nested = node;
39 !         }
40       }
41     return node;
42   }
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
46 ***************
47 *** 4292,4297 ****
48 --- 4292,4302 ----
49       frame->red_zone_size = 0;
50     frame->to_allocate -= frame->red_zone_size;
51     frame->stack_pointer_offset -= frame->red_zone_size;
52
53 +   if (cfun->naked)
54 +       /* As above, skip return address */
55 +       frame->stack_pointer_offset = UNITS_PER_WORD;
56
57   #if 0
58     fprintf (stderr, "nregs: %i\n", frame->nregs);
59     fprintf (stderr, "size: %i\n", size);
60 ***************
61 *** 15975,15981 ****
62           output_set_got (tmp);
63   
64           xops[1] = tmp;
65 !         output_asm_insn ("mov{l}\t{%0@GOT(%1), %1|%1, %0@GOT[%1]}", xops);
66           output_asm_insn ("jmp\t{*}%1", xops);
67         }
68       }
69 --- 15975,15981 ----
70           output_set_got (tmp);
71   
72           xops[1] = tmp;
73 !         output_asm_insn ("mov{l}\t{%a0@GOT(%1), %1|%1, %a0@GOT[%1]}", xops);
74           output_asm_insn ("jmp\t{*}%1", xops);
75         }
76       }
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
80 ***************
81 *** 15283,15289 ****
82          use language_string.
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"))
86         i = 0;
87         else if (! strcmp (language_string, "GNU F77")
88                || ! strcmp (language_string, "GNU F95"))
89 --- 15283,15290 ----
90          use language_string.
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"))
95         i = 0;
96         else if (! strcmp (language_string, "GNU F77")
97                || ! strcmp (language_string, "GNU F95"))
98 Only in gcc: cp
99 Only in gcc: d
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
103 ***************
104 *** 731,736 ****
105 --- 731,737 ----
106       DW_LANG_C99 = 0x000c,
107       DW_LANG_Ada95 = 0x000d,
108       DW_LANG_Fortran95 = 0x000e,
109 +     DW_LANG_D = 0x0013,
110       /* MIPS.  */
111       DW_LANG_Mips_Assembler = 0x8001,
112       /* UPC.  */
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
116 ***************
117 *** 5166,5172 ****
118     unsigned int lang = get_AT_unsigned (comp_unit_die, DW_AT_language);
119   
120     return (lang == DW_LANG_C || lang == DW_LANG_C89
121 !         || lang == DW_LANG_C_plus_plus);
122   }
123   
124   /* Return TRUE if the language is C++.  */
125 --- 5166,5173 ----
126     unsigned int lang = get_AT_unsigned (comp_unit_die, DW_AT_language);
127   
128     return (lang == DW_LANG_C || lang == DW_LANG_C89
129 !         || lang == DW_LANG_C_plus_plus
130 !         || lang == DW_LANG_D);
131   }
132   
133   /* Return TRUE if the language is C++.  */
134 ***************
135 *** 11880,11885 ****
136 --- 11881,11888 ----
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;
142     else
143       language = DW_LANG_C89;
144   
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
148 ***************
149 *** 8217,8222 ****
150 --- 8217,8227 ----
151         /* Lowered by gimplify.c.  */
152         gcc_unreachable ();
153   
154 +     case STATIC_CHAIN_EXPR:
155 +     case STATIC_CHAIN_DECL:
156 +       /* Lowered by tree-nested.c */
157 +       gcc_unreachable ();
159       case EXC_PTR_EXPR:
160         return get_exception_pointer (cfun);
161   
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
165 ***************
166 *** 3099,3105 ****
167         FUNCTION_ARG_ADVANCE (all.args_so_far, data.promoted_mode,
168                             data.passed_type, data.named_arg);
169   
170 !       assign_parm_adjust_stack_rtl (&data);
171   
172         if (assign_parm_setup_block_p (&data))
173         assign_parm_setup_block (&all, parm, &data);
174 --- 3099,3106 ----
175         FUNCTION_ARG_ADVANCE (all.args_so_far, data.promoted_mode,
176                             data.passed_type, data.named_arg);
177   
178 !       if (!cfun->naked)
179 !       assign_parm_adjust_stack_rtl (&data);
180   
181         if (assign_parm_setup_block_p (&data))
182         assign_parm_setup_block (&all, parm, &data);
183 ***************
184 *** 3114,3120 ****
185   
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);
189   
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
192 --- 3115,3122 ----
193   
194     /* Output all parameter conversion instructions (possibly including calls)
195        now that all parameters have been copied out of hard registers.  */
196 !   if (!cfun->naked)
197 !     emit_insn (all.conversion_insns);
198   
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
201 ***************
202 *** 3250,3255 ****
203 --- 3252,3260 ----
204     struct assign_parm_data_all all;
205     tree fnargs, parm, stmts = NULL;
206   
207 +   if (cfun->naked)
208 +     return NULL;
210     assign_parms_initialize_all (&all);
211     fnargs = assign_parms_augmented_arg_list (&all);
212   
213 ***************
214 *** 4203,4213 ****
215         tree parm = cfun->static_chain_decl;
216         rtx local = gen_reg_rtx (Pmode);
217   
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))));
221   
222 !       emit_move_insn (local, static_chain_incoming_rtx);
223       }
224   
225     /* If the function receives a non-local goto, then store the
226 --- 4208,4222 ----
227         tree parm = cfun->static_chain_decl;
228         rtx local = gen_reg_rtx (Pmode);
229   
230         SET_DECL_RTL (parm, local);
231         mark_reg_pointer (local, TYPE_ALIGN (TREE_TYPE (TREE_TYPE (parm))));
232   
233 !       if (! cfun->custom_static_chain)
234 !         {
235 !           set_decl_incoming_rtl (parm, static_chain_incoming_rtx);
236 !           emit_move_insn (local, static_chain_incoming_rtx);
237 !       }
238 !       /* else, the static chain will be set in the main body */
239       }
240   
241     /* If the function receives a non-local goto, then store the
242 ***************
243 *** 5116,5121 ****
244 --- 5125,5133 ----
245   #endif
246     edge_iterator ei;
247   
248 +   if (cfun->naked)
249 +       return;
251   #ifdef HAVE_prologue
252     if (HAVE_prologue)
253       {
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
257 ***************
258 *** 430,435 ****
259 --- 430,443 ----
260   
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;
271   };
272   
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
277 ***************
278 *** 132,137 ****
279 --- 132,140 ----
280   /* Flag set by cppspec.c to 1.  */
281   int is_cpp_driver;
282   
283 + /* Flag set by drivers needing Pthreads. */
284 + int need_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;
289 ***************
290 *** 470,475 ****
291 --- 473,479 ----
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.
299 ***************
300 *** 871,876 ****
301 --- 875,882 ----
302   #endif
303   #endif
304   
305 + #define GCC_SPEC_FORMAT_4 1
307   /* Record the mapping from file suffixes for compilation specs.  */
308   
309   struct compiler
310 ***************
311 *** 3777,3782 ****
312 --- 3783,3791 ----
313         }
314       }
315   
316 +   if (need_pthreads)
317 +       n_switches++;
319     if ((save_temps_flag || report_times) && use_pipes)
320       {
321         /* -save-temps overrides -pipe, so that temp files are produced */
322 ***************
323 *** 4119,4124 ****
324 --- 4128,4145 ----
325         }
326       }
327   
328 +   if (need_pthreads)
329 +     {
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;
337 +       n_switches++;
338 +     }
340     switches[n_switches].part1 = 0;
341     infiles[n_infiles].name = 0;
342   }
343 ***************
344 *** 5087,5092 ****
345 --- 5108,5124 ----
346               return value;
347             break;
348   
349 +         case 'N':
350 +           if (multilib_dir)
351 +             {
352 +               arg_going = 1;
353 +               obstack_grow (&obstack, "-fmultilib-dir=",
354 +                             strlen ("-fmultilib-dir="));
355 +               obstack_grow (&obstack, multilib_dir,
356 +                             strlen (multilib_dir));
357 +             }
358 +           break;
360             /* Here we define characters other than letters and digits.  */
361   
362           case '{':
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
366 ***************
367 *** 38,44 ****
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')
372   
373   /* This defines which multi-letter switches take arguments.  */
374   
375 --- 38,44 ----
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')
380   
381   /* This defines which multi-letter switches take arguments.  */
382   
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
386 ***************
387 *** 3844,3849 ****
388 --- 3844,3855 ----
389             }
390           break;
391   
392 +       case STATIC_CHAIN_EXPR:
393 +         /* The argument is used as information only.  No need to gimplify */
394 +       case STATIC_CHAIN_DECL:  
395 +         ret = GS_ALL_DONE;
396 +         break;
397 +         
398         case TREE_LIST:
399           gcc_unreachable ();
400   
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
404 ***************
405 *** 577,582 ****
406 --- 577,586 ----
407         dump_child ("args", TREE_OPERAND (t, 1));
408         break;
409   
410 +     case STATIC_CHAIN_EXPR:
411 +       dump_child ("func", TREE_OPERAND (t, 0));
412 +       break;
414       case CONSTRUCTOR:
415         dump_child ("elts", CONSTRUCTOR_ELTS (t));
416         break;
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
420 ***************
421 *** 73,78 ****
422 --- 73,80 ----
423       case COMPLEX_CST:
424       case VECTOR_CST:
425       case OBJ_TYPE_REF:
426 +     case STATIC_CHAIN_EXPR: /* not sure if this is right...*/
427 +     case STATIC_CHAIN_DECL:
428         return true;
429   
430       default:
431 ***************
432 *** 144,150 ****
433           || TREE_CODE (t) == WITH_SIZE_EXPR
434           /* These are complex lvalues, but don't have addresses, so they
435              go here.  */
436 !         || TREE_CODE (t) == BIT_FIELD_REF);
437   }
438   
439   /*  Return true if T is a GIMPLE condition.  */
440 --- 146,155 ----
441           || TREE_CODE (t) == WITH_SIZE_EXPR
442           /* These are complex lvalues, but don't have addresses, so they
443              go here.  */
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);
448   }
449   
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
454 ***************
455 *** 546,552 ****
456       {
457         tree old_node = *tp;
458   
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)))
463 --- 546,563 ----
464       {
465         tree old_node = *tp;
466   
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)
471 !       {
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 ();
477 !       }
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
485 ***************
486 *** 298,303 ****
487 --- 298,304 ----
488     if (!decl)
489       {
490         tree type;
491 +       enum tree_code code;
492   
493         type = get_frame_type (info->outer);
494         type = build_pointer_type (type);
495 ***************
496 *** 308,319 ****
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 
499          the caller.  */
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;
506   
507         /* Tell tree-inline.c that we never write to this variable, so
508          it can copy-prop the replacement value immediately.  */
509 --- 309,325 ----
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 
512          the caller.  */
513 !       /* If the function has a custom static chain, a VAR_DECL is more
514 !        appropriate. */
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;
524   
525         /* Tell tree-inline.c that we never write to this variable, so
526          it can copy-prop the replacement value immediately.  */
527 ***************
528 *** 716,721 ****
529 --- 722,729 ----
530   
531     if (info->context == target_context)
532       {
533 +       /* might be doing something wrong to need the following line.. */
534 +       get_frame_type (info);
535         x = build_addr (info->frame_decl);
536       }
537     else
538 ***************
539 *** 1194,1199 ****
540 --- 1202,1211 ----
541         if (DECL_NO_STATIC_CHAIN (decl))
542         break;
543   
544 +       /* Don't use a trampoline for a static reference. */
545 +       if (TREE_STATIC (t))
546 +       break;
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)
551 ***************
552 *** 1258,1263 ****
553 --- 1270,1283 ----
554           = get_static_chain (info, target_context, &wi->tsi);
555         break;
556   
557 +     case STATIC_CHAIN_EXPR:
558 +       *tp = get_static_chain (info, TREE_OPERAND (t, 0), &wi->tsi);
559 +       break;
561 +     case STATIC_CHAIN_DECL:
562 +       *tp = get_chain_decl (info);
563 +       break;
564 +  
565       case RETURN_EXPR:
566       case MODIFY_EXPR:
567       case WITH_SIZE_EXPR:
568 ***************
569 *** 1352,1358 ****
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);
574       }
575   
576     /* If trampolines were created, then we need to initialize them.  */
577 --- 1372,1400 ----
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)
584 !       {
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))
589 !           {
590 !             tree t = tsi_stmt (i);
591 !             if (TREE_CODE (t) == MODIFY_EXPR &&
592 !                 TREE_OPERAND (t, 0) == root->chain_decl)
593 !               {
594 !                 tsi_link_after(& i, x, TSI_SAME_STMT);
595 !                 x = NULL_TREE;
596 !                 break;
597 !               }
598 !             tsi_next (& i);
599 !           }
600 !         gcc_assert(x == NULL_TREE);
601 !       }
602 !       else
603 !       append_to_statement_list (x, &stmt_list);
604       }
605   
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
610 ***************
611 *** 953,958 ****
612 --- 953,968 ----
613         pp_string (buffer, " [tail call]");
614         break;
615   
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, ">>");
620 +       break;
622 +     case STATIC_CHAIN_DECL:
623 +        pp_string (buffer, "<<static chain decl>>");
624 +        break;
625 +       
626       case WITH_CLEANUP_EXPR:
627         NIY;
628         break;
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
632 ***************
633 *** 196,201 ****
634 --- 196,203 ----
635       case RECORD_TYPE:
636         {
637         bool saw_one_field = false;
638 +       tree last_offset = size_zero_node;
639 +       tree cmp;
640   
641         for (t = TYPE_FIELDS (type); t ; t = TREE_CHAIN (t))
642           if (TREE_CODE (t) == FIELD_DECL)
643 ***************
644 *** 205,210 ****
645 --- 207,217 ----
646                   && (tree_low_cst (DECL_SIZE (t), 1)
647                       != TYPE_PRECISION (TREE_TYPE (t))))
648                 goto fail;
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))
653 +               goto fail;
654   
655               saw_one_field = true;
656             }
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
660 ***************
661 *** 528,533 ****
662 --- 528,540 ----
663      Operand 2 is the static chain argument, or NULL.  */
664   DEFTREECODE (CALL_EXPR, "call_expr", tcc_expression, 3)
665   
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)
669 +     
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
679 ***************
680 *** 2205,2210 ****
681 --- 2205,2212 ----
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);
687   }
688   
689   /* Fills R with 2**N.  */