OSDN Git Service

eeab0fea9977b57a59d795cd8c593e7228a4ee0b
[pf3gnuchains/gcc-fork.git] / gcc / ChangeLog
1 2008-09-14  Andreas Schwab  <schwab@suse.de>
2
3         * tree-call-cdce.c (check_target_format): Accept Motorola formats.
4
5 2008-09-14  Jan Hubicka  <jh@suse.cz>
6
7         * invoke.texi (-fconserve-stack): Document.
8         * opts.c (decode_options): Handle conserve_stack.
9         * common.opt (fconvserve_stack): New.
10
11 2008-09-14  David Edelsohn  <edelsohn@gnu.org>
12
13         * config.host: Add x-aix to host_xmake_file.
14         * config/rs6000/t-aix52: Do not override LDFLAGS.
15         * config/rs6000/x-aix: New file.
16
17 2008-09-14  Andy Hutchinson  <hutchinsonandy@aim.com>
18
19         PR target/19636
20         PR target/24894
21         PR target/31644
22         PR target/31786
23         * config/avr/avr.c (legitimate_address_p): Fix problem where subreg
24         is not recognized as a valid register usage. Allow REG_X to be used
25         as a base pointer.
26         * config/avr/avr.h (LEGITIMIZE_RELOAD_ADDRESS): Remove code that
27         forces a reload when using a base register.
28
29 2008-09-14  Danny Smith  <dannysmith@users.sourceforge.net>
30
31         * config/i386/cygming-crtend.c (register_frame_ctor): If
32         DEFAULT_USE_CXA_ATEXIT, register __gcc_deregister_frame
33         directly with atexit.
34         (deregister_frame_ctor): Rename to ...
35         (deregister_frame_dtor): Use to call __gcc_deregister_frame
36         if !DEFAULT_USE_CXA_ATEXIT.
37
38 2008-09-13  Jan Hubicka  <jh@suse.cz>
39
40         * cgraph.c: Include value-prof.h
41         * Makefile.in (cgraph.o): Add value-prof.h dependency.
42
43 2008-09-13  Jan Hubicka  <jh@suse.cz>
44
45         PR middle-end/32581
46         * tree-profile.c (add_abnormal_goto_call_edges): New function.
47         (tree_gen_interval_profiler, tree_gen_pow2_profiler,
48         tree_gen_one_value_profiler, tree_gen_average_profiler,
49         tree_gen_ic_func_profiler, tree_gen_ior_profiler): Use it.
50
51 2008-09-13  Jan Hubicka  <jh@suse.cz>
52
53         * i386.c (ix86_expand_movmem, ix86_expand_movstr): Avoid processing too
54         many bytes on misalligned blocks.
55
56 2008-09-13  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
57
58         * doc/cfg.texi: Fix some typos.
59         * doc/extend.texi: Likewise.
60         * doc/install.texi: Likewise.
61         * doc/invoke.texi: Likewise.
62         * doc/rtl.texi: Likewise.
63         * doc/tree-ssa.texi: Likewise.
64
65 2008-09-13  Richard Guenther  <rguenther@suse.de>
66
67         PR middle-end/30141
68         * tree-nested.c (finalize_nesting_tree_1): Generate valid
69         gimple stores for memory rhs.
70
71 2008-09-13  H.J. Lu  <hongjiu.lu@intel.com>
72
73         PR rtl-optimization/37489
74         * cse.c (fold_rtx): Don't return const_true_rtx for float
75         compare if FLOAT_STORE_FLAG_VALUE is undefined.
76
77 2008-09-13  Jan Hubicka  <jh@suse.cz>
78
79         PR tree-optimization/37392
80         * tree-inline.c (remap_gimple_stmt): Do not remap return value.
81
82 2008-09-13  Martin Jambor  <mjambor@suse.cz>
83             Jan Hubicka  <jh@suse.cz>
84
85         * cgraph.c (free_edges): New variable.
86         (NEXT_FREE_EDGE): New macro.
87         (cgraph_free_edge): New function.
88         (cgraph_remove_edge): Call cgraph_remove_edge_1.
89         (cgraph_node_remove_callees): Likewise.
90         (cgraph_node_remove_callers): Likewise.
91         (cgraph_create_edge): Reuse edges from the free list.  Do not
92         update uid if doing so.
93         (cgraph_remove_*_hook): Add free call.
94
95 2008-09-13  Richard Sandiford  <rdsandiford@googlemail.com>
96
97         * ira-color.c (conflict_allocno_vec): Delete.
98         (update_cost_queue_elem): New structure.
99         (update_cost_queue): New variable.
100         (update_cost_queue_tail): Likewise.
101         (update_cost_queue_elems): Likewise.
102         (allocno_update_cost_check): Delete.
103         (initiate_cost_update): Allocate update_cost_queue_elems
104         instead of allocno_update_cost_check.
105         (finish_cost_update): Update the free()s accordingly.
106         (start_update_cost): New function.
107         (queue_update_cost): Likewise.
108         (get_next_update_cost): Likewise.
109         (update_copy_costs_1): Inline into...
110         (update_copy_costs): ...here.  Use a queue instead of recursive calls.
111         Use cover_class instead of ALLOCNO_COVER_CLASS (another_allocno),
112         once we've established they are equal.  Don't allocate update
113         costs if there is nothing to add to them.
114         (update_conflict_hard_regno_costs): Remove ALLOCNO and
115         DIVISOR arguments.  Use a queue instead of recursive calls;
116         process all the allocnos in the initial queue, rather than
117         a single allocno.
118         (assign_hard_reg): Use queue_update_cost instead of
119         conflict_allocno_vec.  Queue coalesced allocnos instead
120         of calling update_conflict_hard_regno_costs for each one.
121         Just call update_conflict_hard_regno_costs once for the
122         entire queue.
123         (ira_color): Remove conflict_allocno_vec handling.
124
125 2008-09-12  Sebastian Pop  <sebastian.pop@amd.com>
126
127         PR tree-optimization/37484
128         * graphite.c (scop_record_loop): Use snprintf instead of sprintf.
129         (save_var_name): Same.
130         (initialize_cloog_names): Same.
131         (initialize_cloog_names): Same.
132
133 2008-09-12  Sebastian Pop  <sebastian.pop@amd.com>
134
135         * tree-scalar-evolution.c (set_instantiated_value): Set instantiated_below.
136
137 2008-09-12  Vladimir Makarov  <vmakarov@redhat.com>
138
139         PR rtl-opt/37377
140
141         * ira-build.c (common_loop_tree_node_dominator): Remove.
142         (copy_live_ranges_to_removed_store_destinations): New function.
143         (regno_top_level_allocno_map): Move to top level from ...
144         (ira_flattening): ... here.  Use
145         copy_live_ranges_to_removed_store_destinations.
146
147         * ira-emit.c (generate_edge_moves): Fix a comment.
148
149 2008-09-12  Anatoly Sokolov  <aesok@post.ru>
150
151         PR target/37466
152         * config/avr/avr.md (movsi_lreg_const peephole2): Add match_dup for
153         scratch register after 'set' pattern.
154
155 2008-09-12  Ulrich Weigand  <Ulrich.Weigand@de.ibm.com>
156
157         * emit-rtl.c (set_reg_attrs_from_value): Fix invalid alignment
158         information passed to mark_reg_pointer.
159         * explow.c (force_reg): Likewise.
160
161 2008-09-12  Ulrich Weigand  <Ulrich.Weigand@de.ibm.com>
162
163         * config/spu/spu.c (spu_override_options): Default to -mno-safe-hints
164         when building for the celledp architecture.
165
166 2008-09-12  Richard Guenther  <rguenther@suse.de>
167
168         * tree-vrp.c (simplify_truth_ops_using_ranges): Fix types.
169
170 2008-09-12  Eric Botcazou  <ebotcazou@adacore.com>
171
172         PR rtl-optimization/37424
173         * ira-color.c (coalesced_pseudo_reg_slot_compare): Untie by comparing
174         the regnos instead of the addresses.
175
176 2008-09-11  Janis Johnson  <janis187@us.ibm.com>
177
178         * ginclude/float.h (DEC_EVAL_METHOD): Correct the macro name.
179
180 2008-09-11  Richard Guenther  <rguenther@suse.de>
181
182         * tree-ssa-uncprop.c (associate_equivalences_with_edges): Avoid
183         entering the weaker equivalence recording.
184
185         * tree-ssa-phiprop.c (propagate_with_phi): Fix tuplification.
186
187 2008-09-11  Jeff Law <law@redhat.com>
188
189         * reload1.c (alter_reg): Undo the BYTE_BIG_ENDIAN correction performed
190         by assign_stack_local on the IRA path for stack slot sharing
191         as well as the non-IRA path.
192
193 2008-09-11  Uros Bizjak  <ubizjak@gmail.com>
194
195         * config/i386/i386.h: Fix whitespace issues.
196
197 2008-09-11  Martin Jambor  <mjambor@suse.cz>
198
199         * ipa-prop.h (struct ipa_param_flags): Removed.
200         (struct ipa_param_descriptor): New structure.
201         (struct ipa_node_params): ipcp_lattices, param_decls and
202         param_flags moved to ipa_param_description.
203         (ipa_get_ith_param): Renamed to ipa_get_param, changed to access
204         descriptors.  Renamed all users.
205         (ipa_is_ith_param_modified): Renamed to ipa_is_param_modified,
206         changed to access descriptors.  Renamed all users.
207         (ipa_is_ith_param_called): Renamed to ipa_is_param_called, changed
208         to access descriptors. Renamed all users.
209         * ipa-cp.c (ipcp_init_cloned_node): Call
210         ipa_initialize_node_params instead of ipa_count_formal_params and
211         ipa_create_param_decls_array.
212         (ipcp_analyze_node): Likewise.
213         (ipcp_get_ith_lattice): Renamed to ipcp_get_lattice, changed to access
214         descriptors.  Renamed all users.
215         (ipcp_initialize_node_lattices): Remove allocation.
216         * ipa-inline.c (inline_indirect_intraprocedural_analysis): Call
217         ipa_initialize_node_params instead of ipa_count_formal_params and
218         ipa_create_param_decls_array.
219         * ipa-prop.c (ipa_create_param_decls_array): Renamed to
220         ipa_populate_param_decls, made static, added parameter info,
221         renamed mt to node, removed allocation, changed to use
222         descriptors.
223         (ipa_count_formal_params): Made static, added parameter info,
224         renamed mt to node.
225         (ipa_initialize_node_params): New function.
226         (ipa_check_stmt_modifications): Changed to use descriptors.
227         (ipa_detect_param_modifications): Removed allocation, changed to
228         use descriptors.
229         (ipa_note_param_call): Changed to use descriptors.
230         (ipa_analyze_params_uses): Removed allocation.
231         (ipa_free_node_params_substructures): Changed to use descriptors.
232         (ipa_edge_duplication_hook): Use the unused attribute.
233         (ipa_node_duplication_hook): Use the unused attribute, changed to
234         use descriptors, changed to duplicate descriptors.
235
236         * ipa-inline.c (cgraph_mark_inline_edge): New parameter new_edges,
237         changed all callers.  Call ipa_propagate_indirect_call_infos if doing
238         indirect inlining.  Made static.
239         (cgraph_decide_inlining): Freeing ipa-prop structures after inlining
240         functions called only once.
241         (cgraph_decide_recursive_inlining): Don't call
242         ipa_propagate_indirect_call_infos, pass new_edges to
243         cgraph_mark_inline_edge instead.
244         (cgraph_decide_inlining_of_small_functions): Don't call
245         ipa_propagate_indirect_call_infos, pass new_edges to
246         cgraph_mark_inline_edge instead.
247         (cgraph_decide_inlining): Don't call
248         ipa_propagate_indirect_call_infos.
249         * ipa-prop.c: Check that vectors are allocated.
250
251         * ipa-inline.c (cgraph_mark_inline_edge): Returns boolean, true
252         iff a new cgraph edges have been created.
253         (cgraph_decide_inlining): New variable redo_always_inline.
254         Flattening and always_inlining loop until callgraph stabilizes.
255         * ipa-prop.c (update_call_notes_after_inlining): Returns boolean,
256         true iff new cgraph edges have been created.
257         (propagate_info_to_inlined_callees): Likewise.
258         (ipa_propagate_indirect_call_infos): Likewise.
259
260 2008-09-11  Richard Guenther  <rguenther@suse.de>
261
262         * tree-vectorizer.c (slpeel_add_loop_guard): Fix types.
263         (set_prologue_iterations): Likewise.
264         * tree-vect-transform.c (vect_create_addr_base_for_vector_ref):
265         Likewise.
266         (vect_update_init_of_dr): Likewise.
267         * tree-ssa-forwprop.c (forward_propagate_addr_expr_1): Fix
268         type verification.
269         * fold-const.c (fold_unary): Do not generate calculations
270         in sub-types.
271
272 2008-09-11  Paolo Bonzini  <bonzini@gnu.org>
273
274         * dojump.c (do_jump) [BIT_AND_EXPR]: Move below.  Fall through to
275         TRUTH_AND_EXPR for boolean (1-bit precision) expressions.
276         (do_jump) [BIT_IOR_EXPR]: Compile as TRUTH_OR_EXPR.
277
278         * tree-flow.h (simplify_stmt_using_ranges): Accept a GSI, return a bool.
279         * tree-ssa-propagate.c (substitute_and_fold): Pass a GSI to
280         VRP's simplify_stmt_using_ranges.  Do simplify_stmt_using_ranges
281         before finalizing the changes.
282         * tree-vrp.c (extract_range_from_binary_expr): Add limited support
283         for BIT_IOR_EXPR.
284         (simplify_truth_ops_using_ranges): New.
285         (simplify_div_or_mod_using_ranges, simplify_abs_using_ranges,
286         simplify_cond_using_ranges, simplify_switch_using_ranges): Return
287         whether a simplification was made.
288         (simplify_stmt_using_ranges): Ditto, and accept a GSI.  For GS_ASSIGN,
289         use a switch statement and also call simplify_truth_ops_using_ranges.
290
291 2008-09-11  Jan Hubicka  <jh@suse.cz>
292
293         * ggc-common.c (loc_array): Make static.
294         * dce.c (rest_of_handle_ud_dce): Free worklist.
295
296 2008-09-11  Jan Hubicka  <jh@suse.cz>
297
298         * cgraph.c (cgraph_release_function_body): Plug memory leak on
299         ipa_transforms_to_apply and CFG; ggc_free gimple df and struct function
300         so we are sure we do not dangle it forever.
301         * function.c (outer_function_chain, find_function_data): Remove.
302         (function_context_stack): New.
303         (push_function_context, pop_function_context): Update.
304         * function.h (struct function): Remove pointer outer.
305         (outer_function_chain, find_function_data): Remove.
306         * stmt.c (force_label_rtx): Remove dead call of find_function_data.
307
308 2008-09-11  Jan Hubicka  <jh@suse.cz>
309
310         PR middle-end/37448
311         * cgraph.c (cgraph_create_edge): Use !cgraph_edge for sanity check.
312
313 2008-09-11  Jan Hubicka  <jh@suse.cz>
314
315         * tree-ssa-pre.c (phi_translate_1): Fix memory leak
316
317 2008-09-11  Jan Hubicka  <jh@suse.cz>
318
319         * tree-ssa.c (redirect_edge_var_map_clear): Fix formatting.
320         (free_var_map_entry): New function.
321         (redirect_edge_var_map_destroy): Use it.
322
323 2008-09-11  Jan Hubicka  <jh@suse.cz>
324
325         PR middle-end/37448
326         * tree-inline.c (add_lexical_block): Replace with ...
327         (prepend_lexical_block): ... prepend at begginig.
328         (remap_blocks): Use it and reverse later.
329         (expand_call_inline): Use prepend_lexical_block.
330
331 2008-09-11  Jan Hubicka  <jh@suse.cz>
332
333         * gimplify.c (pop_gimplify_context): Free bind_expr_stack.
334
335 2008-09-11  Jan Hubicka  <jh@suse.cz>
336
337         * function.c (free_after_compilation): Call insn_locators_free.
338         * cfglayout.c (insn_locators_free): New function.
339         * rtl.h (insn_locators_free): Declare.
340
341 2008-09-11  Jan Hubicka  <jh@suse.cz>
342
343         * ifcvt.c (check_cond_move_block): Make regs argument pointer to
344         vector pointer.
345         (cond_move_process_if_block): Update call.
346
347 2008-09-11  Jan Hubicka  <jh@suse.cz>
348
349         * toplev.c (dump_memory_report): Call dump_vec_loc_statistics.
350         * vec.c: Include hashtab.h
351         (vec_descriptor, ptr_hash_entry): New structures.
352         (vec_desc_hash, vec_ptr_map): New static variables.
353         (hash_descriptor, eq_descriptor, hash_ptr, eq_ptr, vec_descriptor,
354         register_overhead, free_overhead, vec_heap_free): New functions.
355         (vec_gc_o_reserve_1): ggc_free when resizing to 0.
356         (vec_heap_o_reserve_1): free when resizing to 0; add statistics.
357         (cmp_statistic, add_statistics, dump_vec_loc_statistics): New functions.
358
359 2008-09-11  Ira Rosen  <irar@il.ibm.com>
360
361         PR tree-optimization/37474
362         * tree-vect-analyze.c (vect_supported_load_permutation_p): Check the
363         length of load permutation.
364
365 2008-09-11  Andreas Schwab  <schwab@suse.de>
366
367         * config/m68k/m68k.h (IRA_COVER_CLASSES): Define.
368
369 2008-09-11  Jakub Jelinek  <jakub@redhat.com>
370
371         PR target/37382
372         * expmed.c (extract_low_bits): Avoid creating invalid subregs.
373         * dse.c (find_shift_sequence): Use extract_low_bits instead of
374         simplify_gen_subreg.
375
376 2008-09-11  Ira Rosen  <irar@il.ibm.com>
377
378         * tree-vect-transform.c (vectorizable_store): Use the rhs vector type
379         for alias check.
380
381 2008-09-10  Jakub Jelinek  <jakub@redhat.com>
382
383         PR middle-end/37338
384         * gimplify.c (gimplify_body): Call default_rtl_profile.
385
386         PR target/36904
387         * config/rs6000/rs6000-c.c (rs6000_macro_to_expand): Return NULL
388         instead of tok->val.node if not expanding to something else.  Handle
389         intervening CPP_PADDING tokens.
390         (altivec_categorize_keyword): Remove unneeded comparisons.
391
392 2008-09-10  Richard Guenther  <rguenther@suse.de>
393
394         * tree-ssa-pre.c (phi_translate_1): Fix memory leak.
395
396 2008-09-10  Richard Guenther  <rguenther@suse.de>
397
398         PR middle-end/37432
399         * tree-inline.c (insert_init_stmt): Make sure to not
400         insert invalid gimple stores.
401
402 2008-09-10  Sebastian Pop  <sebastian.pop@amd.com>
403
404         PR tree-optimization/37388
405         * toplev.c (process_options): Fail and warn when graphite
406         flags are used, but the compiler has not been configured
407         with graphite libraries.
408         * graphite.c (graphite_transform_loops): Remove printfs
409         to dump_file for the case when graphite is not available.
410
411 2008-09-10  H.J. Lu  <hongjiu.lu@intel.com>
412
413         PR target/37434:
414         * config/i386/i386.c (ix86_expand_vector_init_interleave): Force
415         the even element into register.
416         (ix86_expand_vector_init_general): Don't use
417         ix86_expand_vector_init_interleave on V16QImode and V8HImode
418         if we can't move from GPR to SSE register directly.
419
420 2008-09-10  Bernd Schmidt  <bernd.schmidt@analog.com>
421
422         * config/bfin/bfin.c (workaround_speculation): Correct algorithm to
423         not lose track of the number of NOPs needed.  Number of NOPs needed
424         for sync vs. loads workaround was switched; corrected.  Run second
425         pass for all workarounds.  No NOPs needed after call insns.  Change
426         second pass to use find_next_insn_start and find_load helpers in order
427         to properly detect parallel insns.
428         * config/bfin/bfin.md (cbranch_with_nops): Increase length.
429
430 2008-09-10  Jan Hubicka  <jh@suse.cz>
431
432         * value-prof.c (gimple_ic): Fix tuplification bug.
433         * sched-deps.c (sched_insns_conditions_mutex_p): Silence unitialized
434         var warning.
435
436 2008-09-10  Jakub Jelinek  <jakub@redhat.com>
437
438         PR tree-optimization/37353
439         * tree-call-cdce.c (cond_dead_built_in_calls): Remove.
440         (shrink_wrap_conditional_dead_built_in_calls): Add calls argument, use
441         calls instead of cond_dead_built_in_calls.
442         (tree_call_cdce): Add cond_dead_built_in_calls automatic variable,
443         initalize the vector only before adding first entry.  Use VEC_safe_push
444         instead of VEC_quick_push.  Pass cond_dead_built_in_calls to
445         shrink_wrap_conditional_dead_built_in_calls call.
446
447 2008-09-10  Ira Rosen  <irar@il.ibm.com>
448
449         PR tree-optimization/37385
450         * tree-vect-transform.c (vect_create_data_ref_ptr): Add a new argument,
451         and use it as a vector type if not NULL.
452         (vectorizable_store): Call vect_create_data_ref_ptr with the type of
453         vectorized rhs.
454         (vect_setup_realignment): Call vect_create_data_ref_ptr with additional
455         argument.
456         (vectorizable_load): Likewise.
457
458 2008-09-10  Jakub Jelinek  <jakub@redhat.com>
459
460         * config/i386/i386.md (SWI32): New mode iterator.
461         (jcc_fused_1, jcc_fused_2, jcc_fused_3, jcc_fused_4): Use it instead
462         of SWI.
463
464 2008-09-09  Vladimir Makarov  <vmakarov@redhat.com>
465
466         PR rtl-optimization/37435
467         * caller-save.c (insert_restore, insert_save): Check the mode by
468         reg_save_code.
469
470 2008-09-09  John David Anglin  <dave.anglin@nrc-cnrc.gc.ca>
471
472         PR other/37265
473         * dwarf2asm.c (dw2_force_const_mem): Use unstripped symbol name for
474         splay tree lookup.
475         (dw2_output_indirect_constant_1): Use unstripped name in symbol
476         reference.
477
478 2008-09-09  Sandra Loosemore  <sandra@codesourcery.com>
479
480         * doc/invoke.texi (ARM Options): Correct errors in discussion
481         of -mfloat-abi, -mhard-float, and -msoft-float.
482
483 2008-09-09  Jakub Jelinek  <jakub@redhat.com>
484             Jan Hubicka  <jh@suse.cz>
485
486         PR middle-end/37356
487         * tree-inline.c (copy_bb): Insert stmt into copy_basic_block before
488         calling gimple_regimplify_operands on it.  Iterate over all newly
489         added statements, not just the last one.
490         (insert_init_stmt): Insert stmt into seq first, then call
491         gimple_regimplify_operands on it.  Don't create new gimplification
492         context, nor find referenced vars.
493
494 2008-09-09  Jakub Jelinek  <jakub@redhat.com>
495
496         PR other/37419
497         * ipa-prop.h (ipa_propagate_indirect_call_infos): Change last argument
498         to pointer to vector pointer.
499         * ipa-prop.c (ipa_propagate_indirect_call_infos,
500         propagate_info_to_inlined_callees): Likewise.
501         (update_call_notes_after_inlining): Likewise.  Push new indirect edge
502         to *new_edges instead of new_edges.  Reread IPA_EDGE_REF after
503         ipa_check_create_edge_args.
504         * ipa-inline.c (cgraph_decide_recursive_inlining): Change last argument
505         to pointer to vector pointer.
506         (cgraph_decide_inlining_of_small_function): Adjust
507         cgraph_decide_recursive_inlining and ipa_propagate_indirect_call_infos
508         calls.
509
510         PR target/37438
511         * config/i386/i386.md (zero_extendqihi2_movzbl): Enable when optimizing
512         for size, not speed.
513
514         PR rtl-optimization/37408
515         * function.c (assign_parm_find_stack_rtl): Set correct MEM_SIZE
516         if parm is promoted.
517
518 2008-09-09  Sebastian Pop  <sebastian.pop@amd.com>
519
520         PR tree-optimization/37375
521         * tree-scalar-evolution.c (scev_info_str): Add field instantiated_below.
522         (new_scev_info_str, eq_scev_info, find_var_scev_info,
523         set_scalar_evolution, get_scalar_evolution, get_instantiated_value,
524         set_instantiated_value): Pass instantiated_below.
525         (analyze_scalar_evolution_1, analyze_scalar_evolution): Update calls to
526         above functions.
527         (instantiate_scev_1, instantiate_scev): Pass a basic block above which
528         the definitions are not instantiated.
529
530         * tree-scalar-evolution.h (instantiate_scev): Update declaration.
531         (block_before_loop): New.
532         * tree-data-ref.c (dr_analyze_indices): Update uses of instantiate_scev.
533         * graphite.c (block_before_scop): New.
534         (loop_affine_expr, stmt_simple_for_scop_p, harmful_stmt_in_bb): Pass a
535         basic block, not a loop for determining the parameters.
536         (scopdet_edge_info, build_scops_1): Do not pass outermost loop in the
537         scop.
538         (idx_record_params, find_params_in_bb, find_scop_parameters,
539         build_loop_iteration_domains, add_conditions_to_domain): Update calls
540         to instantiate_scev.
541
542         * Makefile.in (cfgloopmanip.o): Add missing dependency on TREE_FLOW_H.
543
544 2008-09-09  Vladimir Makarov  <vmakarov@redhat.com>
545
546         PR rtl-opt/37333
547
548         * ira-build.c (ira_create_allocno): Setup frequency to 0.
549
550         * ira-color.c (update_conflict_hard_regno_costs): Remove assert.
551         Check zero freq and increase if necessary.
552
553 2008-09-09  Vladimir Makarov  <vmakarov@redhat.com>
554
555         * ira-conflicts.c (process_regs_for_copy): Check that the hard
556         regno is in the right range.  Add comments.
557
558 2008-09-09  Rainer Orth  <ro@TechFak.Uni-Bielefeld.DE>
559
560         * Makefile.in (mips-tfile.o-warn): Don't error out on mips-tfile.c
561         warnings.
562         * mips-tfile.c (copy_object): Cast alloca result to int *.
563         * mips-tdump.c (print_symbol): Cast xmalloc return values to
564         proper types.
565         Rename class to sclass.
566         (read_tfile): Cast read_seek return values to proper types.
567         Cast xcalloc return value to proper type.
568
569 2008-09-09  Rainer Orth  <ro@TechFak.Uni-Bielefeld.DE>
570
571         * config/sol2.h (REGISTER_TARGET_PRAGMAS): Move ...
572         * config/i386/sol2.h (REGISTER_SUBTARGET_PRAGMAS): ... here.
573         * config/sparc/sol2.h (REGISTER_TARGET_PRAGMAS): ... and here.
574
575 2008-09-09  Jan Hubicka  <jh@suse.cz>
576
577         * profile.c (is_edge_inconsistent): Add debug output; ignore
578         negative count on fake edges.
579         (is_inconsistent): Add debug output.
580
581 2008-09-09  Andrey Belevantsev  <abel@ispras.ru>
582
583         * haifa-sched.c (advance_one_cycle): Do not print '\n' before printing
584         dump message.
585         (choose_ready): When first insn is chosen from the ready list, also
586         dump it.
587
588 2008-09-09  Andrey Belevantsev  <abel@ispras.ru>
589
590         PR rtl-optimization/37360
591         * haifa-sched.c (max_issue): Do not assert that we never issue more
592         insns than issue_rate.  Add comment.
593
594 2008-09-09  Richard Guenther  <rguenther@suse.de>
595
596         * tree-cfg.c (verify_types_in_gimple_op): Remove.
597         (verify_types_in_gimple_call): Rename to ...
598         (verify_gimple_call): ... this.  Enhance.
599         (verify_types_in_gimple_cond): Remove.
600         (verify_gimple_comparison): New function ...
601         (verify_types_in_gimple_assign): ... split out from here.
602         (verify_types_in_gimple_return): Rename to ...
603         (verify_gimple_return): ... this.  Enhance.
604         (verify_types_in_gimple_switch): Rename to ...
605         (verify_gimple_switch): ... this.  Enhance.
606         (verify_gimple_goto): New function.
607         (verify_types_in_gimple_phi): Rename to ...
608         (verify_gimple_phi): ... this.  Enhance.
609         (verify_types_in_gimple_stmt): Adjust calls to helper functions.
610         Fold in single-statement cases from verify_types_in_gimple_seq_2.
611         (verify_types_in_gimple_seq_2): Remove cases handled in
612         verify_types_in_gimple_stmt.
613
614 2008-09-09  Bernd Schmidt  <bernd.schmidt@analog.com>
615
616         * config/bfin/bfin.c (n_regs_to_save): New static variable.
617         (push_multiple_operation, pop_multiple_operation): Set it.
618         (workaround_rts_anomaly): New function.
619         (workaround_speculation): New function, broken out of bfin_reorg.
620         (bfin_reorg): Call the new functions.
621
622 2008-09-09  Richard Guenther  <rguenther@suse.de>
623
624         PR middle-end/37354
625         PR middle-end/30165
626         * gimplify.c (gimplify_conversion): Change conversions of
627         non-register type to VIEW_CONVERT_EXPRs.
628         (gimplify_addr_expr): If we need to make the operand
629         addressable make sure to use a properly initialized
630         temporary for that so it gets a valid gimple store.
631
632 2008-09-09  Aldy Hernandez  <aldyh@redhat.com>
633
634         * function.h (struct function): Add function_start_locus.
635         * cfgexpand.c (gimple_expand_cfg): Use it.
636         * c-parser.c (c_parser_declaration_or_fndef): Set it.
637
638 2008-09-09  Richard Guenther  <rguenther@suse.de>
639
640         PR tree-optimization/37433
641         * tree-ssa-ccp.c (ccp_fold): Properly guard folding of
642         function calls.
643
644 2008-09-09  Richard Guenther  <rguenther@suse.de>
645
646         PR tree-optimization/37387
647         * tree-ssa-ifcombine.c (ifcombine_iforif): Convert the name
648         and bits to a common type.
649
650 2008-09-09  Nick Clifton  <nickc@redhat.com>
651
652         * config/v850/v850.md (return): Restore frame size restriction.
653
654 2008-09-09  Paolo Bonzini  <bonzini@gnu.org>
655
656         * c-common.c (c_expand_decl): Remove.
657         * c-common.h (anon_aggr_type_p): Remove prototype.
658         (DECL_ANON_UNION_ELEMS): Remove.
659         * c-objc-common.h (LANG_HOOKS_EXPAND_DECL): Remove.
660         * c-decl.c (anon_aggr_type_p): Remove.
661         * langhooks-def.h (LANG_HOOKS_EXPAND_DECL): Remove.
662         (LANG_HOOKS_INITIALIZER): Remove LANG_HOOKS_EXPAND_DECL.
663         * langhooks.h (struct lang_hooks): Remove expand_decl.
664         * langhooks.c (lhd_expand_decl): Remove.
665         * stmt.c (expand_anon_union_decl): Remove.
666         * tree.h (expand_anon_union_decl): Remove prototype.
667
668 2008-08-09  Andy Hutchinson  <hutchinsonandy@aim.com>
669
670         PR target/36609
671         * config/avr/avr.c (avr_reorg): Create RTL for reversed compare with
672         zero.
673         * config/avr/avr.md  (QISI) : Define mode iterator.
674         (negated_tst<mode>) : Redefine as split using mode macro.
675         (reversed_tstqi): Define insn as reversed compare with zero.
676         (reversed_tsthi): Ditto.
677         (reversed_tstsi): Ditto.
678
679 2008-09-08  Jakub Jelinek  <jakub@redhat.com>
680
681         PR middle-end/37393
682         * tree-inline.c (copy_bb): When replacing a gimple_call_va_arg_pack_p
683         call stmt by new_call, clear gimple_bb on stmt after gsi_replace.
684
685         PR middle-end/37414
686         * predict.c (optimize_function_for_size_p): Don't segfault if
687         FUN is NULL.
688         * fold-const.c (LOGICAL_OP_NON_SHORT_CIRCUIT, fold_truthop,
689         tree_swap_operands_p): Don't test cfun != NULL before calling
690         optimize_function_for_s*_p.
691
692 2008-09-08  Eric Botcazou  <ebotcazou@adacore.com>
693
694         * ira-color.c (ira_reuse_stack_slot): Set slot_num on success at the
695         end of the search.
696
697 2008-09-08  M R Swami Reddy <MR.Swami.Reddy@nsc.com>
698
699         * crx/crx.h (IRA_COVER_CLASSES): Define.
700
701 2008-09-08  Jakub Jelinek  <jakub@redhat.com>
702
703         PR middle-end/37337
704         * tree-ssa-dom.c (optimize_stmt): Call maybe_clean_or_replace_eh_stmt
705         even when a stmt has been gimple_modified_p, but after fold_stmt is
706         not any longer.  Remove unneeded may_have_exposed_new_symbols
707         initializations.
708
709 2008-09-08  Richard Guenther  <rguenther@suse.de>
710
711         PR tree-optimization/37421
712         * tree-ssa-sccvn.c (visit_copy): Make sure to fully
713         valueize the RHS.
714
715 2008-09-08  Jakub Jelinek  <jakub@redhat.com>
716
717         PR middle-end/37415
718         * opts.c (common_handle_option): Handle OPT_ftree_store_ccp.
719
720 2008-09-08  John David Anglin  <dave.anglin@nrc-cnrc.gc.ca>
721
722         PR driver/37409
723         * pa-hpux.h (LINK_SPEC): Strip -fwhole-program.
724         * pa-hpux10.h (LINK_SPEC): Likewise.
725         * pa-hpux11.h (LINK_SPEC): Likewise.
726
727 2008-09-07  John David Anglin  <dave.anglin@nrc-cnrc.gc.ca>
728
729         * pa32-regs.h (IRA_COVER_CLASSES): Define.
730         * pa64-regs.h (IRA_COVER_CLASSES): Define.
731
732 2008-09-07  Helge Deller  <deller@gmx.de>
733
734         * pa/linux-atomic.c: New file.
735         * pa/t-linux (LIB2FUNCS_STATIC_EXTRA): Define.
736         * pa/t-linux64 (LIB2FUNCS_STATIC_EXTRA): Define.
737
738 2008-09-07  Richard Guenther  <rguenther@suse.de>
739             Ira Rosen  <irar@il.ibm.com>
740
741         PR tree-optimization/36630
742         * tree-vect-transform.c (vect_update_ivs_after_vectorizer):
743         Call STRIP_NOPS before calling evolution_part_in_loop_num.
744
745 2008-09-07  Dorit Nuzman  <dorit@il.ibm.com>
746             Ira Rosen  <irar@il.ibm.com>
747
748         PR tree-optimization/35642
749         * config/rs6000/altivec.md (mulv8hi3): Implement.
750
751 2008-09-06  Jeff Law <law@redhat.com>
752
753         * h8300/h8300.h (IRA_COVER_CLASSES): Define.
754
755 2008-09-06  Jan Hubicka  <jh@suse.cz>
756
757         PR tree-optimization/14703
758         * tree-ssa-live.c (remove_unused_scope_block_p): Remove ignored
759         declarations.
760         * passes.c (init_optimization_passes): Recompute inline parameters.
761
762 2008-09-06  Richard Sandiford  <rdsandiford@googlemail.com>
763
764         * config/mips/mips.c (mips_function_ok_for_sibcall): Check for
765         DECL being null.
766
767 2008-09-06  Richard Sandiford  <rdsandiford@goolemail.com>
768             Peter Fuerst  <post@pfrst.de>
769
770         * doc/invoke.texi: Document -mr10k-cache-barrier=.
771         * doc/extend.texi: Document __builtin_mips_cache.
772         * config/mips/mips-ftypes.def: Add a (VOID, SI, CVPOINTER) entry.
773         * config/mips/mips.opt (mr10k-cache-barrier=): New option.
774         * config/mips/mips.h (TARGET_CPU_CPP_BUILTINS): Define
775         __GCC_HAVE_BUILTIN_MIPS_CACHE.
776         (TARGET_CACHE_BUILTIN, ISA_HAS_CACHE): New macros.
777         * config/mips/mips.c (mips_r10k_cache_barrier_setting): New enum.
778         (set_push_mips_isas): New variable.
779         (mips_r10k_cache_barrier): New variable.
780         (cache): New availability predicate.
781         (mips_builtins): Add an entry for __builtin_mips_cache.
782         (mips_build_cvpointer_type): New function.
783         (MIPS_ATYPE_CVPOINTER): New macro.
784         (mips_prepare_builtin_arg): Only use the insn's mode if the rtx's
785         mode is VOIDmode.
786         (r10k_simplified_address_p, r10k_simplify_address)
787         (r10k_uncached_address_p, r10k_safe_address_p)
788         (r10k_needs_protection_p_1, r10k_needs_protection_p_store)
789         (r10k_needs_protection_p_call, r10k_needs_protection_p)
790         (r10k_insert_cache_barriers): New functions.
791         (mips_reorg_process_insns): Delete cache barriers after a
792         branch-likely instruction.
793         (mips_reorg): Call r10k_insert_cache_barriers.
794         (mips_handle_option): Handle OPT_mr10k_cache_barrier_.
795         * config/mips/mips.md (UNSPEC_MIPS_CACHE): New constant.
796         (UNSPEC_R10K_CACHE_BARRIER): Likewise.
797         (mips_cache, r10k_cache_barrier): New define_insns.
798
799 2008-09-06  Richard Sandiford  <rdsandiford@googlemail.com>
800
801         * ira-int.h (ira_zero_hard_reg_set, ira_one_hard_reg_set): Delete.
802         * ira-color.c (setup_allocno_left_conflicts_num): Use
803         hard_reg_set_equal_p instead of a comparison with
804         ira_zero_hard_reg_set.
805         * ira.c (setup_reg_subclasses): Likewise.
806         (setup_cover_and_important_classes): Likewise.
807         (setup_class_translate): Likewise.
808         (setup_reg_class_intersect_union): Likewise.
809         (ira_zero_hard_reg_set, ira_one_hard_reg_set): Delete.
810         (ira_init_once): Don't initialize them.
811
812 2008-09-05  Vladimir Makarov  <vmakarov@redhat.com>
813
814         * doc/tm.texi (IRA_COVER_CLASSES): Fix a typo.
815
816 2008-09-05  Vladimir Makarov  <vmakarov@redhat.com>
817
818         * ira-color.c (ira_fast_allocation): Permit global allocno allocation.
819
820 2008-09-05  Trevor Smigiel <Trevor_Smigiel@playstation.sony.com>
821
822         Improved branch hints, safe hints, and scheduling.
823
824         * haifa-sched.c (sched_emit_insn) : Define.
825         * sched-int.h (sched_emit_insn) : Add prototype.
826         * doc/invoke.texi (-mdual-nops, -mhint-max-nops,
827         -mhint-max-distance -msafe-hints) : Document.
828         * config/spu/spu.c (spu_flag_var_tracking): New.
829         (TARGET_SCHED_INIT_GLOBAL, TARGET_SCHED_INIT,
830         TARGET_SCHED_REORDER, TARGET_SCHED_REORDER2,
831         TARGET_ASM_FILE_START): Define.
832         (TARGET_SCHED_ADJUST_PRIORITY): Remove.
833         (STOP_HINT_P, HINTED_P, SCHED_ON_EVEN_P): Define.
834         (spu_emit_branch_hint): Add blocks argument.
835         (insert_branch_hints, insert_nops): Remove.
836         (pad_bb, insert_hbrp_for_ilb_runout, insert_hbrp, in_spu_reorg,
837         uses_ls_unit, spu_sched_init_global, spu_sched_init,
838         spu_sched_reorder, asm_file_start): New functions.
839         (clock_var, spu_sched_length, pipe0_clock,
840         pipe1_clock, prev_clock_var, prev_priority,
841         spu_ls_first, prev_ls_clock): New static variables.
842         * config/spu/spu.h (TARGET_DEFAULT): Add MASK_SAFE_HINTS.
843         * config/spu.md (iprefetch): Add operand, make it clobber MEM.
844         (nopn_nv): Add a non-volatile version of nop.
845         * config/spu/spu.opt (-mdual-nops, -mhint-max-nops,
846         -mhint-max-distance, -msafe-hints): New options.
847
848 2008-09-05  Janis Johnson  <janis187@us.ibm.com>
849             Samuel Tardieu  <sam@rfc1149.net>
850
851         * opts.c (decode_options): Combine nested if statements.
852
853         PR target/37283
854         * opts.c (decode_options): Handle more relationships among
855         unit-at-a-time, toplevel-reorder, and section-anchors.
856
857 2008-09-05  David Daney  <ddaney@avtrex.com>
858
859         * doc/install.texi (--enable-reduced-reflection): Document new option.
860
861 2008-09-05  Bob Wilson  <bob.wilson@acm.org>
862
863         * config/xtensa/predicates.md (nonimmed_operand, mem_operand): Use
864         constantpool_mem_p.
865         (constantpool_operand): New.
866         (move_operand): Disallow sub-word modes for the constant pool.
867         * config/xtensa/xtensa.c (TARGET_SECONDARY_RELOAD): Define.
868         (xtensa_secondary_reload_class): Replace with....
869         (xtensa_secondary_reload): this function.  Remove SIGN_EXTEND check.
870         Set icode for sub-word reloads from the constant pool.
871         * config/xtensa/xtensa.h (SECONDARY_INPUT_RELOAD_CLASS): Delete.
872         (SECONDARY_OUTPUT_RELOAD_CLASS): Delete.
873         * config/xtensa/xtensa.md (reload<mode>_literal): New.
874         * config/xtensa/xtensa-protos.h: Update prototypes.
875
876 2008-09-05  Joseph Myers  <joseph@codesourcery.com>
877
878         * config/mips/mips.h (enum reg_class): Add FRAME_REGS.
879         (REG_CLASS_NAMES): Update.
880         (REG_CLASS_CONTENTS): Update.
881         * config/mips/mips.c (mips_regno_to_class): Use FRAME_REGS instead
882         of ALL_REGS for regs 77 and 78.
883         * function.c (instantiate_virtual_regs_in_insn): Assert that
884         return value of simplify_gen_subreg is not NULL.
885
886 2008-09-05  Paolo Bonzini  <bonzini@gnu.org>
887
888         * emit-rtl.c (gen_rtvec): Rewrite not using gen_rtvec_v.
889         (gen_rtvec_v): Fix coding standards.
890
891 2008-09-04  Jan Hubicka  <jh@suse.cz>
892
893         * i386.c (decide_alg): Be more conservative about optimizing for size.
894
895 2008-09-04  Ian Lance Taylor  <iant@google.com>
896
897         * varasm.c (narrowing_initializer_constant_valid_p): New
898         static function.
899         (initializer_constant_valid_p): Call it.
900
901 2008-09-04  Jeff Law  <law@redhat.com>
902
903         * fold-const.c (native_encode_real): Fix computation of WORDS.
904         (native_interpret_real): Likewise.
905
906 2008-09-04  Janis Johnson  <janis187@us.ibm.com>
907
908         * config/rs6000/t-rs6000: Remove target gt-rs6000.h.
909
910 2008-09-04  Vladimir Makarov  <vmakarov@redhat.com>
911
912         * ira-conflicts.c (process_regs_for_copy): Check insn to check
913         that the cost is already taken into account in ira-costs.c
914
915         * ira-int.h (ira_debug_copy, ira_debug_copies): New.
916
917         * ira-build.c (print_copy, print_copies, ira_debug_copy,
918         ira_debug_copies): New.
919         (ira_bulid): Call print_copies.
920
921         * doc/tm.texi (IRA_COVER_CLASSES): Fix the description.
922
923 2008-09-04  Samuel Tardieu  <sam@rfc1149.net>
924
925         PR target/32783
926         * config/rs6000/rs6000.c (optimization_options): Remove check of
927         flag_toplevel_order.
928
929 2008-09-04  Adam Nemet  <anemet@caviumnetworks.com>
930
931         * config/mips/mips.h (ISA_HAS_SEQ_SNE): New macro.
932         * config/mips/mips.c (mips_expand_scc): Also expand seq and sne if
933         second operand is a reg_imm10_operand.
934         * config/mips/mips.md (*seq_<GPR:mode><GPR2:mode>_seq,
935         *sne_<GPR:mode><GPR2:mode>_sne): New patterns.
936         (*seq_<GPR:mode><GPR2:mode>): Rename to
937         *seq_zero_<GPR:mode><GPR2:mode>.  Don't match if
938         ISA_HAS_SEQ_SNE.
939         (*seq_<GPR:mode><GPR2:mode>_mips16): Rename to
940         *seq_zero_<GPR:mode><GPR2:mode>_mip16.  Don't match if
941         ISA_HAS_SEQ_SNE.
942         (*sne_<GPR:mode><GPR2:mode>): Rename to
943         *sne_zero_<GPR:mode><GPR2:mode>.  Don't match if
944         ISA_HAS_SEQ_SNE.
945
946 2008-09-04  Adam Nemet  <anemet@caviumnetworks.com>
947
948         * config/mips/mips.h (ISA_HAS_EXTS): New macro.
949         * config/mips/mips.md (*ashr_trunc<mode>): Name the pattern
950         combining an arithmetic right shift by more than 31 and a
951         trunction.  Don't match for out-of-range shift amounts.  Set
952         attribute mode to <MODE>.
953         (*lshr32_trunc<mode>): Name the pattern combining a logical right
954         shift by 32 and and a truncation.  Set attribute mode to <MODE>.
955         (*<optab>_trunc<mode>_exts): New pattern for truncated right
956         shifts by less than 32.
957         (extv): Change predicate on first operand to accept registers.
958         Change predicate of the other operands from immediate_operand to
959         const_int_operand.  Expand exts when source is a register.
960         (extzv): Change predicate of the constant operands from
961         immediate_operand to const_int_operand.
962         (extzv<mode>): Change predicate of the constant operands from
963         immediate_operand to const_int_operand and no constraint. Also
964         remove mode.
965         (*extzv_trunc<mode>_exts): New pattern.
966
967 2008-09-04  Adam Nemet  <anemet@caviumnetworks.com>
968
969         * config/mips/mips.h (ISA_HAS_CINS): New macro.
970         * config/mips/mips-protos.h (mask_low_and_shift_p,
971         mask_low_and_shift_len): Declare.
972         * config/mips/mips.c (mask_low_and_shift_p,
973         mask_low_and_shift_len): New functions.
974         (mips_print_operand): Handle new operand prefix "m".
975         * config/mips/mips.md (*cins<mode>): New pattern.
976
977 2008-09-04  Bernd Schmidt  <bernd.schmidt@analog.com>
978
979         * config/bfin/bfin.c (gen_one_bundle): Don't create new nops when
980         optimizing for size.
981
982 2008-09-04  Richard Sandiford  <rdsandiford@googlemail.com>
983
984         * df-scan.c (df_get_entry_block_def_set): Add STACK_POINTER_REGNUM
985         regardless of epilogue_completed.
986
987 2008-09-04  Vladimir Makarov  <vmakarov@redhat.com>
988
989         PR middle-end/37359
990         * ira-lives.c (process_bb_node_lives): Check setjmp.
991
992 2008-09-04  Richard Sandiford  <rdsandiford@googlemail.com>
993
994         PR middle-end/37243
995         * ira-build.c (form_loop_tree): Reverse BB walk.
996         (create_bb_allocnos): Likewise.
997         * ira-lives.c (make_regno_born_and_dead, regs_set): Delete.
998         (mark_reg_store): Rename to...
999         (mark_ref_live): ...this and take a df_ref argument instead of
1000         note_stores arguments.  Assert that we have a register.
1001         (mark_reg_clobber): Delete.
1002         (def_conflicts_with_inputs_p): New function.
1003         (mark_reg_conflicts): Delete.
1004         (mark_reg_death): Rename to...
1005         (mark_ref_dead): ...this and take a df_ref argument instead of
1006         a register.  Assert that we have a register.
1007         (process_bb_node_lives): Hoist frequency calculation out of
1008         instruction walk.  Convert from a forwards scan to a backwards scan.
1009         Use DF_REF_USES and DF_REF_DEFS instead of register notes and
1010         note_stores.  Remove EH_RETURN_DATA_REGNO and regs_set handling.
1011         (create_allocno_live_ranges): Don't create regs_set.
1012
1013 2008-09-04  Ian Lance Taylor  <iant@google.com>
1014
1015         * rtl.h (LABEL_REF_NONLOCAL_P): Don't check for REG_LABEL_OPERAND
1016         or REG_LABEL_TARGET.
1017         * calls.c (emit_library_call_value_1): Use MEM_P rather than
1018         comparing MODE with MEM.
1019         * gimple.c (gimple_build_predict): Cast END_PREDICTORS before
1020         comparing with GF_PREDICT_TAKEN.
1021         (gimple_get_lhs): Change code to enum gimple_code.
1022         (gimple_set_lhs): Likewise.
1023         * ifcvt.c (noce_process_if_block): Correct GET_MODE to GET_CODE.
1024         * omp-low.c (find_omp_clause): Change kind parameter to enum
1025         omp_clause_code.
1026         * tree-flow.h (find_omp_clause): Update declaration.
1027         * regrename.c (clear_dead_regs): Change kind parameter to enum
1028         reg_note.
1029         * reload1.c (eliminate_regs_1): Use REG_NOTE_KIND rather than
1030         GET_MODE.
1031         * see.c (see_get_extension_data): Change return type to enum
1032         entry_type.  Change UNKNOWN to NOT_RELEVANT, SIGN_EXTEND to
1033         SIGNED_EXTENDED_DEF, ZERO_EXTEND to ZERO_EXTENDED_DEF.
1034         (see_gen_normalized_extension): Change extension_code parameter to
1035         enum entry_type.
1036         (see_seek_pre_extension_expr): Change extension_code to enum
1037         entry_type.
1038         (see_merge_one_def_extension): Likewise.
1039         (see_handle_relevant_defs): Likewise.
1040         (see_handle_relevant_uses): Likewise.
1041         (see_analyze_one_def): Likewise.
1042         * tree-cfg.c (need_fake_edge_p): Compare gimple code with
1043         GIMPLE_ASM rather than ASM_EXPR.
1044         * tree-ssa-alias.c (is_escape_site): Compare gimple code with
1045         GIMPLE_RETURN rather than RETURN_EXPR.
1046         * tree-ssa-ccp.c (likely_value): Change code to enum gimple_code.
1047         (evaluate_stmt): Likewise.
1048         * tree-vect-analyze.c (vect_analyze_operations): Change relevance
1049         to enum vect_relevant.
1050         (vect_mark_stmts_to_be_vectorized): Change assertion to not
1051         compare gimple codes with tree codes.
1052
1053 2008-09-04  Paul Brook  <paul@codesourcery.com>
1054
1055         * config/arm/arm.c (arm_size_rtx_costs): Call cost function.
1056
1057 2008-09-04  Bernd Schmidt  <bernd.schmidt@analog.com>
1058
1059         * config/bfin/bfin.c (bfin_function_ok_for_sibcall): Restore a null
1060         pointer check lost in the recent no-unit-at-a-time patch.
1061
1062 2008-09-04  Jan Hubicka  <jh@suse.cz>
1063
1064         PR middle-end/37343
1065         * tree-switch-conversion.c (check_final_bb): Accept only IP
1066         invariants.
1067
1068 2008-09-04  Jan Hubicka  <jh@suse.cz>
1069
1070         * tree-vrp.c (vrp_evaluate_conditional_warnv_with_ops_using_ranges):
1071         Break out from ...
1072         (vrp_evaluate_conditional_warnv_with_ops): ... this one.  Add
1073         using_ranges argument.
1074         (vrp_evaluate_conditional): Avoid bogus warning for type range.
1075         (vrp_visit_cond_stmt): Update call of
1076         vrp_evaluate_conditional_warnv_with_ops
1077
1078 2008-09-04  Jan Hubicka  <jh@suse.cz>
1079
1080         PR tree-optimization/37345
1081         PR tree-optimization/37358
1082         PR tree-optimization/37357
1083         * tree.c (build_function_type_skip_args): Build distinct type copy;
1084         set TYPE_CONTEXT.
1085         (build_function_decl_skip_args): Set type of new decl not orig decl;
1086         clear DECL_VINDEX for methods turned into functions.
1087
1088 2008-09-04  Nick Clifton  <nickc@redhat.com>
1089
1090         * configure.ac (HAVE_GAS_LCOMM_WITH_ALIGNMENT): New assembler check.
1091         * configure: Regenerate.
1092         * config.in: Regenerate.
1093         * config/i386/bsd.h (ASM_OUTPUT_ALIGNED_LOCAL): Use .lcomm with an
1094         alignment field, if it is supported.
1095
1096 2008-09-04  Kai Tietz  <kai.tietz@onevision.com>
1097
1098         * config/i386/t-mingw32 (SHLIB_LC): Change order of import
1099         libraries.
1100
1101 2008-09-03  David Edelsohn  <edelsohn@gnu.org>
1102
1103         * config/rs6000/rs6000.c (processor_target_table): Do not
1104         enable VMX for POWER6.
1105
1106 2008-09-03  Anton Blanchard  <anton@samba.org>
1107
1108         * config/rs6000/rs6000.c (rs6000_split_lock_test_and_set): Do not
1109         emit memory barrier before operation.
1110
1111 2008-09-03  John David Anglin  <dave.anglin@nrc.cnrc.gc.ca>
1112
1113         PR testsuite/37325
1114         * config/pa/pa64-hpux.h (ASM_OUTPUT_EXTERNAL_REAL): Call
1115         default_elf_asm_output_external.
1116
1117 2008-09-03  Jeff Law  <law@redhat.com>
1118
1119         * h8300.c (expand_a_shift): Avoid invalid RTL sharing.
1120
1121 2008-09-03  Richard Henderson  <rth@redhat.com>
1122
1123         * config/alpha/alpha.c (alpha_split_lock_test_and_set): Move
1124         memory barrier to below the test-and-set.
1125         (alpha_split_lock_test_and_set_12): Likewise.
1126
1127 2008-09-03  Vladimir Makarov  <vmakarov@redhat.com>
1128
1129         PR rtl-opt/37243
1130
1131         * ira-int.h (ira_loop_tree_node): Rename mentioned_allocnos to
1132         all_allocnos.
1133
1134         * ira-color.c (print_loop_title): Use all_allocnos.
1135         (color_pass): Ditto.  Don't add border_allocnos.  Check that
1136         subloop allocno in the correspdoning bitmap all_allocnos.
1137
1138         * ira-emit.c (change_loop): Use all_allocnos.
1139
1140         * ira-build.c (create_loop_tree_nodes, finish_loop_tree_node):
1141         Ditto.
1142         (ira_create_allocno): Set up all_allocnos bit for the created
1143         allocno.
1144         (create_cap_allocno): Remove setting mentioned_allocnos.
1145         (create_insn_allocnos): Ditto.
1146         (remove_unnecessary_allocnos): Use all_allocnos.
1147         (check_allocno_creation): Check that allocnos are in the
1148         corresponding bitmap all_allocnos.
1149
1150 2008-09-03  Vladimir Makarov  <vmakarov@redhat.com>
1151
1152         PR rtl-opt/37243
1153
1154         * ira-conflicts.c (REG_SUBREG_P, go_through_subreg): New.
1155         (process_regs_for_copy): Process subregs.  Refine check when cost
1156         is taken into account in ira-costs.c.
1157         (process_reg_shuffles): Use REG_SUBREG_P.
1158         (add_insn_allocno_copies): Ditto.  Ignore modes.
1159
1160         * ira-color.c (conflict_allocno_vec): New.
1161         (COST_HOP_DIVISOR): New macro.
1162         (update_copy_costs_1): Use it.
1163         (update_conflict_hard_regno_costs): New function.
1164         (assign_hard_reg): Use it.
1165         (ira_color): Allocate and free conflict_allocno_vec.
1166
1167 2008-09-03  Vladimir Makarov  <vmakarov@redhat.com>
1168
1169         PR rtl-opt/37296
1170
1171         * ira-int.h (ira_sort_insn_chain): Remove.
1172
1173         * ira.c (basic_block_order_nums, chain_insn_order,
1174         chain_freq_compare, chain_bb_compare, ira_sort_insn_chain): Remove.
1175         (ira): Don't call ira_sort_insn_chain.
1176
1177         * reload1.c (reload): Don't call ira_sort_insn_chain.
1178
1179 2008-09-03  Andrew Pinski  <andrew_pinski@playstation.sony.com>
1180
1181         PR middle-end/37293
1182         * cgraphunit.c (update_call_expr): Remove eh regions from statements
1183         which become non throw.
1184         (cgraph_function_versioning): Also clear DECL_WEAK.  Call
1185         update_call_expr after updating the flags on the decl.
1186
1187 2008-09-03  Jan Hubicka  <jh@suse.cz>
1188
1189         PR tree-optimization/37315
1190         * cgraph.c (cgraph_create_edge): Use gimple_has_body_p.
1191         * cgraphunit.c (verify_cgraph_node): drop gimple_body check.
1192         (cgraph_analyze_functions): Use node->analyzed
1193         (cgraph_mark_functions_to_output): Likewise.
1194         (cgraph_expand_function): All functions can be released after
1195         expanding.
1196         (cgraph_optimize): Use gimple_has_body_p.
1197         * ipa-inline.c (cgraph_clone_inlined_nodes): Use analyzed flag.
1198         (cgraph_decide_inlining_incrementally): Likewise.
1199         (inline_transform): Inline transform.
1200         * tree-inline.c (initialize_cfun): Do now shallow copy structure;
1201         copy fields needed.
1202         (inlinable_function_p): Drop gimple_body check.
1203         (expand_call_inline): Use gimple_has_body_p.
1204         * gimple.c (gimple_has_body_p): New.
1205         * gimple.h (gimple_has_body_p): Add prototype.
1206         * tree-cfg.c (execute_build_cfg): Remove gimple_body.
1207         (dump_function_to_file): Use gimple_has_body_p check.
1208
1209 2008-09-03  Jakub Jelinek  <jakub@redhat.com>
1210
1211         PR c++/37346
1212         * gimple.h (gimple_has_substatements): GIMPLE_OMP_CRITICAL has
1213         substatements.
1214         * tree-inline.c (remap_gimple_stmt): Handle GIMPLE_OMP_CRITICAL.
1215
1216 2008-09-03  Bernd Schmidt  <bernd.schmidt@analog.com>
1217
1218         From Michael Frysinger  <michael.frysinger@analog.com>
1219         * config/bfin/bfin.c (bfin_cpus[]): Add 0.1 for bf522, bf523, bf524,
1220         bf525, bf526, bf527, bf542, bf544, bf547, bf548, and bf549.  Add 0.2
1221         for bf538.
1222
1223 2008-09-03  Hari Sandanagobalane  <hariharan@picochip.com>
1224
1225         Add picoChip port.
1226         * doc/extend.texi: Document picoChip builtin functions.
1227         * doc/invoke.texi: Document picoChip options.
1228         * doc/contrib.texi: Add picoChip contribution.
1229         * doc/md.texi: Document picoChip constraints.
1230         * config.gcc: Add picochip-*-*.
1231         * config/picochip/: Add new port.
1232
1233 2008-09-03  Richard Guenther  <rguenther@suse.de>
1234
1235         PR tree-optimization/37328
1236         * tree-sra.c (sra_build_assignment): Gimplify properly.
1237         (generate_copy_inout): Take the correct stmt as definition,
1238         remove bogus assert.
1239
1240 2008-09-03  Bernd Schmidt  <bernd.schmidt@analog.com>
1241
1242         * config/bfin/bfin.c (bfin_expand_prologue): Honour no_stack_limit
1243         attributes.
1244
1245         From Michael Frysinger  <michael.frysinger@analog.com>
1246         * config/bfin/bfin.c (bfin_handle_option): Remove BF561 warning.
1247
1248 2008-09-03 Danny Smith  <dannysmith@usrs.sourceforge.net>
1249
1250         * gthr-win32.h (CONST_CAST2): Really make sure CONST_CAST2 is defined.
1251         (__gthread_setspecific): Revert 2008-08-31 change to
1252         __GTHREAD_HIDE_W32API case.  Apply it to !__GTHREAD_HIDE_W32API case.
1253
1254 2008-09-02  Aldy Hernandez  <aldyh@redhat.com>
1255
1256         * diagnostic.c (error_at): New.
1257         * toplev.h (error_at): New prototype.
1258         * c-typeck.c (build_array_ref): Call error_at instead of error.
1259         Pass location to pedwarn.
1260
1261 2008-09-02  Adam Nemet  <anemet@caviumnetworks.com>
1262
1263         * sel-sched.c (sel_hard_regno_rename_ok): Mark arguments unused.
1264
1265 2008-09-02  Jakub Jelinek  <jakub@redhat.com>
1266
1267         * dwarf2out.c (tree_add_const_value_attribute): Only handle
1268         VAR_DECL and CONST_DECL.
1269
1270 2008-09-02  H.J. Lu  <hongjiu.lu@intel.com>
1271             Jakub Jelinek  <jakub@redhat.com>
1272
1273         * config/i386/i386.c (X86_64_VARARGS_SIZE): Removed.
1274         (setup_incoming_varargs_64): Assume cum != NULL. Set/check
1275         ix86_varargs_gpr_size and ix86_varargs_fpr_size.  Use
1276         ix86_varargs_gpr_size instead of X86_64_REGPARM_MAX.
1277         Don't set ix86_save_varrargs_registers.
1278         (ix86_setup_incoming_varargs): Assume cum != NULL.
1279         (ix86_va_start): Check ix86_varargs_gpr_size and
1280         ix86_varargs_fpr_size instead of cfun->va_list_gpr_size and
1281         cfun->va_list_fpr_size, respectively.  Subtract 8*X86_64_REGPARM_MAX
1282         from frame pointer if ix86_varargs_gpr_size == 0.
1283         (ix86_compute_frame_layout): Updated.
1284         * config/i386/i386.h (ix86_save_varrargs_registers): Removed.
1285         (ix86_varargs_gpr_size): Define.
1286         (ix86_varargs_fpr_size): Likewise.
1287         (machine_function): Remove save_varrargs_registers.
1288         Add varargs_gpr_size and varargs_fpr_size.
1289
1290 2008-09-02  Jakub Jelinek  <jakub@redhat.com>
1291
1292         * config/alpha/alpha.c (va_list_skip_additions,
1293         alpha_stdarg_optimize_hook, alpha_gimplify_va_arg_1): Tuplify.
1294         (alpha_gimplify_va_arg): Call unshare_expr on second use of
1295         offset_field.
1296
1297         PR tree-optimization/36766
1298         * tree-cfg.c (gimple_purge_all_dead_eh_edges): Do nothing
1299         for already removed basic blocks.
1300
1301         PR target/36332
1302         * real.c (real_maxval): Clear a lower bit to make real_maxval
1303         match get_max_float for IBM long double format.
1304
1305 2008-09-02  Andreas Schwab  <schwab@suse.de>
1306
1307         * configure.ac: Use m4_quote to quote the expansion of m4_do.
1308         * configure: Regenerate.
1309
1310 2008-09-02  Richard Sandiford  <rdsandiford@googlemail.com>
1311
1312         * simplify-rtx.c (simplify_binary_operation_1): Check for CONST,
1313         SYMBOL_REF and LABEL_REF when applying plus_constant, instead of
1314         checking for a non-VOID CONSTANT_P.
1315
1316 2008-09-02  Jan Hubicka  <jh@suse.cz>
1317
1318         * predict.c (pass_strip_predict_hints): Avoid bugs dump file.
1319         * expmed.c (expand_divmod): Fix test of smod_pow2_cheap and
1320         sdiv_pow2_cheap
1321
1322 2008-09-02  H.J. Lu  <hongjiu.lu@intel.com>
1323
1324         * expr.c (emit_group_store): Don't assert stack temp mode size.
1325
1326 2008-09-02  Sebastian Pop  <sebastian.pop@amd.com>
1327             Tobias Grosser  <grosser@fim.uni-passau.de>
1328             Jan Sjodin  <jan.sjodin@amd.com>
1329             Harsha Jagasia  <harsha.jagasia@amd.com>
1330             Dwarakanath Rajagopal  <dwarak.rajagopal@amd.com>
1331             Konrad Trifunovic  <konrad.trifunovic@inria.fr>
1332             Adrien Eliche  <aeliche@isty.uvsq.fr>
1333
1334         Merge from graphite branch.
1335         * graphite.c: New.
1336         * graphite.h: New.
1337         * tree-loop-linear.c (perfect_loop_nest_depth): Export.
1338         * doc/invoke.texi (-floop-block, -floop-interchange,
1339         -floop-strip-mine): Document new flags.
1340         * tree-into-ssa.c (gimple_vec): Moved...
1341         * tree-loop-distribution.c (rdg_component): Moved...
1342         * cfgloopmanip.c: Include tree-flow.h.
1343         (update_dominators_in_loop): New.
1344         (create_empty_if_region_on_edge): New.
1345         (create_empty_loop_on_edge): New.
1346         (loopify): Use update_dominators_in_loop.
1347         * tree-pass.h (pass_graphite_transforms): Declared.
1348         * configure: Regenerate.
1349         * tree-phinodes.c (make_phi_node): Export.
1350         (add_phi_node_to_bb): New, split from create_phi_node.
1351         * tree-chrec.c (for_each_scev_op): New.
1352         * tree-chrec.h (for_each_scev_op): Declared.
1353         * tree-ssa-loop-ivopts.c (get_phi_with_result): New.
1354         (remove_statement): Call get_phi_with_result.
1355         * config.in (HAVE_cloog): Undef.
1356         * gdbinit.in (pgg): New.
1357         * timevar.def (TV_GRAPHITE_TRANSFORMS): New.
1358         * tree-ssa-loop.c (graphite_transforms): New.
1359         (gate_graphite_transforms): New.
1360         (pass_graphite_transforms): New.
1361         * configure.ac (PPLLIBS, PPLINC, CLOOGLIBS, CLOOGINC,
1362         HAVE_cloog): Defined.
1363         * tree-vectorizer.c (rename_variables_in_bb): Export.
1364         * tree-data-ref.c (dr_may_alias_p): Export.
1365         (stmt_simple_memref_p): New.
1366         (find_data_references_in_stmt): Export.
1367         (find_data_references_in_loop): Export.
1368         (create_rdg_edge_for_ddr): Initialize RDGE_RELATION.
1369         (create_rdg_edges_for_scalar): Initialize RDGE_RELATION.
1370         (create_rdg_vertices): Export.
1371         (build_empty_rdg): New.
1372         (build_rdg): Call build_empty_rdg.  Free dependence_relations.
1373         * tree-data-ref.h (rdg_component): ... here.
1374         (scop_p): New.
1375         (struct data_reference): Add a field scop.
1376         (DR_SCOP): New.
1377         (find_data_references_in_loop): Declared.
1378         (find_data_references_in_stmt): Declared.
1379         (create_rdg_vertices): Declared.
1380         (dr_may_alias_p): Declared.
1381         (stmt_simple_memref_p): Declared.
1382         (struct rdg_edge): Add a field ddr_p relation.
1383         (build_empty_rdg): Declared.
1384         * lambda.h (lambda_matrix): Declare a VEC of.
1385         (find_induction_var_from_exit_cond): Declared.
1386         (lambda_vector_compare): New.
1387         * common.opt (fgraphite, floop-strip-mine,
1388         floop-interchange, floop-block): New flags.
1389         * lambda-code.c (find_induction_var_from_exit_cond): Export.
1390         * cfgloop.c (is_loop_exit): New.
1391         * cfgloop.h (is_loop_exit): Declared.
1392         (create_empty_if_region_on_edge): Declared.
1393         (create_empty_loop_on_edge): Declared.
1394         * tree-flow.h (add_phi_node_to_bb): Declared.
1395         (make_phi_node): Declared.
1396         (rename_variables_in_bb): Declared.
1397         (perfect_loop_nest_depth): Declared.
1398         (graphite_transform_loops): Declared.
1399         * Makefile.in (cfgloopmanip.o): Depend on TREE_FLOW_H.
1400         (graphite.o-warn): Add -Wno-error.
1401         (PPLLIBS, PPLINC, CLOOGLIBS, CLOOGINC): Declared.
1402         (LIBS): Add GMPLIBS, CLOOGLIBS, PPLLIBS.
1403         (INCLUDES): Add PPLINC, CLOOGINC.
1404         (OBJS-common): Add graphite.o.
1405         (graphite.o): Add rule.
1406         * gimple.h (gimple_vec): ... here.
1407         * tree-cfg.c (print_loops): Start printing at ENTRY_BLOCK_PTR.
1408         * passes.c (init_optimization_passes): Schedule
1409         pass_graphite_transforms.
1410
1411 2008-09-02  Samuel Tardieu  <sam@rfc1149.net>
1412
1413         PR target/37283
1414         * opts.c (decode_options): Move processing of -fno-unit-at-a-time
1415         and -fno-toplevel-reorder after handle_options.
1416
1417 2008-09-02  Paul Brook  <paul@codesourcery.com>
1418
1419         * config/arm/arm.c (arm_tune_cortex_a9): Define.
1420         (arm_override_options): Set arm_tune_cortex_a9.
1421         (arm_rtx_costs_1): Make register shifts more expensive on Cortex-A9.
1422         (arm_issue_rate): Handle cortexa9.
1423         * config/arm/arm.h (arm_tune_cortex_a9): Declare.
1424         * config/arm/arm-cores.def: Add cortex-a9.
1425         * config/arm/arm-tune.md: Regenerate.
1426         * config/arm/arm.md: Include cortex-a9.md.
1427         (generic_sched, generic_vfp): Add cortexa9.
1428         * config/arm/cortex-a9.md: New file.
1429
1430 2008-09-02  Richard Guenther  <rguenther@suse.de>
1431
1432         PR tree-optimization/37327
1433         * tree-vrp.c (register_new_assert_for): Make sure to not have
1434         TREE_OVERFLOW set on the bound.
1435
1436 2008-09-02  Alexander Monakov  <amonakov@ispras.ru>
1437
1438         Fixed typo in date of the 2008-09-01 MOVE_RATIO commit.
1439
1440         * config/ia64/ia64.opt (msched-ar-data-spec): Default to 1.
1441         * config/ia64/ia64.c (ia64_set_sched_flags): Always initialize
1442         spec_info->mask.
1443
1444 2008-09-02  Victor Kaplansky  <victork@il.ibm.com>
1445
1446         * gcc/config/spu/spu.md (divdf3): Removed.
1447
1448 2008-09-02  Jakub Jelinek  <jakub@redhat.com>
1449
1450         PR tree-optimization/37095
1451         * cgraph.c (cgraph_node): When creating new cgraph node after
1452         assembler_name_hash has been populated, record it in the hash
1453         table.
1454
1455 2008-09-01  Paul Brook  <paul@codesourcery.com>
1456
1457         * doc/invoke.texi: Document -mword-relocations.
1458         * config/arm/uclinux-elf.h (TARGET_DEFAULT_WORD_RELOCATIONS): Define.
1459         * config/arm/symbian.h (TARGET_DEFAULT_WORD_RELOCATIONS): Define.
1460         * config/arm/vxworks.h (TARGET_DEFAULT_WORD_RELOCATIONS): Define.
1461         * config/arm/arm.c (arm_split_constant): Use arm_emit_movpair.
1462         (arm_rtx_costs_1, arm_size_rtx_costs): Handle HIGH and LO_SUM.
1463         (arm_emit_movpair): New function.
1464         (arm_print_operand <c>): Handle sybolic addresses.
1465         * config/arm/arm.h (TARGET_USE_MOVT): Define.
1466         (TARGET_DEFAULT_WORD_RELOCATIONS): Define.
1467         * config/arm/arm-protos.h (arm_emit_movpair): Add prototype.
1468         * config/arm/arm.opt: Add -mword-relocations.
1469         * config/arm/arm.md (movsi): Use arm_emit_movpair.
1470         (arm_movt, arm_movw): New.
1471
1472 2008-09-01  Paul Brook  <paul@codesourcery.com>
1473
1474         * config/arm/arm.c (arm_override_options): Set arm_abi earlier.
1475         Allow Interworking on ARMv4 EABI based targets.
1476         * config/arm/bpabi.h (TARGET_FIX_V4BX_SPEC): Define.
1477         (SUBTARGET_EXTRA_ASM_SPEC, LINK_SPEC): Add TARGET_FIX_V4BX_SPEC.
1478
1479 2008-09-01  Paul Brook  <paul@codesourcery.com>
1480
1481         * config/arm/thumb2.md (thumb2_negscc): Match the correct operand for
1482         optimized LT0 test.  Remove optimization for GT.
1483
1484 2008-09-01  John David Anglin  <dave.anglin@nrc-cnrc.gc.ca>
1485
1486         * pa64-hpux.h (LIB_SPEC): Link against librt when building static
1487         openmp applications.
1488         * pa-hpux11.h (LIB_SPEC): Likewise.
1489
1490         * ira.c (setup_eliminable_regset): Only declare i if ELIMINABLE_REGS is
1491         defined.
1492
1493 2008-09-01  Jan Hubicka  <jh@suse.cz>
1494
1495         * predict.c (maybe_hot_count_p, maybe_hot_edge_p): When profile is
1496         present, use only counts; when guessed use only frequencies.
1497         (estimate_bb_frequencies): Use function_frequency.
1498         * profile.c (compute_branch_probabilities): Exit early when
1499         profile reading failed. Set profile_status.
1500         (branch_prob): Do not set profile_status.
1501
1502 2008-09-01  Aldy Hernandez  <aldyh@redhat.com>
1503
1504         * tree.c (protected_set_expr_location): New.
1505         * tree.h (protected_set_expr_location): New prototype.
1506         * c-tree.h (build_array_ref): Add argument.
1507         (parser_build_unary_op): Same.
1508         * c-typeck.c (build_indirect_ref): Handle new location argument.
1509         (build_array_ref): Same.
1510         (parser_build_unary_op): Same.
1511         * gimplify.c (gimplify_asm_expr): Set input_location before calling
1512         error.
1513         * c-omp.c (c_finish_omp_atomic): Pass location when calling
1514         build_indirect_ref.
1515         * c-common.c (finish_label_address_expr): Handle new location argument.
1516         * c-common.h (build_indirect_ref): Add argument.
1517         (finish_label_address_expr): Same.
1518         * c-parser.c (c_parser_unary_expression): Pass location to build
1519         functions.
1520         (c_parser_postfix_expression): Same.
1521
1522 2008-09-01  Paul Brook  <paul@codesourcery.com>
1523
1524         * config/arm/arm.md: Include cortex-r4f.md.
1525         (attr fpu): Update type list.
1526         (attr type): Add fcpys, ffariths, ffarithd, fadds, faddd, fconsts,
1527         fconstd, fcmps and fcmpd.
1528         (attr tune_cortexr4): Define.
1529         (attr generic_sched, attr generic_vfp): Use tune_cortexr4.
1530         * config/arm/vfp.md: Document fcpys, ffariths, ffarithd, fadds, faddd,
1531         fconsts, fconstd, fcmps and fcmpd.  Use them in insn patterns.
1532         * config/arm/arm.c (arm_issue_rate): Add cortexr4f.
1533         * config/arm/arm1020e.md (v10_ffarith, v10_farith): Use new insn types.
1534         * config/arm/cortex-a8-neon.md (cortex_a8_vfp_add_sub,
1535         cortex_a8_vfp_farith: Ditto.
1536         * config/arm/vfp11.md (vfp_ffarith, vfp_farith): Ditto.
1537         * config/arm/cortex-r4.md: Use tune_cortexr4.
1538         * config/arm/cortex-r4f.md: New file.
1539
1540 2008-09-01  Richard Guenther  <rguenther@suse.de>
1541
1542         PR tree-optimization/37305
1543         * tree-ssa-ccp.c (ccp_fold): Do not set TREE_OVERFLOW on
1544         the result of constant conversions.
1545         (fold_gimple_assign): Likewise.
1546
1547 2008-09-01  Andrey Belevantsev  <abel@ispras.ru>
1548
1549         * sel-sched-ir.c (cmp_v_in_regset_pool): Surround with
1550         #ifdef ENABLE_CHECKING.
1551
1552 2008-09-01  Andrey Belevantsev  <abel@ispras.ru>
1553
1554         * sel-sched-dump.c: Surround with #ifdef INSN_SCHEDULING.
1555         * sched-int.h (print_insn, print_pattern, print_value): Declare also
1556         when !INSN_SCHEDULING.
1557
1558 2008-09-01  Andreas Schwab  <schwab@suse.de>
1559
1560         * config/ia64/ia64.c (TARGET_ADDRESS_COST): Update.
1561
1562 2008-09-01  Paul Brook  <paul@codesourcery.com>
1563
1564         * config/arm/arm.c (arm_no_early_mul_dep): Handle multiply-subtract.
1565
1566 2008-09-01  Jan Hubicka  <jh@suse.cz>
1567
1568         * config/spu/spu.c (spu_expand_block_move) Update call of MOVE_RATIO.
1569
1570         * expr.c (MOVE_BY_PIECES_P, CLEAR_BY_PIECES_P, SET_BY_PIECES_P):
1571         Pass speed operand.
1572         * expr.h (MOVE_RATIO, CLEAR_RATIO, SET_RATIO): Update.
1573         * gimplify.c (gimplify_init_constructor): Add speed operand.
1574         * tree-sra.c (decide_block_copy): Likewise.
1575         * tree-inline.c (estimate_move_cost): Likewise.
1576         * config/alpha/alpha.h (MOVE_RATIO): Update.
1577         * config/frv/frv.c (MOVE_RATIO): Update.
1578         * config/spu/spu.h (MOVE_RATIO): Update.
1579         * config/sparc/sparc.h (MOVE_RATIO): Update.
1580         * config/i386/i386.h (MOVE_RATIO, CLEAR_RATIO): Update.
1581         * config/m68hc11/m68hc11.h (MOVE_RATIO): Update.
1582         * config/cris/cris.h (MOVE_RATIO): Update.
1583         * config/mn10300/mn10300.h (MOVE_RATIO): Update.
1584         * config/arm/arm.h (MOVE_RATIO): Update.
1585         * config/pa/pa.md: Update uses of MOVE_RATIO
1586         * config/pa/pa.h (MOVE_RATIO): Update.
1587         * config/mips/mips.h (MOVE_RATIO, MOVE_BY_PIECES,
1588         CLEAR_RATIO, SET_RATIO): Update.
1589         * config/h8300/h8300.h (MOVE_RATIO): Update.
1590         * config/v850/v850.h (MOVE_RATIO): Update.
1591         * config/bfin/bfin.h (MOVE_RATIO): Update.
1592
1593 2008-08-31  Andrey Belevantsev  <abel@ispras.ru>
1594             Dmitry Melnik  <dm@ispras.ru>
1595             Dmitry Zhurikhin  <zhur@ispras.ru>
1596             Alexander Monakov  <amonakov@ispras.ru>
1597             Maxim Kuvyrkov  <maxim@codesourcery.com>
1598
1599         * sel-sched.h, sel-sched-dump.h, sel-sched-ir.h, sel-sched.c,
1600         sel-sched-dump.c, sel-sched-ir.c: New files.
1601         * Makefile.in (OBJS-common): Add selective scheduling object
1602         files.
1603         (sel-sched.o, sel-sched-dump.o, sel-sched-ir.o): New entries.
1604         (SEL_SCHED_IR_H, SEL_SCHED_DUMP_H): New entries.
1605         (sched-vis.o): Add dependency on $(INSN_ATTR_H).
1606         * cfghooks.h (get_cfg_hooks, set_cfg_hooks): New prototypes.
1607         * cfghooks.c (get_cfg_hooks, set_cfg_hooks): New functions.
1608         (make_forwarder_block): Update loop latch if we have redirected
1609         the loop latch edge.
1610         * cfgloop.c (get_loop_body_in_custom_order): New function.
1611         * cfgloop.h (LOOPS_HAVE_FALLTHRU_PREHEADERS): New enum field.
1612         (CP_FALLTHRU_PREHEADERS): Likewise.
1613         (get_loop_body_in_custom_order): Declare.
1614         * cfgloopmanip.c (has_preds_from_loop): New.
1615         (create_preheader): Honor CP_FALLTHRU_PREHEADERS.
1616         Assert that the preheader edge will be fall thru when it is set.
1617         * common.opt (fsel-sched-bookkeeping, fsel-sched-pipelining,
1618         fsel-sched-pipelining-outer-loops, fsel-sched-renaming,
1619         fsel-sched-substitution, fselective-scheduling): New flags.
1620         * cse.c (hash_rtx_cb): New.
1621         (hash_rtx): Use it.
1622         * dbgcnt.def (sel_sched_cnt, sel_sched_region_cnt,
1623         sel_sched_insn_cnt): New counters.
1624         * final.c (compute_alignments): Export.  Free dominance
1625         info after loop_optimizer_finalize.
1626         * genattr.c (main): Output maximal_insn_latency prototype.
1627         * genautomata.c (output_default_latencies): New.
1628         Factor its code from ...
1629         (output_internal_insn_latency_func): ... here.
1630         (output_internal_maximal_insn_latency_func): New.
1631         (output_maximal_insn_latency_func): New.
1632         * hard-reg-set.h (UHOST_BITS_PER_WIDE_INT): Define unconditionally.
1633         (struct hard_reg_set_iterator): New.
1634         (hard_reg_set_iter_init, hard_reg_set_iter_set,
1635         hard_reg_set_iter_next): New functions.
1636         (EXECUTE_IF_SET_IN_HARD_REG_SET): New macro.
1637         * lists.c (remove_free_INSN_LIST_node,
1638         remove_free_EXPR_LIST_node): New functions.
1639         * loop-init.c (loop_optimizer_init): When
1640         LOOPS_HAVE_FALLTHRU_PREHEADERS, set CP_FALLTHRU_PREHEADERS when
1641         calling create_preheaders.
1642         (loop_optimizer_finalize): Do not verify flow info after reload.
1643         * recog.c (validate_replace_rtx_1): New parameter simplify.
1644         Default it to true.  Update all uses.  Factor out simplifying
1645         code to ...
1646         (simplify_while_replacing): ... this new function.
1647         (validate_replace_rtx_part,
1648         validate_replace_rtx_part_nosimplify): New.
1649         * recog.h (validate_replace_rtx_part,
1650         validate_replace_rtx_part_nosimplify): Declare.
1651         * rtl.c (rtx_equal_p_cb): New.
1652         (rtx_equal_p): Use it.
1653         * rtl.h (rtx_equal_p_cb, hash_rtx_cb): Declare.
1654         (remove_free_INSN_LIST_NODE, remove_free_EXPR_LIST_node,
1655         debug_bb_n_slim, debug_bb_slim,    print_rtl_slim): Likewise.
1656         * vecprim.h: Add a vector type for unsigned int.
1657         * haifa-sched.c: Include vecprim.h and cfgloop.h.
1658         (issue_rate, sched_verbose_param, note_list, dfa_state_size,
1659         ready_try, cycle_issued_insns, spec_info): Make global.
1660         (readyp): Initialize.
1661         (dfa_lookahead): New global variable.
1662         (old_max_uid, old_last_basic_block): Remove.
1663         (h_i_d): Make it a vector.
1664         (INSN_TICK, INTER_TICK, QUEUE_INDEX, INSN_COST): Make them work
1665         through HID macro.
1666         (after_recovery, adding_bb_to_current_region_p):
1667         New variables to handle correct insertion of the recovery code.
1668         (struct ready_list): Move declaration to sched-int.h.
1669         (rgn_n_insns): Removed.
1670         (rtx_vec_t): Move to sched-int.h.
1671         (find_insn_reg_weight): Remove.
1672         (find_insn_reg_weight1): Rename to find_insn_reg_weight.
1673         (haifa_init_h_i_d, haifa_finish_h_i_d):
1674         New functions to initialize / finalize haifa instruction data.
1675         (extend_h_i_d, init_h_i_d): Rewrite.
1676         (unlink_other_notes): Move logic to add_to_note_list.  Handle
1677         selective scheduler.
1678         (ready_lastpos, ready_element, ready_sort, reemit_notes,
1679         find_fallthru_edge): Make global, remove static prototypes.
1680         (max_issue): Make global.  Add privileged_n and state parameters.  Use
1681         them.
1682         (extend_global, extend_all): Removed.
1683         (init_before_recovery): Add new param.  Fix the handling of the case
1684         when we insert a recovery code before the EXIT which has a predecessor
1685         with a fallthrough edge to it.
1686         (create_recovery_block): Make global.  Rename to
1687         sched_create_recovery_block.  Update.
1688         (change_pattern): Rename to sched_change_pattern.  Make global.
1689         (speculate_insn): Rename to sched_speculate_insn.  Make global.
1690         Split haifa-specific functionality into ...
1691         (haifa_change_pattern): New static function.
1692         (sched_extend_bb): New static function.
1693         (sched_init_bbs): New function.
1694         (current_sched_info): Change type to struct haifa_sched_info.
1695         (insn_cost): Adjust for selective scheduling.
1696         (dep_cost_1): New function.  Move logic from ...
1697         (dep_cost): ... here.
1698         (dep_cost): Use dep_cost_1.
1699         (contributes_to_priority_p): Use sched_deps_info instead of
1700         current_sched_info.
1701         (priority): Adjust to work with selective scheduling.  Process the
1702         corner case when all dependencies don't contribute to priority.
1703         (rank_for_schedule): Use ds_weak instead of dep_weak.
1704         (advance_state): New function.  Move logic from ...
1705         (advance_one_cycle): ... here.
1706         (add_to_note_list, concat_note_lists): New functions.
1707         (rm_other_notes): Make static.  Adjust for selective scheduling.
1708         (remove_notes, restore_other_notes): New functions.
1709         (move_insn): Add two arguments.  Update assert.  Don't call
1710         reemit_notes.
1711         (choose_ready): Remove lookahead variable, use dfa_lookahead.
1712         Remove more_issue, max_points.  Move the code to initialize
1713         max_lookahead_tries to max_issue.
1714         (schedule_block): Remove rgn_n_insns1 parameter.  Don't allocate
1715         ready.  Adjust use of move_insn.  Call restore_other_notes.
1716         (luid): Remove.
1717         (sched_init, sched_finish): Move Haifa-specific initialization/
1718         finalization to ...
1719         (haifa_sched_init, haifa_sched_finish): ... respectively.
1720         New functions.
1721         (setup_sched_dump): New function.
1722         (haifa_init_only_bb): New static function.
1723         (haifa_speculate_insn): New static function.
1724         (try_ready): Use haifa_* instead of speculate_insn and
1725         change_pattern.
1726         (extend_ready, extend_all): Remove.
1727         (sched_extend_ready_list, sched_finish_ready_list): New functions.
1728         (create_check_block_twin, add_to_speculative_block): Use
1729         haifa_insns_init instead of extend_global.  Update to use new
1730         initialization functions.  Change parameter.  Factor out code from
1731         create_check_block_twin to ...
1732         (sched_create_recovery_edges) ... this new function.
1733         (add_block): Remove.
1734         (sched_scan_info): New.
1735         (extend_bb): Use sched_scan_info.
1736         (init_bb, extend_insn, init_insn, init_insns_in_bb, sched_scan): New
1737         static functions for walking through scheduling region.
1738         (sched_luids): New vector variable to replace uid_to_luid.
1739         (luids_extend_insn): New function.
1740         (sched_max_luid): New variable.
1741         (luids_init_insn): New function.
1742         (sched_init_luids, sched_finish_luids): New functions.
1743         (insn_luid): New debug function.
1744         (sched_extend_target): New function.
1745         (haifa_init_insn): New static function.
1746         (sched_init_only_bb): New hook.
1747         (sched_split_block): New hook.
1748         (sched_split_block_1): New function.
1749         (sched_create_empty_bb): New hook.
1750         (sched_create_empty_bb_1): New function.
1751         (common_sched_info, ready): New global variables.
1752         (current_sched_info_var): Remove.
1753         (move_block_after_check): Use common_sched_info.
1754         (haifa_luid_for_non_insn): New static function.
1755         (init_before_recovery): Use haifa_init_only_bb instead of
1756         add_block.
1757         (increase_insn_priority): New.
1758         * modulo-sched.c: (issue_rate): Remove static declaration.
1759         (sms_sched_info): Change type to haifa_sched_info.
1760         (sms_sched_deps_info, sms_common_sched_info): New variables.
1761         (setup_sched_infos): New.
1762         (sms_schedule): Initialize them.  Call haifa_sched_init/finish.
1763         Do not call regstat_free_calls_crossed.
1764         (sms_print_insn): Use const_rtx.
1765         * params.def (PARAM_MAX_PIPELINE_REGION_BLOCKS,
1766         PARAM_MAX_PIPELINE_REGION_INSNS, PARAM_SELSCHED_MAX_LOOKAHEAD,
1767         PARAM_SELSCHED_MAX_SCHED_TIMES, PARAM_SELSCHED_INSNS_TO_RENAME,
1768         PARAM_SCHED_MEM_TRUE_DEP_COST): New.
1769         * sched-deps.c (sched_deps_info): New.  Update all relevant uses of
1770         current_sched_info to use it.
1771         (enum reg_pending_barrier_mode): Move to sched-int.h.
1772         (h_d_i_d): New variable. Initialize to NULL.
1773         ({true, output, anti, spec, forward}_dependency_cache): Initialize
1774         to NULL.
1775         (estimate_dep_weak): Remove static declaration.
1776         (sched_has_condition_p): New function.  Adjust users of
1777         sched_get_condition to use it instead.
1778         (conditions_mutex_p): Add arguments indicating which conditions are
1779         reversed.  Use them.
1780         (sched_get_condition_with_rev): Rename from sched_get_condition.  Add
1781         argument to indicate whether returned condition is reversed.  Do not
1782         generate new rtx when condition should be reversed; indicate it by
1783         setting new argument instead.
1784         (add_dependence_list_and_free): Add deps parameter.
1785         Update all users.  Do not free dependence list when
1786         deps context is readonly.
1787         (add_insn_mem_dependence, flush_pending_lists): Adjust for readonly
1788         contexts.
1789         (remove_from_dependence_list, remove_from_both_dependence_lists): New.
1790         (remove_from_deps): New. Use the above functions.
1791         (cur_insn, can_start_lhs_rhs_p): New static variables.
1792         (add_or_update_back_dep_1): Initialize present_dep_type.
1793         (haifa_start_insn, haifa_finish_insn, haifa_note_reg_set,
1794         haifa_note_reg_clobber, haifa_note_reg_use, haifa_note_mem_dep,
1795         haifa_note_dep): New functions implementing dependence hooks for
1796         the Haifa scheduler.
1797         (note_reg_use, note_reg_set, note_reg_clobber, note_mem_dep,
1798         note_dep): New functions.
1799         (ds_to_dt, extend_deps_reg_info, maybe_extend_reg_info_p): New
1800         functions.
1801         (init_deps): Initialize last_reg_pending_barrier and deps->readonly.
1802         (free_deps): Initialize deps->reg_last.
1803         (sched_analyze_reg, sched_analyze_1, sched_analyze_2,
1804         sched_analyze_insn): Update to use dependency hooks infrastructure
1805         and readonly contexts.
1806         (deps_analyze_insn): New function.  Move part of logic from ...
1807         (sched_analyze): ... here.  Also move some logic to ...
1808         (deps_start_bb): ... here.  New function.
1809         (add_forw_dep, delete_forw_dep): Guard use of INSN_DEP_COUNT with
1810         sel_sched_p.
1811         (sched_deps_init): New function.  Move code from ...
1812         (init_dependency_caches): ... here.  Remove.
1813         (init_deps_data_vector): New.
1814         (sched_deps_finish): New function.  Move code from ...
1815         (free_dependency_caches): ... here.  Remove.
1816         (init_deps_global, finish_deps_global): Adjust for use with
1817         selective scheduling.
1818         (get_dep_weak): Move logic to ...
1819         (get_dep_weak_1): New function.
1820         (ds_merge): Move logic to ...
1821         (ds_merge_1): New static function.
1822         (ds_full_merge, ds_max_merge, ds_get_speculation_types): New functions.
1823         (ds_get_max_dep_weak): New function.
1824         * sched-ebb.c (sched_n_insns): Rename to sched_rgn_n_insns.
1825         (n_insns): Rename to rgn_n_insns.
1826         (debug_ebb_dependencies): New function.
1827         (init_ready_list): Use it.
1828         (begin_schedule_ready): Use sched_init_only_bb.
1829         (ebb_print_insn): Indicate when an insn starts a new cycle.
1830         (contributes_to_priority, compute_jump_reg_dependencies,
1831         add_remove_insn, fix_recovery_cfg): Add ebb_ prefix to function names.
1832         (add_block1): Remove to ebb_add_block.
1833         (ebb_sched_deps_info, ebb_common_sched_info): New variables.
1834         (schedule_ebb): Initialize them.  Use remove_notes instead of
1835         rm_other_notes.  Use haifa_local_init/finish.
1836         (schedule_ebbs): Use haifa_sched_init/finish.
1837         * sched-int.h: Include vecprim.h, remove rtl.h.
1838         (struct ready_list): Delete declaration.
1839         (sched_verbose_param, enum sched_pass_id_t,
1840         bb_vec_t, insn_vec_t, rtx_vec_t): New.
1841         (struct sched_scan_info_def): New structure.
1842         (sched_scan_info, sched_scan, sched_init_bbs,
1843         sched_init_luids, sched_finish_luids, sched_extend_target,
1844         haifa_init_h_i_d, haifa_finish_h_i_d): Declare.
1845         (struct common_sched_info_def): New.
1846         (common_sched_info, haifa_common_sched_info,
1847         sched_emulate_haifa_p): Declare.
1848         (sel_sched_p): New.
1849         (sched_luids): Declare.
1850         (INSN_LUID, LUID_BY_UID, SET_INSN_LUID): Declare.
1851         (sched_max_luid, insn_luid): Declare.
1852         (note_list, remove_notes, restore_other_notes, bb_note): Declare.
1853         (sched_insns_init, sched_insns_finish, xrecalloc, reemit_notes,
1854         print_insn, print_pattern, print_value, haifa_classify_insn,
1855         sel_find_rgns, sel_mark_hard_insn, dfa_state_size, advance_state,
1856         setup_sched_dump, sched_init, sched_finish,
1857         sel_insn_is_speculation_check): Export.
1858         (struct ready_list): Move from haifa-sched.c.
1859         (ready_try, ready, max_issue): Export.
1860         (ebb_compute_jump_reg_dependencies, find_fallthru_edge,
1861         sched_init_only_bb, sched_split_block, sched_split_block_1,
1862         sched_create_empty_bb, sched_create_empty_bb_1,
1863         sched_create_recovery_block, sched_create_recovery_edges): Export.
1864         (enum reg_pending_barrier_mode): Export.
1865         (struct deps): New fields `last_reg_pending_barrier' and `readonly'.
1866         (deps_t): New.
1867         (struct sched_info): Rename to haifa_sched_info.  Use const_rtx for
1868         print_insn field.  Move add_block and fix_recovery_cfg to
1869         common_sched_info_def.  Move compute_jump_reg_dependencies,
1870         use_cselib  ...
1871         (struct sched_deps_info_def): ... this new structure.
1872         (sched_deps_info): Declare.
1873         (struct spec_info_def): Remove weakness_cutoff, add
1874         data_weakness_cutoff and control_weakness_cutoff.
1875         (spec_info): Declare.
1876         (struct _haifa_deps_insn_data): Split from haifa_insn_data.  Add
1877         dep_count field.
1878         (struct haifa_insn_data): Rename to struct _haifa_insn_data.
1879         (haifa_insn_data_def, haifa_insn_data_t): New typedefs.
1880         (current_sched_info): Change type to struct haifa_sched_info.
1881         (haifa_deps_insn_data_def, haifa_deps_insn_data_t): New typedefs.
1882         (h_d_i_d): New variable.
1883         (HDID): New accessor macro.
1884         (h_i_d): Change type to VEC (haifa_insn_data_def, heap) *.
1885         (HID): New accessor macro.  Rewrite h_i_d accessor macros through HID
1886         and HDID.
1887         (IS_SPECULATION_CHECK_P): Update for selective scheduler.
1888         (enum SCHED_FLAGS): Update for selective scheduler.
1889         (enum SPEC_SCHED_FLAGS): New flag SEL_SCHED_SPEC_DONT_CHECK_CONTROL.
1890         (init_dependency_caches, free_dependency_caches): Delete declarations.
1891         (deps_analyze_insn, remove_from_deps, get_dep_weak_1,
1892         estimate_dep_weak, ds_full_merge, ds_max_merge, ds_weak,
1893         ds_get_speculation_types, ds_get_max_dep_weak, sched_deps_init,
1894         sched_deps_finish, haifa_note_reg_set, haifa_note_reg_use,
1895         haifa_note_reg_clobber, maybe_extend_reg_info_p, deps_start_bb,
1896         ds_to_dt): Export.
1897         (rm_other_notes): Delete declaration.
1898         (schedule_block): Remove one argument.
1899         (cycle_issued_insns, issue_rate, dfa_lookahead, ready_sort,
1900         ready_element, ready_lastpos, sched_extend_ready_list,
1901         sched_finish_ready_list, sched_change_pattern, sched_speculate_insn,
1902         concat_note_lists): Export.
1903         (struct region): Move from sched-rgn.h.
1904         (nr_regions, rgn_table, rgn_bb_table, block_to_bb, containing_rgn,
1905         RGN_NR_BLOCKS, RGN_BLOCKS, RGN_DONT_CALC_DEPS, RGN_HAS_REAL_EBB,
1906         BLOCK_TO_BB, CONTAINING_RGN): Export.
1907         (ebb_head, BB_TO_BLOCK, EBB_FIRST_BB, EBB_LAST_BB, INSN_BB): Likewise.
1908         (current_nr_blocks, current_blocks, target_bb): Likewise.
1909         (dep_cost_1, sched_is_disabled_for_current_region_p, sched_rgn_init,
1910         sched_rgn_finish, rgn_setup_region, sched_rgn_compute_dependencies,
1911         sched_rgn_local_init, extend_regions,
1912         rgn_make_new_region_out_of_new_block, compute_priorities,
1913         debug_rgn_dependencies, free_rgn_deps, contributes_to_priority,
1914         extend_rgns, deps_join rgn_setup_common_sched_info,
1915         rgn_setup_sched_infos, debug_regions, debug_region, dump_region_dot,
1916         dump_region_dot_file, haifa_sched_init, haifa_sched_finish): Export.
1917         (get_rgn_sched_max_insns_priority, sel_add_to_insn_priority,
1918         increase_insn_priority): Likewise.
1919         * sched-rgn.c: Include sel-sched.h.
1920         (ref_counts): New static variable.  Use it ...
1921         (INSN_REF_COUNT): ... here.  Rewrite and move closer to uses.
1922         (FED_BY_SPEC_LOAD, IS_LOAD_INSN): Rewrite to use HID accessor macro.
1923         (sched_is_disabled_for_current_region_p): Delete static declaration.
1924         (struct region): Move to sched-int.h.
1925         (nr_regions, rgn_table, rgn_bb_table, block_to_bb, containing_rgn,
1926         ebb_head): Define and initialize.
1927         (RGN_NR_BLOCKS, RGN_BLOCKS, RGN_DONT_CALC_DEPS, RGN_HAS_REAL_EBB,
1928         BLOCK_TO_BB, CONTAINING_RGN, debug_regions, extend_regions,
1929         BB_TO_BLOCK, EBB_FIRST_BB, EBB_LAST_BB): Move to
1930         sched-int.h.
1931         (find_single_block_region): Add new argument to indicate that EBB
1932         regions should be constructed.
1933         (debug_live): Delete declaration.
1934         (current_nr_blocks, current_blocks, target_bb):
1935         Remove static qualifiers.
1936         (compute_dom_prob_ps, check_live, update_live, set_spec_fed): Delete
1937         declaration.
1938         (init_regions): Delete declaration.
1939         (debug_region, bb_in_region_p, dump_region_dot_file, dump_region_dot,
1940         rgn_estimate_number_of_insns): New.
1941         (too_large): Use estimate_number_of_insns.
1942         (haifa_find_rgns): New. Move the code from ...
1943         (find_rgns): ... here.  Call either sel_find_rgns or haifa_find_rgns.
1944         (free_trg_info): New.
1945         (compute_trg_info): Allocate candidate tables here instead of ...
1946         (init_ready_list): ... here.
1947         (rgn_print_insn): Use const_rtx.
1948         (contributes_to_priority, extend_regions): Delete static declaration.
1949         (add_remove_insn, fix_recovery_cfg): Add rgn_ to function names.
1950         (add_block1): Rename to rgn_add_block.
1951         (debug_rgn_dependencies): Delete static qualifier.
1952         (new_ready): Use sched_deps_info.  Simplify.
1953         (rgn_common_sched_info, rgn_const_sched_deps_info,
1954         rgn_const_sel_sched_deps_info, rgn_sched_deps_info, rgn_sched_info):
1955         New.
1956         (region_sched_info): Rename to rgn_const_sched_info.
1957         (deps_join): New, extracted from ...
1958         (propagate_deps): ... here.
1959         (compute_block_dependences, debug_dependencies): Update for selective
1960         scheduling.
1961         (free_rgn_deps, compute_priorities): New functions.
1962         (sched_rgn_init, sched_rgn_finish, rgn_setup_region,
1963         sched_rgn_compute_dependencies): New functions.
1964         (schedule_region): Use them.
1965         (sched_rgn_local_init, sched_rgn_local_free, sched_rgn_local_finish,
1966         rgn_setup_common_sched_info, rgn_setup_sched_infos):
1967         New functions.
1968         (schedule_insns): Call new functions that were split out.
1969         (rgn_make_new_region_out_of_new_block): New.
1970         (get_rgn_sched_max_insns_priority): New.
1971         (rest_of_handle_sched, rest_of_handle_sched2): Call selective
1972         scheduling when appropriate.
1973         * sched-vis.c: Include insn-attr.h.
1974         (print_value, print_pattern): Make global.
1975         (print_rtl_slim, debug_bb_slim, debug_bb_n_slim): New functions.
1976         * target-def.h (TARGET_SCHED_ADJUST_COST_2,
1977         TARGET_SCHED_ALLOC_SCHED_CONTEXT, TARGET_SCHED_INIT_SCHED_CONTEXT,
1978         TARGET_SCHED_SET_SCHED_CONTEXT, TARGET_SCHED_CLEAR_SCHED_CONTEXT,
1979         TARGET_SCHED_FREE_SCHED_CONTEXT, TARGET_SCHED_GET_INSN_CHECKED_DS,
1980         TARGET_SCHED_GET_INSN_SPEC_DS, TARGET_SCHED_SKIP_RTX_P): New target
1981         hooks.  Initialize them to 0.
1982         (TARGET_SCHED_GEN_CHECK): Rename to TARGET_SCHED_GEN_SPEC_CHECK.
1983         * target.h (struct gcc_target): Add them.  Rename gen_check field to
1984         gen_spec_check.
1985         * flags.h (sel_sched_switch_set): Declare.
1986         * opts.c (sel_sched_switch_set): New variable.
1987         (decode_options): Unset flag_sel_sched_pipelining_outer_loops if
1988         pipelining is disabled from command line.
1989         (common_handle_option): Record whether selective scheduling is
1990         requested from command line.
1991         * doc/invoke.texi: Document new flags and parameters.
1992         * doc/tm.texi: Document new target hooks.
1993         * config/ia64/ia64.c (TARGET_SCHED_GEN_SPEC_CHECK): Define to
1994         ia64_gen_check.
1995         (dfa_state_size): Do not declare locally.
1996         * config/ia64/ia64.opt (msched-ar-data-spec): Default to 0.
1997         * config/rs6000/rs6000.c (rs6000_init_sched_context,
1998         rs6000_alloc_sched_context, rs6000_set_sched_context,
1999         rs6000_free_sched_context): New functions.
2000         (struct _rs6000_sched_context): New.
2001         (rs6000_sched_reorder2): Do not modify INSN_PRIORITY for selective
2002         scheduling.
2003         (rs6000_sched_finish): Do not run for selective scheduling.
2004
2005 2008-08-31  Jan Hubicka  <jh@suse.cz>
2006
2007         * frv.c (frv_rtx_costs): Update forward declaration.
2008         * spu.c (spu_rtx_costs): Likewise.
2009         * pdp11.c: Include df.h
2010         (pdp11_output_function_epilogue): Use df_set_regs_ever_live.
2011         * m68hc11.c (m68hc11_gen_highpart): Fix call of gen_rtx_SUBREG.
2012         (m68hc11_rtx_costs_1): Fix call of rtx_cost.
2013         * iq2000.c (iq2000_address_cost): Add speed argument.
2014         (iq2000_rtx_costs): Likewise.
2015         * mn10300.c (mn10300_address_cost_1): Remove speed argument;
2016         update call of mn10300_address_cost.
2017         * mcore.c: Include df.h
2018         (mcore_rtx_costs): Update prototype.
2019         * score3.c: Include df.h
2020         (score3_rtx_costs): Remove speed argument.
2021         * score7.c: Include df.h
2022         (score7_address_cost): Remove speed argument.
2023         * score-protos.h (score_address_cost): Update prototype.
2024         * score.c: Include df.h
2025         (score_rtx_costs): Update call of costs functions.
2026         * v850.c (v850_rtx_costs): Add bool argument.
2027
2028 2008-08-31  Hans-Peter Nilsson  <hp@axis.com>
2029
2030         * config/cris/cris.c (cris_rtx_costs): Correct call to rtx_costs.
2031
2032 2008-08-31  Aaron W. LaFramboise  <aaronavay62@aaronwl.com>
2033
2034         * gthr-win32.h (__gthread_setspecific): Use CONST_CAST2.
2035         * config/i386/gthr-win32.c (__gthread_setspecific): Same.
2036
2037 2008-08-31  Aaron W. LaFramboise  <aaronavay62@aaronwl.com>
2038
2039         * mkmap-flat.awk: Add option pe_dll.
2040         * config/i386/t-cygming (SHLIB_LINK): Support building libgcc_s.
2041         * config/i386/t-cygwin (SHLIB_LC): Add.
2042         * config/i386/t-mingw32 (SHLIB_LC): Add.
2043         * config/i386/mingw32.h (SHARED_LIBGCC_UNDEFS_SPEC): New.
2044         (SUBTARGET_EXTRA_SPECS): Use SHARED_LIBGCC_UNDEFS_SPEC.
2045         (LINK_SPEC): Support libgcc_s.
2046         (LIBGCC_SPEC): Support libgcc_s.
2047         (LIBGCC_SONAME): New.
2048
2049 2008-08-31  Jan Hubicka  <jh@suse.cz>
2050
2051         * predict.c (maybe_hot_bb_p, maybe_hot_edge_p): Previous commit
2052         mistakely had old version of patch.
2053
2054         * ipa-cp.c (ipcp_need_original_clone_p): Remove.
2055         (ipcp_estimate_growth): New.
2056         (ipcp_insert_stage): Use ipcp_estimate_growth.
2057         * profile.c (branch_prob): When reading failed, do not consider
2058         profile as read.
2059
2060 2008-08-31  Jan Hubicka  <jh@suse.cz>
2061
2062         * tree-ssa-loop-unswitch.c (tree_unswitch_single_loop): Check that
2063         loop is optimized for speed.
2064
2065 2008-08-31  Richard Guenther  <rguenther@suse.de>
2066
2067         PR middle-end/37289
2068         * fold-const.c (fold_binary): Retain conversions in folding
2069         ~A + 1 to -A.
2070
2071 2008-08-31  Jan Hubicka  <jh@suse.cz>
2072
2073         * postreload-gcse.c (eliminate_partially_redundant_loads):
2074         Use optimize_bb_for_size_p.
2075         * predict.c (maybe_hot_frequency_p): Make inline.
2076         (maybe_hot_count_p): Break out from ...
2077         (maybe_hot_bb_p): ... this one.
2078         (maybe_hot_edge_p): Simplify.
2079         * basic-block.h (probably_cold_bb_p): Remove.
2080
2081 2008-08-31  Jakub Jelinek  <jakub@redhat.com>
2082
2083         PR target/37168
2084         * config/rs6000/rs6000-protos.h (const_vector_elt_as_int): Add
2085         prototype.
2086         * config/rs6000/rs6000.c (const_vector_elt_as_int): No longer static.
2087         * config/rs6000/altivec.md (easy_vector_constant_add_self splitter):
2088         Also split V4SFmode.
2089         * config/rs6000/predicates.md (easy_vector_constant_add_self): Handle
2090         vector float modes.
2091
2092 2008-08-31  Jan Hubicka  <jh@suse.cz>
2093
2094         * predict.c (PROB_VERY_LIKELY): Make small enough so things
2095         become cold.
2096         * predict.def (PRED_NORETURN_CALL, PRED_COLD_CALL): Use it.
2097
2098 2008-08-31  Jakub Jelinek  <jakub@redhat.com>
2099
2100         PR debug/37287
2101         * dwarf2out.c (gen_namespace_die): For DECL_EXTERNAL modules don't
2102         add source coords.
2103
2104         * dwarf2out.c (native_encode_initializer): Subtract min_index for
2105         non-range array index.  Handle VIEW_CONVERT_EXPR and NON_LVALUE_EXPR.
2106
2107 2008-08-31  Jan Hubicka  <jh@suse.cz>
2108
2109         * sparc.h (BRANCH_COST): Fix macro definition.
2110         * avr.c (avr_operand_rtx_cost): Add speed argument.
2111         (avr_rtx_costs): Update calls of avr_operand_rtx_cost.
2112
2113 2008-08-31  Richard Guenther  <rguenther@suse.de>
2114
2115         * tree-cfg.c (verify_types_in_gimple_assign): Dump mismatched
2116         types instead of operands.  Re-instantiate verifying of
2117         binary expression operands.
2118
2119 2008-08-30  Jan Hubicka  <jh@suse.cz>
2120
2121         * fwprop.c (should_replace_address): Add speed attribute.
2122         (PR_OPTIMIZE_FOR_SPEED): New flag.
2123         (propagate_rtx_1): Use it.
2124         (propagate_rtx): Set it.
2125         (try_fwprop_subst): Update call of rtx_costs.
2126         (forward_propagate_and_simplify): LIkewise.
2127         * hooks.c (hook_int_rtx_bool_0): New
2128         (hook_bool_rtx_int_int_intp_false): Replace by ...
2129         (hook_bool_rtx_int_int_intp_bool_false): .. thisone.
2130         * hooks.h (hook_int_rtx_bool_0): New
2131         (hook_bool_rtx_int_int_intp_false): Replace by ...
2132         (hook_bool_rtx_int_int_intp_bool_false): .. thisone.
2133         * optabs.c (avoid_expensive_constant): UPdate call of rtx_cost.
2134         (prepare_cmp_insn): UPdate call of rtx_cost.
2135         * postreload.c (reload_cse_simplify_set): Update call of rtx_cost.
2136         (reload_cse_simplify_operands): Update call of rtx_cost.
2137         (reload_cse_move2add): call of rtx_cost.
2138         * target.h (struct gcc_target): Update rtx_costs and address_costs.
2139         * rtlanal.c (rtx_cost): Add speed argument.
2140         (address_cost): Add speed argument
2141         (default_address_cost): Likewise.
2142         (insn_rtx_cost): Likewise.
2143         * cfgloopanal.c (seq_cost): Add speed argument.
2144         (target_reg_cost, target_spill_cost): Turn to array.
2145         (init_set_costs): Update for speed.
2146         (estimate_reg_pressure_cost): Add speed argument.
2147         * auto-inc-dec.c (attempt_change): Update call of rtx_cost.
2148         * dojump.c (prefer_and_bit_test): UPdate call of rtx_cost.
2149         * tree-ssa-loop-ivopts.c (struct ivopts_data): New field speed.
2150         (seq_cost): Add speed argument.
2151         (computation_cost): Add speed arugment.
2152         (add_cost, multiply_by_const, get_address_cost): add speed argument.
2153         (force_expr_to_var_cost): Update for profile info.
2154         (force_var_cost): Likewise.
2155         (split_address_cost): Likewise.
2156         (ptr_difference_cost): Likewise.
2157         (difference_cost): Likewise.
2158         (get_computation_cost_at): Likewise.
2159         (determine_iv_cost): Likewise.
2160         (ivopts_global_cost_for_size): Likewise.
2161         (rewrite_use_address): Likewise.
2162         (tree_ssa_iv_optimize_loop): Initialize speed field.
2163         * cse.c (optimize_this_for_speed_p): New static var.
2164         (notreg_cost): Update call of rtx_cost.
2165         (cse_extended_basic_block): set optimize_this_for_speed_p.
2166         * ifcvt.c (cheap_bb_rtx_cost_p): Update call of rtx_cost.
2167         (noce_try_cmove_arith): Likewise.
2168         (noce_try_sign_mask): LIkewise.
2169         * expr.c (compress_float_constant): Update rtx_cost calls.
2170         * tree-ssa-address.c (most_expensive_mult_to_index): Add speed argument.
2171         (addr_to_parts): Likewise.
2172         (create_mem_ref): Likewise.
2173         * dse.c (find_shift_sequence): Add speed argument.
2174         (replace_read): Update call.
2175         * calls.c (precompute_register_parameters): Update call of rtx_cost.
2176         * expmed.c (sdiv_pow2_cheap, smod_pow2_cheap, zero_cost, add_cost,
2177         * neg_cost, shift_cost, shiftadd_cost,
2178         shiftsub_cost, mul_cost, sdiv_cost, udiv_cost ,mul_widen_cost,
2179         mul_highpart_cost): Increase dimension.
2180         (init_expmed): Initialize for both size and speed.
2181         (expand_shift): Use profile.
2182         (synth_mult): Use profile.
2183         (choose_mult_variant): Use profile.
2184         (expand_mult): Use profile.
2185         (expand_mult_highpart_optab): Use profile.
2186         (expand_mult_highpart): Use profile.
2187         (expand_smod_pow2): Use profile.
2188         (expand_divmod): Use profile.
2189         * simplify-rtx.c (simplify_binary_operation_1): Update call of rtx_cost.
2190         * loop-invariant.c (create_new_invariant): Use profile.
2191         (gain_for_invariant): Add speed parameter.
2192         (best_gain_for_invariant): Likewise.
2193         (find_invariants_to_move): Likewise.
2194         (move_single_loop_invariants): Set it.
2195         * target-def.h (TARGET_RTX_COSTS): Use hook.
2196         * rtl.h (rtx_cost, address_cost, insn_rtx_cost): Update prototpe.
2197         (optimize_insn_for_size_p, optimize_insn_for_speed_p): Declare.
2198         * output.h (default_address_cost): Update prototype.
2199         * combine.c (optimize_this_for_speed_p): New static var.
2200         (combine_validate_cost): Update call of rtx_cost.
2201         (combine_instructions): Set optimize_this_for_speed_p.
2202         (expand_compound_operation): Update call of rtx_cost.
2203         (make_extraction):Update call of rtx_cost.
2204         (force_to_mode):Update call of rtx_cost.
2205         (distribute_and_simplify_rtx):Update call of rtx_cost.
2206         * cfgloop.h (target_reg_cost, target_spill_cost): Turn to array.
2207         (estimate_reg_pressure_cost): Update prototype.
2208         * tree-flow.h (multiply_by_cost, create_mem_ref): Update prototype.
2209         * basic-block.h (optimize_insn_for_size_p, optimize_insn_for_speed_p):
2210         Remove.
2211         * config/alpha/alpha.c (alpha_rtx_costs): Update.
2212         (alpha_rtx_costs): Update.
2213         * config/frv/frv.c (frv_rtx_costs): Update.
2214         * config/s390/s390.c (s390_rtx_costs): Update.
2215         * config/m32c/m32c.c (m32c_memory_move_cost): Update.
2216         (m32c_rtx_costs): Update.
2217         * config/spu/spu.c (TARGET_ADDRESS_COST): Upate.
2218         (spu_rtx_costs): Update.
2219         * config/sparc/sparc.c (sparc_rtx_costs): Update.
2220         * config/m32r/m32r.c (m32r_rtx_costs): Update.
2221         * config/i386/i386.c (:ix86_address_cost): Update.
2222         (ix86_rtx_costs): Update.
2223         * config/sh/sh.c (sh_rtx_costs, sh_address_cost): Update.
2224         * config/pdp11/pdp11.c (pdp11_rtx_costs): Update.
2225         * config/avr/avr.c (avr_rtx_costs, avr_address_cost): Update.
2226         * config/crx/crx.c (crx_address_cost): Update.
2227         * config/xtensa/xtensa.c (xtensa_rtx_costs): Update.
2228         * config/stormy16/stormy16.c
2229         (xstormy16_address_cost, xstormy16_rtx_costs): Update.
2230         * config/m68hc11/m68hc11.c
2231         (m68hc11_address_cost, m68hc11_rtx_costs): Update.
2232         * config/cris/cris.c (cris_rtx_costs, cris_address_cost): Update.
2233         * config/iq2000/iq2000.c (iq2000_rtx_costs, iq2000_address_cost):
2234         Update.
2235         * config/mn10300/mn10300.c (mn10300_address_cost, mn10300_rtx_costs):
2236         Update
2237         * config/ia64/ia64.c (ia64_rtx_costs): Update.
2238         * config/m68k/m68k.c (m68k_rtx_costs): Update.
2239         * config/rs6000/rs6000.c (rs6000_rtx_costs): Update.
2240         * config/arc/arc.c (arc_rtx_costs, arc_address_cost): Update.
2241         * config/mcore/mcore.c (TARGET_ADDRESS_COST): Update.
2242         (mcore_rtx_costs): update.
2243         * config/score/score3.c (score3_rtx_costs): Update.
2244         * config/score/score7.c (score7_rtx_costs): Update.
2245         * config/score/score3.h (score3_rtx_costs):Update.
2246         * config/score/score7.h (score7_rtx_costs): Update.
2247         * config/score/score.c (score_rtx_costs): Update.
2248         * config/arm/arm.c (arm_address_cost): Update.
2249         (arm_rtx_costs_1): Update.
2250         (arm_rtx_costs_1): Update.
2251         (arm_size_rtx_costs): Update.
2252         (arm_size_rtx_costs): Update.
2253         (arm_size_rtx_costs): Update.
2254         (arm_xscale_rtx_costs): Update.
2255         (arm_thumb_address_cost): Update.
2256         * config/pa/pa.c (hppa_address_cost): Update.
2257         * config/mips/mips.c (mips_rtx_costs): Update.
2258         * config/vax/vax.c (vax_address_cost): Update.
2259         * config/h8300/h8300.c (h8300_shift_costs): Update.
2260         (h8300_rtx_costs): Update.
2261         * config/v850/v850.c (TARGET_ADDRESS_COST): Update.
2262         (v850_rtx_costs): Update.
2263         * config/mmix/mmix.c (mmix_rtx_costs, mmix_rtx_costs): Update.
2264         * config/bfin/bfin.c
2265         (bfin_address_cost): Update.
2266         (bfin_rtx_costs): Update.
2267         * stmt.c (lshift_cheap_p): Update.
2268
2269 2008-08-30  Andrew Pinski  <andrew_pinski@playstation.sony.com>
2270
2271         PR middle-end/36444
2272         * expmed.c (extract_bit_field_1): Check the mode size to make
2273         sure the vector modes have the same size.
2274
2275 2008-08-29  Michael Meissner  <gnu@the-meissners.org>
2276
2277         * dojump.c (top level): Include basic-block.h to declare
2278         optimize_insn_for_speed_p
2279
2280         * Makefile.in (dodump.h): Add $(BASIC_BLOCK_H) dependency.
2281
2282         * opts.h (CL_SAVE): New option class for marking options that are
2283         target specific options usable in the target attribute.
2284         (CL_MIN_OPTION_CLASS): CL_SAVE is now the minimum option.
2285
2286         * opt-functions.awk (switch_flags): Add CL_SAVE flag so backends
2287         can easily find the target specific options that are safe to use
2288         in the attribute or pragma.
2289
2290         * attribs.c (decl_attributes): Change #pragma GCC option to
2291         #pragma GCC target, and attribute((option(...))) to
2292         attribute((target(...))).
2293
2294         * doc/extend.texi (target attribute): Change from option
2295         attribute.  Delete push/pop/reset.
2296         (#pragma GCC target): Change from #pragma GCC option.  Delete
2297         push/pop/reset.
2298         (#pragma GCC push_options): Document new pragma.
2299         (#pragma GCC pop_options): Document new pragma.
2300         (#pragma GCC reset_options): Document new pragma.
2301
2302         * targhooks.c (default_target_option_valid_attribute_p): Add
2303         warning about port not supporting target attributes.
2304         (default_target_option_pragma_parse): New function, warn about
2305         #pragma GCC target not being supported.
2306
2307         * targhooks.h (default_target_option_pragma_parse): Add
2308         declaration.
2309
2310         * tree.h (TI_CURRENT_TARGET_PRAGMA): Rename from
2311         TI_CURRENT_OPTION_PRAGMA.
2312         (current_target_pragma): Rename from current_option_pragma.
2313
2314         * target.h: (struct target_option): Delete booleans for changing
2315         the optimization level on hot/cold functions.  Change signature of
2316         pragma_parse hook to take a second tree.
2317
2318         * c-tree.h (c_builtin_function_ext_scope): Add declaration.
2319
2320         * c-decl.c (c_builtin_function_ext_scope): New function, guarantee
2321         that the declaration is done at global scope.
2322
2323         * langhooks.c (add_builtin_function_common): Move most of the code
2324         from add_builtin_function here, calling the hook passed in.
2325         (add_builtin_function): Call add_builtin_function_common with
2326         standard builtin hook.
2327         (add_builtin_function_ext_scope): New function to add builtins to
2328         global scope.
2329
2330         * langhooks.h (struct lang_hooks): Add builtin_function_ext_scope
2331         hook.
2332         (add_builtin_function_ext_scope): Add declaration.
2333
2334         * c-pragma.c (handle_pragma_target): Rename from
2335         handle_pragma_option, #pragma GCC option is now #pragma GCC
2336         target.  Move warning about port not supporting target options to
2337         default pragma parse hook.  Remove push/pop/reset from this
2338         pragma.
2339         (handle_pragma_optimize): Remove push/pop/reset from this pragma.
2340         (option_stack): Delete static variable.
2341         (optimize_stack): Ditto.
2342         (optons_stack): New stack of saved target and optimization
2343         options.
2344         (handle_pragma_push_options): New function to handle pushing both
2345         target and optimization options.
2346         (handle_pragma_pop_options): New function to handle popping both
2347         target and optimization options.
2348         (handle_pragma_reset_options): New function to handle resetting
2349         both target and optimization options to their initial state.
2350         (init_pragma): Rename handle_pragma_option to
2351         handle_pragma_target.  Add support for push_options, pop_options,
2352         and reset_options pragmas.
2353
2354         * target-def.h (TARGET_OPTION_PRAGMA_PARSE): Change default to
2355         default_target_option_pragma_parse.
2356         (TARGET_OPTION_VALID_ATTRIBUTE_P): Change default to
2357         default_target_option_valid_attribute_p.
2358         (TARGET_OPTION_COLD_ATTRIBUTE_SETS_OPTIMIZATION): Delete.
2359         (TARGET_OPTION_HOT_ATTRIBUTE_SETS_OPTIMIZATION): Ditto.
2360         (TARGET_OPTION_HOOKS): Delete the fields for whether to change
2361         optimization level on hot/cold functions.
2362
2363         * tree-inline.c (tree_can_inline_p): Disable suppressing inlining
2364         if the caller and callee have different optimization levels.
2365
2366         * c-common.c (handle_target_attribute): Rename from
2367         handle_option_attribute, attribute((option(...))) is now
2368         attribute((target(...))).  Move warning if the port does not
2369         support target attributes to the default hook.
2370         (handle_hot_attribute): Delete code to change the optimization
2371         level of hot functions.
2372         (handle_cold_attribute): Ditto.
2373
2374         * config/i386/i386-c.c (ix86_pragma_target_parse): Take a second
2375         argument that is the binary tree options to use if there are no
2376         arguments.  Call ix86_valid_target_attribute_tree instead of
2377         ix86_valid_option_attribute_tree.
2378         (ix86_pragma_target_parse): Rename from ix86_pragma_option_parse.
2379         (ix86_register_pragmas): Use ix86_pragma_target_parse instead of
2380         ix86_pragma_option_parse.
2381
2382         * config/i386/i386-protos.h (ix86_valid_target_attribute_tree):
2383         Rename from ix86_valid_option_attribute_tree.
2384
2385         * config/i386/i386.c (ix86_add_new_builtins): New function to add
2386         new builtins when the ISA changes.
2387         (ix86_valid_target_attribute_tree): Rename from
2388         ix86_valid_option_attribute_tree.  Change callers.  If the
2389         function specified optimization options, use those as the starting
2390         point before setting up the target attributes.  If the
2391         optimization options were changed in the course of setting the
2392         target attributes, record the new optimization options.
2393         (ix86_valid_target_attribute_tree_inner_p): Rename from
2394         ix86_valid_option_attribute_tree_inner_p.  Change callers.  Call
2395         ix86_add_new_builtins if the ISA changed.
2396         (ix86_valid_target_attribute_p): Rename from
2397         ix86_valid_option_attribute_p.  Change callers.
2398         (enum ix86_builtins): Add IX86_BUILTIN_PCMOV to allow both
2399         __builtin_ia32_pcmov and __builtin_ia32_pcmov_v2di to be declared
2400         as delayed builtin functions.
2401         (struct builtin_isa): New structure to record builtin functions
2402         that should be delayed until the ISA for that function is used.
2403         (ix86_builtins_isa): Change from int to struct to track builtin
2404         functions we want to declare at some point.
2405         (def_builtin): If the front end can delay defining the builtin
2406         functions, don't create builtins for ISAs not part of the default
2407         options.
2408         (def_builtin_const): Ditto.
2409         (bdesc_multi_arg): Declare __builtin_ia32_pcmov and
2410         __builtin_ia32_pcmov_v2di to be different builtin functions.
2411         (ix86_expand_builtin): Changes due to ix86_builtins_isa now being
2412         a structure instead of an int.
2413         (TARGET_OPTION_VALID_ATTRIBUTE_P): Use
2414         ix86_valid_target_attribute_p, not ix86_valid_option_attribute_p.
2415         (TARGET_OPTION_COLD_ATTRIBUTE_SETS_OPTIMIZATION): Delete.
2416         (TARGET_OPTION_HOT_ATTRIBUTE_SETS_OPTIMIZATION): Ditto.
2417
2418         * config/ia64/ia64.h
2419         (TARGET_OPTION_COLD_ATTRIBUTE_SETS_OPTIMIZATION): Delete.
2420         (TARGET_OPTION_HOT_ATTRIBUTE_SETS_OPTIMIZATION): Ditto.
2421
2422         * langhooks-def.h (LANG_HOOKS_BUILTIN_FUNCTION_EXT_SCOPE): New
2423         hook, default to being the same as LANG_HOOKS_BUILTIN_FUNCTION.
2424         (LANG_HOOKS_INITIALIZER): Add
2425         LANG_HOOKS_BUILTIN_FUNCTION_EXT_SCOPE hook.
2426
2427 2008-08-30  Kaz Kojima  <kkojima@gcc.gnu.org>
2428
2429         PR target/37270
2430         * config/sh/sh.h (LEGITIMIZE_RELOAD_ADDRESS): Generate
2431         the reload address with the index register for SFmode
2432         access with a displacement.
2433
2434 2008-08-30  Jan Hubicka  <jh@suse.cz>
2435
2436         * optabs.c (expand_abs_nojump): Update BRANCH_COST call.
2437         * fold-cost.c (LOGICAL_OP_NON_SHORT_CIRCUIT, fold_truthop): Likewise.
2438         * dojump.c (do_jump): Likewise.
2439         * ifcvt.c (MAX_CONDITIONAL_EXECUTE): Likewise.
2440         (note-if_info): Add BRANCH_COST.
2441         (noce_try_store_flag_constants, noce_try_addcc,
2442         noce_try_store_flag_mask, noce_try_cmove_arith, noce_try_cmove_arith,
2443         noce_try_cmove_arith, noce_find_if_block, find_if_case_1,
2444         find_if_case_2): Use computed branch cost.
2445         * expr.h (BRANCH_COST): Update default.
2446         * predict.c (predictable_edge_p): New function.
2447         * expmed.c (expand_smod_pow2, expand_sdiv_pow2, emit_store_flag):
2448         Update BRANCH_COST call.
2449         * basic-block.h (predictable_edge_p): Declare.
2450         * config/alpha/alpha.h (BRANCH_COST): Update.
2451         * config/frv/frv.h (BRANCH_COST): Update.
2452         * config/s390/s390.h (BRANCH_COST): Update.
2453         * config/spu/spu.h (BRANCH_COST): Update.
2454         * config/sparc/sparc.h (BRANCH_COST): Update.
2455         * config/m32r/m32r.h (BRANCH_COST): Update.
2456         * config/i386/i386.h (BRANCH_COST): Update.
2457         * config/i386/i386.c (ix86_expand_int_movcc): Update use of BRANCH_COST.
2458         * config/sh/sh.h (BRANCH_COST): Update.
2459         * config/pdp11/pdp11.h (BRANCH_COST): Update.
2460         * config/avr/avr.h (BRANCH_COST): Update.
2461         * config/crx/crx.h (BRANCH_COST): Update.
2462         * config/xtensa/xtensa.h (BRANCH_COST): Update.
2463         * config/stormy16/stormy16.h (BRANCH_COST): Update.
2464         * config/m68hc11/m68hc11.h (BRANCH_COST): Update.
2465         * config/iq2000/iq2000.h (BRANCH_COST): Update.
2466         * config/ia64/ia64.h (BRANCH_COST): Update.
2467         * config/rs6000/rs6000.h (BRANCH_COST): Update.
2468         * config/arc/arc.h (BRANCH_COST): Update.
2469         * config/score/score.h (BRANCH_COST): Update.
2470         * config/arm/arm.h (BRANCH_COST): Update.
2471         * config/pa/pa.h (BRANCH_COST): Update.
2472         * config/mips/mips.h (BRANCH_COST): Update.
2473         * config/vax/vax.h (BRANCH_COST): Update.
2474         * config/h8300/h8300.h (BRANCH_COST): Update.
2475         * params.def (PARAM_PREDICTABLE_BRANCH_OUTCOME): New.
2476         * doc/invoke.texi (predictable-branch-cost-outcome): Document.
2477         * doc/tm.texi (BRANCH_COST): Update.
2478
2479 2008-08-30  Samuel Tardieu  <sam@rfc1149.net>
2480
2481         PR target/37283
2482         * config/arm/arm.c (arm_optimization_options): Set
2483         flag_section_anchors to 2 instead of 1 to distinguish it from
2484         -fsection-anchors given explicitely on the command line.
2485
2486 2008-08-30  Richard Sandiford  <rdsandiford@googlemail.com>
2487
2488         * recog.c (split_insn): Consider attaching a REG_EQUAL note to the
2489         final insn of a split.
2490
2491 2008-08-30  Jan Hubicka  <jh@suse.cz>
2492
2493         * postreload-gcse.c (gate_handle_gcse2): Disable for functions
2494         optimized for speed.
2495         * final.c (compute_alignments): Use optimize_bb_for_size_p.
2496         * tree-call-cdce.c (gate_call_cdce): Use optimize_function_for_speed_p.
2497         * opts.c (flag_predictive_commoning_set, flag_unswitch_loops_set,
2498         flag_gcse_after_reload_set): New static vars.
2499         (common_handle_option): Enable those flags for profile-use.
2500         (decode_options): Remove optimize_size flags that are handled
2501         on higher granuality.
2502         * tree-vectorizer.c (vectorize_loops): Use
2503         optimize_loop_nest_for_speed_p.
2504         * tree-ssa-pre.c (do_pre): Use optimize_function_for_speed_p.
2505         * tree-predcom.c (tree_predictive_commoning): Use
2506         optimize_loop_for_speed_p.
2507         * varasm.c (assemble_start_function): Use optimize_function_for_speed_p.
2508         * bb-reorder.c (rest_of_handle_reorder_blocks): Likewise.
2509         * predict.c (optimize_loop_for_speed_p): Fix walk.
2510
2511 2008-08-30  Jan Hubicka  <jh@suse.cz>
2512
2513         * ipa-inline.c (cgraph_estimate_growth): Discover self recursive
2514         functions.
2515         (cgraph_decide_inlining_of_small_function): Use edge->count to detect
2516         profile presence locally.
2517
2518 2008-08-29  Joseph Myers  <joseph@codesourcery.com>
2519
2520         PR bootstrap/37086
2521         * tree-vrp.c (find_switch_asserts): Make idx volatile for GCC
2522         versions before 4.0.
2523
2524 2008-08-29  Jan Hubicka  <jh@suse.cz>
2525
2526         * tree-inline.c (insert_init_stmt): Insert sequence even when
2527         not in SSA form.
2528
2529 2008-08-29  Jeff Law  <law@redhat.com>
2530
2531         * mn10300.c (mn10300_secondary_reload_class): We need secondary
2532         reloads for AM33-2 if IN is a pseudo with an equivalent memory
2533         location and class is an FP register.
2534
2535 2008-08-29  Jan Hubicka  <jh@suse.cz>
2536
2537         * see.c (see_merge_one_def_extension): Silence used uninitialized
2538         warning.
2539         * matrix-reorg.c (check_allocation_function): Likewise.
2540         * config/i386/driver-i386.c (detect_caches_amd): Likewise.
2541
2542 2008-08-29  Jakub Jelinek  <jakub@redhat.com>
2543
2544         PR c/37261
2545         * fold-const.c (fold_binary): In (X | C1) & C2 canonicalization
2546         compute new & and | in type rather than TREE_TYPE (arg0).
2547
2548         * dwarf2out.c (fortran_common): Update comment.
2549         (gen_variable_die): Swap com_die and var_die variables in Fortran
2550         COMMON block handling code.
2551
2552         * dwarf2out.c (descr_info_loc): Handle VAR_DECL.
2553
2554         * dwarf2out.c (gen_const_die): New function.
2555         (size_of_die, value_format, output_die): Output larger
2556         dw_val_class_vec using DW_FORM_block2 or DW_FORM_block4.
2557         (native_encode_initializer): New function.
2558         (tree_add_const_value_attribute): Call it.
2559         (gen_decl_die, dwarf2out_decl): Handle CONST_DECLs if is_fortran ().
2560
2561         * dwarf2out.c (gen_formal_parameter_die, gen_variable_die): For
2562         DECL_BY_REFERENCE decls don't pass TREE_READONLY and
2563         TREE_THIS_VOLATILE to add_type_attribute.
2564
2565         * dwarf2out.c (add_subscript_info): Stop on Fortran TYPE_STRING_FLAG
2566         types.
2567         (gen_array_type_die): Emit DW_TAG_string_type for Fortran character
2568         types.
2569
2570         * dwarf2out.c (loc_by_reference): New function.
2571         (add_location_or_const_value_attribute): Use it.
2572
2573         PR fortran/23057
2574         * dwarf2out.c (gen_variable_die): Represent Fortran COMMON vars
2575         as DW_TAG_variable children of DW_TAG_common_block rather than
2576         DW_TAG_member children.  Put DW_AT_external to individual
2577         DW_TAG_variable DIEs, not to DW_TAG_common_block.
2578
2579         * dwarf2out.c (add_bound_info): If lookup_decl_die failed, try
2580         loc_descriptor_from_tree_1.
2581
2582         PR fortran/29635
2583         PR fortran/23057
2584         * debug.h (struct gcc_debug_hooks): Add NAME and CHILD
2585         arguments to imported_module_or_decl.
2586         (debug_nothing_tree_tree): Removed.
2587         (debug_nothing_tree_tree_tree_bool): New prototype.
2588         * debug.c (do_nothing_debug_hooks): Adjust.
2589         (debug_nothing_tree_tree): Removed.
2590         (debug_nothing_tree_tree_tree_bool): New function.
2591         * dwarf2out.c (is_symbol_die): Handle DW_TAG_module.
2592         (gen_variable_die): Put all common vars for the
2593         same COMMON block under one DW_TAG_common_block.
2594         (declare_in_namespace): Return new context_die, for Fortran
2595         return the module DIE instead of adding extra declarations into
2596         the namespace.
2597         (gen_type_die_with_usage): Adjust declare_in_namespace caller.
2598         (gen_namespace_die): If is_fortran (), generate DW_TAG_module
2599         instead of DW_TAG_namespace.  If DECL_EXTERNAL is set, add
2600         DW_AT_declaration.
2601         (dwarf2out_global_decl): Don't skip Fortran global vars.
2602         (gen_decl_die): Likewise.  Adjust declare_in_namespace callers.
2603         (dwarf2out_imported_module_or_decl): Add NAME and CHILD arguments.
2604         If NAME is non-NULL, add DW_AT_name.  If CHILD is non-NULL, put
2605         DW_TAG_imported_declaration as child of previous
2606         DW_TAG_imported_module.
2607         * dbxout.c (dbx_debug_hooks, xcoff_debug_hooks): Adjust.
2608         * sdbout.c (sdb_debug_hooks): Likewise.
2609         * vmsdbgout.c (vmsdbg_debug_hooks): Likewise.
2610
2611 2008-08-29  Jan Hubicka  <jh@suse.cz>
2612
2613         * cgraph.c (cgraph_remove_node): Do not remove nested nodes.
2614
2615         * cgraph.h (cgraph_maybe_hot_edge_p): Declare.
2616         * ipa-cp.c (n_cloning_candidates): New static variable.
2617         (ipcp_print_profile_data, ipcp_function_scale_print): Forward declare.
2618         (ipcp_print_all_lattices): Improve debug output.
2619         (ipcp_cloning_candidate_p): New function.
2620         (ipcp_initialize_node_lattices): Use it.
2621         (ipcp_init_stage): Do only analyzis here; prettier debug output.
2622         (ipcp_propagate_stage): Prettier debug output.
2623         (ipcp_iterate_stage): Initialize latices here; prettier debug output.
2624         (ipcp_print_all_structures): Remove.
2625         (ipcp_need_redirect_p): Test !n_cloning_candidates.
2626         (ipcp_insert_stage): Prettier debug output; call
2627         cgraph_remove_unreachable_nodes before propagating.
2628         (pass_ipa_cp): Schedule function removal pass.
2629         * ipa-inline.c (inline_indirect_intraprocedural_analysis): Better
2630         debug output.
2631         (cgraph_maybe_hot_edge_p): Move to ...
2632         * predict.c (cgraph_maybe_hot_edge_p) ... here.
2633         * opts.c (flag_ipa_cp_set, flag_ipa_cp_clone_set): New.
2634         (common_handle_option): Set them; enable ipa-cp when profiling.
2635         * ipa-prop.c (ipa_print_node_jump_functions): Prettier output.
2636         (ipa_print_all_jump_functions): Likewise.
2637         (ipa_print_all_tree_maps, ipa_print_node_param_flags): Remove.
2638         (ipa_print_node_params, ipa_print_all_params): New.
2639         * ipa-prop.h (ipa_print_all_tree_maps, ipa_print_node_param_flags,
2640         ipa_print_all_param_flags): Remove.
2641         (ipa_print_node_params, ipa_print_all_params): New.
2642
2643 2008-08-29  Bob Wilson  <bob.wilson@acm.org>
2644
2645         * config/xtensa/xtensa.c (xtensa_secondary_reload_class): Revert
2646         change from 2008-04-03.
2647         * config/xtensa/xtensa.h (IRA_COVER_CLASSES): Define.
2648
2649 2008-08-29  Vladimir Makarov  <vmakarov@redhat.com>
2650
2651         PR rtl-opt/37251
2652         * ira-color.c (push_allocnos_to_stack): Truncate
2653         removed_splay_allocno_vec.
2654
2655 2008-08-29  Vladimir Makarov  <vmakarov@redhat.com>
2656
2657         PR rtl-opt/37243
2658         * ira-color (ira_fast_allocation): Don't assign hard registers to
2659         global allocnos.
2660
2661 2008-08-29  Jan Hubicka  <jh@suse.cz>
2662
2663         PR middle-end/37278
2664         * predict.c (optimize_loop_nest_for_speed_p): Do not ICE
2665         for cold internal loops.
2666
2667 2008-08-29  Richard Guenther  <rguenther@suse.de>
2668
2669         * tree-ssa-structalias.c (create_variable_info_for): Do not
2670         create fields for heap vars or vars with a noalias state.
2671         For NO_ALIAS_ANYTHING variables add a self-constraint, not one
2672         from ESCAPED.
2673
2674 2008-08-29  Richard Guenther  <rguenther@suse.de>
2675
2676         * common.opt (ftree-store-ccp): Mark as preserved for
2677         backward compatibility.
2678         * doc/invoke.texi (-ftree-store-ccp): Remove documentation.
2679         * tree-pass.h (pass_store_ccp): Remove.
2680         * tree-ssa-propagate.h (struct prop_value_d): Remove mem_ref field.
2681         (first_vdef): Remove declaration.
2682         (get_value_loaded_by): Likewise.
2683         * tree-ssa-ccp.c (do_store_ccp): Remove.
2684         (get_default_value): Simplify as do_store_ccp is always false
2685         now.  Do not initialize mem_ref.
2686         (set_value_varying): Likewise.
2687         (canonicalize_float_value): Likewise.
2688         (set_lattice_value): Likewise.
2689         (likely_value): Likewise.
2690         (surely_varying_stmt_p): Likewise.
2691         (ccp_initialize): Likewise.
2692         (ccp_lattice_meet): Likewise.
2693         (ccp_visit_phi_node): Likewise.
2694         (ccp_fold): Likewise.
2695         (evaluate_stmt): Likewise.
2696         (visit_assignment): Likewise.
2697         (ccp_visit_stmt): Likewise.
2698         (execute_ssa_ccp): Fold into ...
2699         (do_ssa_ccp): ... this.
2700         (do_ssa_store_ccp): Remove.
2701         (gate_store_ccp): Likewise.
2702         (pass_store_ccp): Likewise.
2703         * tree-ssa-copy.c (copy_prop_visit_phi_node): Do not
2704         initialize mem_ref.
2705         * tree-ssa-propagate.c (first_vdef): Remove.
2706         (get_value_loaded_by): Likewise.
2707         (replace_vuses_in): Likewise.
2708         (substitute_and_fold): Do not call replace_vuses_in.
2709         * opts.c (decode_options): Do not set flag_tree_store_ccp.
2710
2711 2008-08-29  Richard Guenther  <rguenther@suse.de>
2712
2713         PR middle-end/37236
2714         * tree-ssa-structalias.c (intra_create_variable_infos): Mark
2715         PARAM_NOALIAS tags with is_heapvar.
2716         * tree-ssa-operands.c (access_can_touch_variable): Offset
2717         based tests do not apply for heapvars.  Fix offset test.
2718
2719 2008-08-29  Jan Hubicka  <jh@suse.cz>
2720
2721         * doc/invoke.texi (-fipa-cp): Enabled by default at -O2/-Os/-O3
2722         (-fipa-cp-clone): Enabled by default at -O3.
2723         * opts.c (decode_options): Enable ipa-cp at -O2, ipa-cp-clone at -O3;
2724         make ipa-cp-clone to imply ipa-cp; disable cloning at -Os.
2725
2726 2008-08-29  Jan Hubicka  <jh@suse.cz>
2727
2728         * tree.c (build_function_type_skip_args, build_function_decl_skip_args):
2729         New functions.
2730         * tree.h (build_function_type_skip_args, build_function_decl_skip_args):
2731         Declare.
2732         * gimple.c (giple_copy_call_skip_args): New function.
2733         (giple_copy_call_skip_args): Declare.
2734
2735         * cgraph.h (cgraph_function_versioning): Add skip_args arugmnet
2736         * ipa-cp.c (ipcp_node_not_modifiable_p): Rename to ...
2737         (ipcp_node_modifiable_p): ... this one; use tree_versionable_function_p.
2738         (ipcp_create_replace_map): Improve debug output.
2739         (ipcp_need_redirect_p): Return false when not clonning.
2740         (ipcp_update_callgraph): Skip args.
2741         (ipcp_insert_stage): UPdate call of !ipcp_node_modifiable_p;
2742         skip args.
2743         * cgraphunit.c (cgraph_function_versioning): Add skip_args argument.
2744         (save_inline_function_body): Update call of tree_function_versioning.
2745         * ipa-prop.c (ipa_edge_removal_hook): Do not ICE on unanalyzed nodes.
2746         * tree-inline.c (copy_arguments_for_versioning): Add skip_args argument.
2747         (tree_function_versioning): Likewise.
2748         * tree-inline.h (tree_function_versioning): Update prototype.
2749
2750 2008-08-29  Jan Hubicka  <jh@suse.cz>
2751
2752         * loop-unswitch.c (unswitch_single_loop): Use optimize_loop_for_speed_p.
2753         * tree-ssa-threadupdate.c (mark_threaded_blocks):
2754         Use optimize_function_for_size_p.
2755         * tracer.c (ignore_bb_p): Use optimize_bb_for_size_p.
2756         * postreload-gcse.c (eliminate_partially_redundant_load):
2757         Use optimize_bb_for_size_p.
2758         * value-prof.c (gimple_divmod_fixed_value_transform,
2759         gimple_mod_pow2_value_transform, gimple_mod_subtract_transform,
2760         gimple_stringops_transform): Use optimize_bb_for_size_p.
2761         * ipa-cp.c (ipcp_insert_stage): Use optimize_function_for_size_p.
2762         * final.c (compute_alignments): Use optimize_function_for_size_p.
2763         * builtins.c (fold_builtin_cabs): Use optimize_function_for_speed_p.
2764         (fold_builtin_strcpy, fold_builtin_fputs): Use
2765         optimize_function_for_size_p.
2766         * fold-const.c (tree_swap_operands_p): Use optimize_function_for_size_p.
2767         * recog.c (relax_delay_slots): Likewise.
2768         * tree-ssa-math-opts.c (replace_reciprocal):
2769         Use optimize_bb_for_speed_p.
2770         (execute_cse_reciprocals): Use optimize_bb_for_size_p.
2771         * ipa-inline.c (cgraph_decide_recursive_inlining): Use
2772         optimize_function_for_size_p.
2773         (cgraph_decide_inlining_of_small_function): Use
2774         optimize_function_for_size_p.
2775         * global.c (find_reg): Use optimize_function_for_size_p.
2776         * opts.c (decode_options): Do not clear flag_tree_ch,
2777         flag_inline_functions, flag_unswitch_loops, flag_unroll_loops,
2778         flag_unroll_all_loops and flag_prefetch_loop_arrays. Those can
2779         work it out from profile.
2780         * tree-ssa-loop-ivcanon.c (tree_unroll_loops_completely): Use
2781         optimize_loop_for_speed_p.
2782         * predict.c (optimize_bb_for_size_p, optimize_bb_for_speed_p): Constify
2783         argument.
2784         (optimize_loop_nest_for_size_p, optimize_loop_nest_for_speed_p): New.
2785         * tree-parloops.c (parallelize_loops): Use optimize_loop_for_size_p.
2786         * tree-eh.c (decide_copy_try_finally): Use optimize_function_for_size_p.
2787         * local-alloc.c (block_alloc): Pass BB pointer.
2788         (find_free_reg): Add BB pointer, use optimize_bb_for_size_p.
2789         * gcse.c (gcse_main): Use optimize_function_for_size_p.
2790         * loop-unroll.c (decide_unrolling_and_peeling):
2791         Use optimize_loop_for_size_p.
2792         (decide_peel_completely): Likewise.
2793         * tree-vect-analyze.c (vect_mark_for_runtime_alias_test): Use
2794         optimize_loop_for_size_p.
2795         (vect_enhance_data_refs_alignment): Likewise.
2796         * tree-ssa-coalesce.c (coalesce_cost): Add optimize_for_size argument.
2797         (coalesce_cost_bb, coalesce_cost_edge, create_outofssa_var_map):
2798         Update call.
2799         * cfgcleanup.c (outgoing_edges_match): Use optimize_bb_for_speed_p.
2800         (try_crossjump_bb): Use optimize_bb_for_size_p.
2801         * tree-ssa-loop-prefetch.c (loop_prefetch_arrays): Use
2802         optimize_loop_for_speed_p.
2803         * bb-reorder.c (find_traces_1_round): Likewise.
2804         (copy_bb): Use optimize_bb_for_speed_p.
2805         (duplicate_computed_gotos): Likewise.
2806         * basic-block.h (optimize_loop_nest_for_size_p,
2807         optimize_loop_nest_for_speed_p): New.
2808         * stmt.c (expand_case): Use optimize_insn_for_size_p.
2809
2810 2008-08-29  Tristan Gingold  <gingold@adacore.com>
2811
2812         * gcov.c (main): Call expandargv.
2813
2814 2008-08-29  Jan Hubicka  <jh@suse.cz>
2815
2816         * tree-ssa-loop-ch.c (should_duplicate_loop_header_p): Check that loop
2817         is not cold.
2818         * predict.c (optimize_bb_for_size_p, optimize_bb_for_speed_p):
2819         Constify arguments.
2820         (optimize_loop_for_size_p, optimize_loop_for_speed_p): New functions.
2821         * basic-block.h (optimize_bb_for_size_p, optimize_bb_for_speed_p):
2822         Constify.
2823         (optimize_loop_for_size_p, optimize_loop_for_speed_p): Declare.
2824
2825 2008-08-29  Jan Hubicka  <jh@suse.cz>
2826
2827         * tree-pass.h (pass_strip_predict_hints): Declare.
2828         * predict.c (strip_builtin_expect): Rename to ...
2829         (strip_predict_hints): ... this one; strip also GIMPLE_PREDICT.
2830         (tree_bb_level_predictions): Do not remove GIMPLE_PREDICT.
2831         (tree_estimate_probability): Do not strip builtin_expect.
2832         (pass_strip_predict_hints): New pass.
2833         * tree-inline.c (expand_call_inline): When inlining cold function,
2834         predict it as unlikely.
2835         * passes.c (init_optimization_passes): Add pass_strip_predict_hints.
2836
2837 2008-08-29  Richard Guenther  <rguenther@suse.de>
2838
2839         PR tree-optimization/37207
2840         * tree-vrp.c (extract_range_from_binary_expr): Also try
2841         to constant fold if only one of the operands is a constant.
2842
2843 2008-08-29  Nick Clifton  <nickc@redhat.com>
2844
2845         * config/m32r/m32r.h (LEGITIMATE_CONSTANT_P): Treat LABEL_REFs in
2846         the same way as SYMBOL_REFs.
2847
2848 2008-08-28  Bob Wilson  <bob.wilson@acm.org>
2849
2850         * config/xtensa/xtensa.md (<u>mulsidi3): Use a temporary register.
2851
2852 2008-08-28  Adam Nemet  <anemet@caviumnetworks.com>
2853
2854         * config/mips/mips.h (ISA_HAS_BBIT): New macro.
2855         * config/mips/mips.md (branch_likely): Remove const.  Fix
2856         comment formatting.
2857         (define_delay for type "branch"): Change to only apply for branch
2858         with likely variant.
2859         (define_delay for type "branch" and "branch_likely" no).  New delay
2860         definition.
2861         (equality_op): New code iterator.
2862         (bbv, bbinv): New code attributes.
2863         (*branch_bit<bbv><mode>, *branch_bit<bbv><mode>_inverted): New
2864         patterns.
2865
2866 2008-08-28  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
2867             Andrew Pinski  <pinskia@gcc.gnu.org>
2868
2869         PR 18050
2870         * c-common.c (verify_tree): Fix handling of ADDR_EXPR.
2871
2872 2008-08-28  Paolo Carlini  <paolo.carlini@oracle.com>
2873
2874         * gtrh-posix.h: Fix uses of _POSIX_TIMEOUTS per the normal Posix
2875         rule that a symbolic constant must be defined and >= 0 for the
2876         corresponding facility to be present at compile-time.
2877         * gthr-posix.c: Likewise.
2878
2879 2008-08-28  Adam Nemet  <anemet@caviumnetworks.com>
2880
2881         * config/mips/mips.h (ISA_HAS_DMUL3): New macro.
2882         * config/mips/mips.md (D): New mode attribute.
2883         (mulsi3, muldi3): Merge it into ...
2884         (mul<mode>3): ... new template.  Use _mul3 ending for 3-op patterns.
2885         (muldi3_mul3): New pattern.
2886         (mulsi3_mult3): Rename to mulsi3_mul3.
2887
2888 2008-08-28  Jan Hubicka  <jh@suse.cz>
2889
2890         * expmed.c (store_bit_field_1): Be prepared for movstrict expander
2891         to fail.
2892         * predict.c (always_optimize_for_size_p): Rename to ...
2893         (optimize_function_for_size): ... this one; make extern.
2894         (optimize_function_for_speed_p): New.
2895         (optimize_bb_for_size_p, optimize_bb_for_size_p,
2896         optimize_edge_for_size_p,optimize_edge_for_size_p,
2897         optimize_insn_for_size_p, optimize_insn_for_size_p): Update.
2898         * basic-block.h (optimize_function_for_size_p,
2899         optimize_function_for_speed_p): Declare.
2900         * i386.md (optimize_size checks): Replace them by appropriate
2901         predicate.
2902         (standard_80387_constant_p, ix86_compute_frame_layout,
2903         ix86_expand_epilogue, ix86_decompose_address,
2904         print_operand, emit_i387_cw_initialization,
2905         inline_memory_move_cost, ix86_pad_returns,
2906         ix86_reorg): Replace optimize_size checks.
2907
2908 2008-08-28  Richard Sandiford  <rdsandiford@googlemail.com>
2909
2910         * rtl.h (simplify_subreg_regno): Declare.
2911         * rtlanal.c (simplify_subreg_regno): New function, split out from...
2912         * simplify-rtx.c (simplify_subreg): ...here.
2913         * reload.c (find_reloads): Use simplify_subreg_regno instead of
2914         subreg_offset_representable_p.
2915
2916 2008-08-28  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
2917
2918         PR c/30949
2919         * c-typeck.c (convert_for_assignment): Give a note describing what
2920         was passed and what was expected.
2921
2922 2008-08-28  Joey Ye  <joey.ye@intel.com>
2923
2924         * doc/extend.texi: Document AVX built-in functions.
2925         * doc/invoke.texi: Document -mavx.
2926
2927 2008-08-28  H.J. Lu  <hongjiu.lu@intel.com>
2928             Joey Ye  <joey.ye@intel.com>
2929             Xuepeng Guo  <xuepeng.guo@intel.com>
2930
2931         * config.gcc (extra_headers): Add gmmintrin.h for x86 and x86-64.
2932
2933         * config/i386/cpuid.h (bit_FMA): New.
2934         (bit_XSAVE): Likewise.
2935         (bit_OSXSAVE): Likewise.
2936         (bit_AVX): Likewise.
2937
2938         * config/i386/gas.h (ASM_OUTPUT_OPCODE): Undefine before
2939         define.  Use ASM_OUTPUT_AVX_PREFIX.
2940
2941         * config/i386/gmmintrin.h: New.
2942
2943         * config/i386/i386.c (x86_64_reg_class): Add X86_64_AVX_CLASS.
2944         (OPTION_MASK_ISA_AVX_SET): New.
2945         (OPTION_MASK_ISA_FMA_SET): Likewise.
2946         (OPTION_MASK_ISA_AVX_UNSET): Likewise.
2947         (OPTION_MASK_ISA_FMA_SET): Likewise.
2948         (OPTION_MASK_ISA_SSE4_2_UNSET): Updated.
2949         (ix86_handle_option): Handle OPT_mavx and OPT_mfma.
2950         (pta_flags): Add PTA_AVX and PTA_FMA.
2951         (override_options): Handle PTA_AVX and PTA_FMA.
2952         (init_cumulative_args): Handle warn_avx.
2953         (classify_argument): Return 0 for COImode and OImode.  Return
2954         1 and X86_64_AVX_CLASS for 256bit vector types.
2955         (examine_argument): Handle X86_64_AVX_CLASS.
2956         (construct_container): Likewise.
2957         (function_arg_advance_32): Pass OImode and 256bit vector types
2958         in AVX register.
2959         (function_arg_advance_64): Take a new argument to indicate if a
2960         parameter is named.  Handle 256bit vector types.  Return
2961         immediately for unnamed 256bit vector mode parameters.
2962         (function_arg_advance): Updated.
2963         (function_arg_32): Add comments for TImode.  Handle OImode
2964         and 256bit vector types.
2965         (function_arg_64): Take a new argument to indicate if a
2966         parameter is named.  Handle 256bit vector types.  Return NULL
2967         for unnamed 256bit vector mode parameters.
2968         (function_arg): Updated.
2969         (setup_incoming_varargs_64): Support
2970         AVX encoding for *sse_prologue_save_insn.
2971         (ix86_gimplify_va_arg): Handle 256bit vector mode parameters.
2972         (standard_sse_constant_p): Return -2 for all 1s if SSE2 isn't
2973         enabled.  For all 1s in 256bit vector modes, return 3 if AVX is
2974         enabled, otherwise return -3.
2975         (standard_sse_constant_opcode): Handle AVX and 256bit vector
2976         modes.
2977         (print_reg): Support AVX registers.  Handle 'x' and 't'.
2978         Handle 'd' to duplicate the operand.
2979         (print_operand): Likewise.  Also support AVX vector compare
2980         instructions.
2981         (output_387_binary_op): Support AVX.
2982         (output_fp_compare): Likewise.
2983         (ix86_expand_vector_move_misalign): Likewise.
2984         (ix86_attr_length_vex_default): New.
2985         (ix86_builtins): Add IX86_BUILTIN_ADDPD256,
2986         IX86_BUILTIN_ADDPS256, IX86_BUILTIN_ADDSUBPD256,
2987         IX86_BUILTIN_ADDSUBPS256, IX86_BUILTIN_ANDPD256,
2988         IX86_BUILTIN_ANDPS256, IX86_BUILTIN_ANDNPD256,
2989         IX86_BUILTIN_ANDNPS256, IX86_BUILTIN_BLENDPD256,
2990         IX86_BUILTIN_BLENDPS256, IX86_BUILTIN_BLENDVPD256,
2991         IX86_BUILTIN_BLENDVPS256, IX86_BUILTIN_DIVPD256,
2992         IX86_BUILTIN_DIVPS256, IX86_BUILTIN_DPPS256,
2993         IX86_BUILTIN_HADDPD256, IX86_BUILTIN_HADDPS256,
2994         IX86_BUILTIN_HSUBPD256, IX86_BUILTIN_HSUBPS256,
2995         IX86_BUILTIN_MAXPD256, IX86_BUILTIN_MAXPS256,
2996         IX86_BUILTIN_MINPD256, IX86_BUILTIN_MINPS256,
2997         IX86_BUILTIN_MULPD256, IX86_BUILTIN_MULPS256,
2998         IX86_BUILTIN_ORPD256, IX86_BUILTIN_ORPS256,
2999         IX86_BUILTIN_SHUFPD256, IX86_BUILTIN_SHUFPS256,
3000         IX86_BUILTIN_SUBPD256, IX86_BUILTIN_SUBPS256,
3001         IX86_BUILTIN_XORPD256, IX86_BUILTIN_XORPS256,
3002         IX86_BUILTIN_CMPSD, IX86_BUILTIN_CMPSS, IX86_BUILTIN_CMPPD,
3003         IX86_BUILTIN_CMPPS, IX86_BUILTIN_CMPPD256,
3004         IX86_BUILTIN_CMPPS256, IX86_BUILTIN_CVTDQ2PD256,
3005         IX86_BUILTIN_CVTDQ2PS256, IX86_BUILTIN_CVTPD2PS256,
3006         IX86_BUILTIN_CVTPS2DQ256, IX86_BUILTIN_CVTPS2PD256,
3007         IX86_BUILTIN_CVTTPD2DQ256, IX86_BUILTIN_CVTPD2DQ256,
3008         IX86_BUILTIN_CVTTPS2DQ256, IX86_BUILTIN_EXTRACTF128PD256,
3009         IX86_BUILTIN_EXTRACTF128PS256, IX86_BUILTIN_EXTRACTF128SI256,
3010         IX86_BUILTIN_VZEROALL, IX86_BUILTIN_VZEROUPPER,
3011         IX86_BUILTIN_VZEROUPPER_REX64, IX86_BUILTIN_VPERMILVARPD,
3012         IX86_BUILTIN_VPERMILVARPS, IX86_BUILTIN_VPERMILVARPD256,
3013         IX86_BUILTIN_VPERMILVARPS256, IX86_BUILTIN_VPERMILPD,
3014         IX86_BUILTIN_VPERMILPS, IX86_BUILTIN_VPERMILPD256,
3015         IX86_BUILTIN_VPERMILPS256, IX86_BUILTIN_VPERMIL2PD,
3016         IX86_BUILTIN_VPERMIL2PS, IX86_BUILTIN_VPERMIL2PD256,
3017         IX86_BUILTIN_VPERMIL2PS256, IX86_BUILTIN_VPERM2F128PD256,
3018         IX86_BUILTIN_VPERM2F128PS256, IX86_BUILTIN_VPERM2F128SI256,
3019         IX86_BUILTIN_VBROADCASTSS, IX86_BUILTIN_VBROADCASTSD256,
3020         IX86_BUILTIN_VBROADCASTSS256, IX86_BUILTIN_VBROADCASTPD256,
3021         IX86_BUILTIN_VBROADCASTPS256, IX86_BUILTIN_VINSERTF128PD256,
3022         IX86_BUILTIN_VINSERTF128PS256, IX86_BUILTIN_VINSERTF128SI256,
3023         IX86_BUILTIN_LOADUPD256, IX86_BUILTIN_LOADUPS256,
3024         IX86_BUILTIN_STOREUPD256, IX86_BUILTIN_STOREUPS256,
3025         IX86_BUILTIN_LDDQU256, IX86_BUILTIN_LOADDQU256,
3026         IX86_BUILTIN_STOREDQU256, IX86_BUILTIN_MASKLOADPD,
3027         IX86_BUILTIN_MASKLOADPS, IX86_BUILTIN_MASKSTOREPD,
3028         IX86_BUILTIN_MASKSTOREPS, IX86_BUILTIN_MASKLOADPD256,
3029         IX86_BUILTIN_MASKLOADPS256, IX86_BUILTIN_MASKSTOREPD256,
3030         IX86_BUILTIN_MASKSTOREPS256, IX86_BUILTIN_MOVSHDUP256,
3031         IX86_BUILTIN_MOVSLDUP256, IX86_BUILTIN_MOVDDUP256,
3032         IX86_BUILTIN_SQRTPD256, IX86_BUILTIN_SQRTPS256,
3033         IX86_BUILTIN_SQRTPS_NR256, IX86_BUILTIN_RSQRTPS256,
3034         IX86_BUILTIN_RSQRTPS_NR256, IX86_BUILTIN_RCPPS256,
3035         IX86_BUILTIN_ROUNDPD256, IX86_BUILTIN_ROUNDPS256,
3036         IX86_BUILTIN_UNPCKHPD256, IX86_BUILTIN_UNPCKLPD256,
3037         IX86_BUILTIN_UNPCKHPS256, IX86_BUILTIN_UNPCKLPS256,
3038         IX86_BUILTIN_SI256_SI, IX86_BUILTIN_PS256_PS,
3039         IX86_BUILTIN_PD256_PD, IX86_BUILTIN_SI_SI256,
3040         IX86_BUILTIN_PS_PS256, IX86_BUILTIN_PD_PD256,
3041         IX86_BUILTIN_VTESTZPD, IX86_BUILTIN_VTESTCPD,
3042         IX86_BUILTIN_VTESTNZCPD, IX86_BUILTIN_VTESTZPS,
3043         IX86_BUILTIN_VTESTCPS, IX86_BUILTIN_VTESTNZCPS,
3044         IX86_BUILTIN_VTESTZPD256, IX86_BUILTIN_VTESTCPD256,
3045         IX86_BUILTIN_VTESTNZCPD256, IX86_BUILTIN_VTESTZPS256,
3046         IX86_BUILTIN_VTESTCPS256, IX86_BUILTIN_VTESTNZCPS256,
3047         IX86_BUILTIN_PTESTZ256, IX86_BUILTIN_PTESTC256,
3048         IX86_BUILTIN_PTESTNZC256, IX86_BUILTIN_MOVMSKPD256
3049         and IX86_BUILTIN_MOVMSKPS256,
3050         (ix86_special_builtin_type): Add V32QI_FTYPE_PCCHAR,
3051         V8SF_FTYPE_PCV4SF, V8SF_FTYPE_PCFLOAT, V4DF_FTYPE_PCV2DF,
3052         V4DF_FTYPE_PCDOUBLE, V8SF_FTYPE_PCV8SF_V8SF,
3053         V4DF_FTYPE_PCV4DF_V4DF, V4SF_FTYPE_PCV4SF_V4SF,
3054         V2DF_FTYPE_PCV2DF_V2DF, VOID_FTYPE_PCHAR_V32QI,
3055         VOID_FTYPE_PFLOAT_V8SF, VOID_FTYPE_PDOUBLE_V4DF,
3056         VOID_FTYPE_PV8SF_V8SF_V8SF, VOID_FTYPE_PV4DF_V4DF_V4DF,
3057         VOID_FTYPE_PV4SF_V4SF_V4SF and VOID_FTYPE_PV2DF_V2DF_V2DF,
3058         (ix86_builtin_type): Add INT_FTYPE_V8SF_V8SF_PTEST,
3059         INT_FTYPE_V4DI_V4DI_PTEST, INT_FTYPE_V4DF_V4DF_PTEST,
3060         INT_FTYPE_V4SF_V4SF_PTEST, INT_FTYPE_V2DF_V2DF_PTEST,
3061         INT_FTYPE_V8SF, INT_FTYPE_V4DF, V8SI_FTYPE_V8SF, V8SI_FTYPE_V4SI,
3062         V8SF_FTYPE_V8SF, V8SF_FTYPE_V8SI, V8SF_FTYPE_V4SF,
3063         V4SI_FTYPE_V8SI, V4SI_FTYPE_V4DF, V4DF_FTYPE_V4DF,
3064         V4DF_FTYPE_V4SI, V4DF_FTYPE_V4SF, V4DF_FTYPE_V2DF,
3065         V4SF_FTYPE_V4DF, V4SF_FTYPE_V8SF, V2DF_FTYPE_V4DF,
3066         V8SF_FTYPE_V8SF_V8SF, V8SF_FTYPE_V8SF_V8SI,
3067         V4DF_FTYPE_V4DF_V4DF, V4DF_FTYPE_V4DF_V4DI,
3068         V4SF_FTYPE_V4SF_V4SI, V2DF_FTYPE_V2DF_V2DI,
3069         V8SF_FTYPE_V8SF_INT, V4SI_FTYPE_V8SI_INT, V4SF_FTYPE_V8SF_INT,
3070         V2DF_FTYPE_V4DF_INT, V4DF_FTYPE_V4DF_INT,
3071         V8SF_FTYPE_V8SF_V8SF_V8SF, V4DF_FTYPE_V4DF_V4DF_V4DF,
3072         V8SI_FTYPE_V8SI_V8SI_INT, V8SF_FTYPE_V8SF_V8SF_INT,
3073         V4DF_FTYPE_V4DF_V4DF_INT, V4DF_FTYPE_V4DF_V2DF_INT,
3074         V8SF_FTYPE_V8SF_V8SF_V8SI_INT, V4DF_FTYPE_V4DF_V4DF_V4DI_INT,
3075         V4SF_FTYPE_V4SF_V4SF_V4SI_INT and V2DF_FTYPE_V2DF_V2DF_V2DI_INT.
3076         (bdesc_special_args): Add IX86_BUILTIN_VZEROALL,
3077         IX86_BUILTIN_VZEROUPPER. IX86_BUILTIN_VZEROUPPER_REX64,
3078         IX86_BUILTIN_VBROADCASTSS, IX86_BUILTIN_VBROADCASTSD256,
3079         IX86_BUILTIN_VBROADCASTSS256, IX86_BUILTIN_VBROADCASTPD256,
3080         IX86_BUILTIN_VBROADCASTPS256, IX86_BUILTIN_LOADUPD256,
3081         IX86_BUILTIN_LOADUPS256, IX86_BUILTIN_STOREUPD256,
3082         IX86_BUILTIN_STOREUPS256, IX86_BUILTIN_LOADDQU256,
3083         IX86_BUILTIN_STOREDQU256, IX86_BUILTIN_LDDQU256,
3084         IX86_BUILTIN_MASKLOADPD, IX86_BUILTIN_MASKLOADPS,
3085         IX86_BUILTIN_MASKLOADPD256, IX86_BUILTIN_MASKLOADPS256,
3086         IX86_BUILTIN_MASKSTOREPD, IX86_BUILTIN_MASKSTOREPS,
3087         IX86_BUILTIN_MASKSTOREPD256 and IX86_BUILTIN_MASKSTOREPS256.
3088         (ix86_builtins): Add IX86_BUILTIN_ADDPD256,
3089         IX86_BUILTIN_ADDPS256, IX86_BUILTIN_ADDSUBPD256,
3090         IX86_BUILTIN_ADDSUBPS256, IX86_BUILTIN_ANDPD256,
3091         IX86_BUILTIN_ANDPS256, IX86_BUILTIN_ANDNPD256,
3092         IX86_BUILTIN_ANDNPS256, IX86_BUILTIN_DIVPD256,
3093         IX86_BUILTIN_DIVPS256, IX86_BUILTIN_HADDPD256,
3094         IX86_BUILTIN_HSUBPS256, IX86_BUILTIN_HSUBPD256,
3095         IX86_BUILTIN_HADDPS256, IX86_BUILTIN_MAXPD256,
3096         IX86_BUILTIN_MAXPS256, IX86_BUILTIN_MINPD256,
3097         IX86_BUILTIN_MINPS256, IX86_BUILTIN_MULPD256,
3098         IX86_BUILTIN_MULPS256, IX86_BUILTIN_ORPD256,
3099         IX86_BUILTIN_ORPS256, IX86_BUILTIN_SUBPD256,
3100         IX86_BUILTIN_SUBPS256, IX86_BUILTIN_XORPD256,
3101         IX86_BUILTIN_XORPS256, IX86_BUILTIN_VPERMILVARPD,
3102         IX86_BUILTIN_VPERMILVARPS, IX86_BUILTIN_VPERMILVARPD256,
3103         IX86_BUILTIN_VPERMILVARPS256, IX86_BUILTIN_BLENDPD256,
3104         IX86_BUILTIN_BLENDPS256, IX86_BUILTIN_BLENDVPD256,
3105         IX86_BUILTIN_BLENDVPS256, IX86_BUILTIN_DPPS256,
3106         IX86_BUILTIN_SHUFPD256, IX86_BUILTIN_SHUFPS256,
3107         IX86_BUILTIN_CMPSD, IX86_BUILTIN_CMPSS, IX86_BUILTIN_CMPPD,
3108         IX86_BUILTIN_CMPPS,
3109         IX86_BUILTIN_CMPPD256,IX86_BUILTIN_CMPPS256,
3110         IX86_BUILTIN_EXTRACTF128PD256, IX86_BUILTIN_EXTRACTF128PS256,
3111         IX86_BUILTIN_EXTRACTF128SI256, IX86_BUILTIN_CVTDQ2PD256,
3112         IX86_BUILTIN_CVTDQ2PS256, IX86_BUILTIN_CVTPD2PS256,
3113         IX86_BUILTIN_CVTPS2DQ256, IX86_BUILTIN_CVTPS2PD256,
3114         IX86_BUILTIN_CVTTPD2DQ256, IX86_BUILTIN_CVTPD2DQ256,
3115         IX86_BUILTIN_CVTTPS2DQ256, IX86_BUILTIN_VPERM2F128PD256,
3116         IX86_BUILTIN_VPERM2F128PS256, IX86_BUILTIN_VPERM2F128SI256,
3117         IX86_BUILTIN_VPERMILPD, IX86_BUILTIN_VPERMILPS,
3118         IX86_BUILTIN_VPERMILPD256, IX86_BUILTIN_VPERMILPS256,
3119         IX86_BUILTIN_VPERMIL2PD, IX86_BUILTIN_VPERMILPS,
3120         IX86_BUILTIN_VPERMILPD256, IX86_BUILTIN_VPERMILPS256,
3121         IX86_BUILTIN_VPERMIL2PD, IX86_BUILTIN_VPERMIL2PS,
3122         IX86_BUILTIN_VPERMIL2PD256, IX86_BUILTIN_VPERMIL2PS256,
3123         IX86_BUILTIN_VINSERTF128PD256, IX86_BUILTIN_VINSERTF128PS256,
3124         IX86_BUILTIN_VINSERTF128SI256, IX86_BUILTIN_MOVSHDUP256,
3125         IX86_BUILTIN_MOVSLDUP256, IX86_BUILTIN_MOVDDUP256,
3126         IX86_BUILTIN_SQRTPD256, IX86_BUILTIN_SQRTPS256,
3127         IX86_BUILTIN_SQRTPS_NR256, IX86_BUILTIN_RSQRTPS256,
3128         IX86_BUILTIN_RSQRTPS_NR256, IX86_BUILTIN_RCPPS256,
3129         IX86_BUILTIN_ROUNDPD256, IX86_BUILTIN_ROUNDPS256,
3130         IX86_BUILTIN_UNPCKHPD256, IX86_BUILTIN_UNPCKLPD256,
3131         IX86_BUILTIN_UNPCKHPS256, IX86_BUILTIN_UNPCKLPS256,
3132         IX86_BUILTIN_SI256_SI, IX86_BUILTIN_PS256_PS,
3133         IX86_BUILTIN_PD256_PD, IX86_BUILTIN_SI_SI256,
3134         IX86_BUILTIN_PS_PS256, IX86_BUILTIN_PD_PD256,
3135         IX86_BUILTIN_VTESTZPD, IX86_BUILTIN_VTESTCPD,
3136         IX86_BUILTIN_VTESTNZCPD, IX86_BUILTIN_VTESTZPS,
3137         IX86_BUILTIN_VTESTCPS, IX86_BUILTIN_VTESTNZCPS,
3138         IX86_BUILTIN_VTESTZPD256, IX86_BUILTIN_VTESTCPD256,
3139         IX86_BUILTIN_VTESTNZCPD256, IX86_BUILTIN_VTESTZPS256,
3140         IX86_BUILTIN_VTESTCPS256, IX86_BUILTIN_VTESTNZCPS256,
3141         IX86_BUILTIN_PTESTZ256, IX86_BUILTIN_PTESTC256,
3142         IX86_BUILTIN_PTESTNZC256, IX86_BUILTIN_MOVMSKPD256 and
3143         IX86_BUILTIN_MOVMSKPS256.
3144         (ix86_init_mmx_sse_builtins): Support AVX builtins.
3145         (ix86_expand_args_builtin): Likewise.
3146         (ix86_expand_special_args_builtin): Likewise.
3147         (ix86_hard_regno_mode_ok): Handle AVX modes.
3148         (ix86_expand_vector_init_duplicate): Likewise.
3149         (ix86_expand_vector_init_one_nonzero): Likewise.
3150         (ix86_expand_vector_init_one_var): Likewise.
3151         (ix86_expand_vector_init_concat): Likewise.
3152         (ix86_expand_vector_init_general): Likewise.
3153         (ix86_expand_vector_set): Likewise.
3154         (ix86_vector_mode_supported_p): Likewise.
3155         (x86_extended_reg_mentioned_p): Check INSN_P before using
3156         PATTERN.
3157
3158         * config/i386/i386-c.c (ix86_target_macros_internal): Handle
3159         OPTION_MASK_ISA_AVX and OPTION_MASK_ISA_FMA.
3160
3161         * config/i386/i386.h (TARGET_AVX): New.
3162         (TARGET_FMA): Likewise.
3163         (TARGET_CPU_CPP_BUILTINS): Handle TARGET_AVX and TARGET_FMA.
3164         (BIGGEST_ALIGNMENT): Set to 256 for TARGET_AVX.
3165         (VALID_AVX256_REG_MODE): New.
3166         (AVX256_VEC_FLOAT_MODE_P): Likewise.
3167         (AVX_FLOAT_MODE_P): Likewise.
3168         (AVX128_VEC_FLOAT_MODE_P): Likewise.
3169         (AVX256_VEC_FLOAT_MODE_P): Likewise.
3170         (AVX_VEC_FLOAT_MODE_P): Likewise.
3171         (ASM_OUTPUT_AVX_PREFIX): Likewise.
3172         (ASM_OUTPUT_OPCODE): Likewise.
3173         (UNITS_PER_SIMD_WORD): Add a FIXME for 32byte vectorizer
3174         support.
3175         (SSE_REG_MODE_P): Allow 256bit vector modes.
3176         (ix86_args): Add a warn_avx field.
3177
3178         * config/i386/i386.md (UNSPEC_PCMP): New.
3179         (UNSPEC_VPERMIL): Likewise.
3180         (UNSPEC_VPERMIL2): Likewise.
3181         (UNSPEC_VPERMIL2F128): Likewise.
3182         (UNSPEC_MASKLOAD): Likewise.
3183         (UNSPEC_MASKSTORE): Likewise.
3184         (UNSPEC_CAST): Likewise.
3185         (UNSPEC_VTESTP): Likewise.
3186         (UNSPECV_VZEROALL): Likewise.
3187         (UNSPECV_VZEROUPPER): Likewise.
3188         (XMM0_REG): Likewise.
3189         (XMM1_REG): Likewise.
3190         (XMM2_REG): Likewise.
3191         (XMM3_REG): Likewise.
3192         (XMM4_REG): Likewise.
3193         (XMM5_REG): Likewise.
3194         (XMM6_REG): Likewise.
3195         (XMM8_REG): Likewise.
3196         (XMM9_REG): Likewise.
3197         (XMM10_REG): Likewise.
3198         (XMM11_REG): Likewise.
3199         (XMM12_REG): Likewise.
3200         (XMM13_REG): Likewise.
3201         (XMM14_REG): Likewise.
3202         (XMM15_REG): Likewise.
3203         (prefix): Likewise.
3204         (prefix_vex_imm8): Likewise.
3205         (prefix_vex_w): Likewise.
3206         (length_vex): Likewise.
3207         (maxmin): Likewise.
3208         (movoi): Likewise.
3209         (*avx_ashlti3): Likewise.
3210         (*avx_lshrti3): Likewise.
3211         (*avx_setcc<mode>): Likewise.
3212         (*fop_<mode>_comm_mixed_avx): Likewise.
3213         (*fop_<mode>_comm_avx): Likewise.
3214         (*fop_<mode>_1_mixed_avx): Likewise.
3215         (*fop_<mode>_1_avx): Likewise.
3216         (*avx_<code><mode>3): Likewise.
3217         (*avx_ieee_smin<mode>3): Likewise.
3218         (*avx_ieee_smax<mode>3): Likewise.
3219         (mode): Add OI, V8SF and V4DF.
3220         (length): Support VEX prefix.
3221         (*cmpfp_i_mixed): Set prefix attribute.
3222         (*cmpfp_i_sse): Likewise.
3223         (*cmpfp_iu_mixed): Likewise.
3224         (*cmpfp_iu_sse): Likewise.
3225         (*movsi_1): Support AVX.
3226         (*movdi_2): Likewise.
3227         (*movdi_1_rex64): Likewise.
3228         (*movti_internal): Likewise.
3229         (*movti_rex64): Likewise.
3230         (*movsf_1): Likewise.
3231         (*movdf_nointeger): Likewise.
3232         (*movdf_integer_rex64): Likewise.
3233         (*movtf_internal): Likewise.
3234         (zero_extendsidi2_32): Likewise.
3235         (zero_extendsidi2_rex64): Likewise.
3236         (*extendsfdf2_mixed): Likewise.
3237         (*extendsfdf2_sse): Likewise.
3238         (*truncdfsf_fast_mixed): Likewise.
3239         (*truncdfsf_fast_sse): Likewise.
3240         (*truncdfsf_mixed): Likewise.
3241         (fix_trunc<mode>di_sse): Likewise.
3242         (fix_trunc<mode>si_sse): Likewise.
3243         (*float<SSEMODEI24:mode><MODEF:mode>2_mixed_interunit): Likewise.
3244         (*float<SSEMODEI24:mode><MODEF:mode>2_mixed_nointerunit): Likewise.
3245         (*float<SSEMODEI24:mode><MODEF:mode>2_sse_interunit): Likewise.
3246         (*float<SSEMODEI24:mode><MODEF:mode>2_sse_nointerunit): Likewise.
3247         (*rcpsf2_sse): Likewise.
3248         (*rsqrtsf2_sse): Likewise.
3249         (*sqrt<mode>2_sse): Likewise.
3250         (sse4_1_round<mode>2): Likewise.
3251         (*sse_prologue_save_insn): Disallow REX prefix for AVX.
3252         Support AVX.  Set length attribute properly for AVX.
3253
3254         * config/i386/i386-modes.def (VECTOR_MODES (INT, 32)): New.
3255         (VECTOR_MODES (FLOAT, 32)): Likewise.
3256         (VECTOR_MODE (INT, DI, 8)): Likewise.
3257         (VECTOR_MODE (INT, HI, 32)): Likewise.
3258         (VECTOR_MODE (INT, QI, 64)): Likewise.
3259         (VECTOR_MODE (FLOAT, DF, 8)): Likewise.
3260         (VECTOR_MODE (FLOAT, SF, 16)): Likewise.
3261         (VECTOR_MODE (INT, DI, 4)): Removed.
3262         (VECTOR_MODE (INT, SI, 8)): Likewise.
3263         (VECTOR_MODE (INT, HI, 16)): Likewise.
3264         (VECTOR_MODE (INT, QI, 32)): Likewise.
3265         (VECTOR_MODE (FLOAT, SF, 8)): Likewise.
3266         (INT_MODE (OI, 32)): Likewise.
3267
3268         * config/i386/i386.opt (mavx): New.
3269         (mfma): Likewise.
3270
3271         * config/i386/i386-protos.h (ix86_attr_length_vex_default): New.
3272
3273         * config/i386/mmx.md (*mov<mode>_internal_rex64): Support AVX.
3274         (*mov<mode>_internal_avx): New.
3275         (*movv2sf_internal_rex64_avx): Likewise.
3276         (*movv2sf_internal_avx): Likewise.
3277
3278         * config/i386/predicates.md (const_4_to_5_operand): New.
3279         (const_6_to_7_operand): Likewise.
3280         (const_8_to_11_operand): Likewise.
3281         (const_12_to_15_operand): Likewise.
3282         (avx_comparison_float_operator): Likewise.
3283
3284         * config/i386/sse.md (AVX256MODEI): New.
3285         (AVX256MODE): Likewise.
3286         (AVXMODEQI): Likewise.
3287         (AVXMODE): Likewise.
3288         (AVX256MODEF2P): Likewise.
3289         (AVX256MODE2P): Likewise.
3290         (AVX256MODE4P): Likewise.
3291         (AVX256MODE8P): Likewise.
3292         (AVXMODEF2P): Likewise.
3293         (AVXMODEF4P): Likewise.
3294         (AVXMODEDCVTDQ2PS): Likewise.
3295         (AVXMODEDCVTPS2DQ): Likewise.
3296         (avxvecmode): Likewise.
3297         (avxvecpsmode): Likewise.
3298         (avxhalfvecmode): Likewise.
3299         (avxscalarmode): Likewise.
3300         (avxcvtvecmode): Likewise.
3301         (avxpermvecmode): Likewise.
3302         (avxmodesuffixf2c): Likewise.
3303         (avxmodesuffixp): Likewise.
3304         (avxmodesuffixs): Likewise.
3305         (avxmodesuffix): Likewise.
3306         (vpermilbits): Likewise.
3307         (pinsrbits): Likewise.
3308         (mov<mode>): Likewise.
3309         (*mov<mode>_internal): Likewise.
3310         (push<mode>1): Likewise.
3311         (movmisalign<mode>): Likewise.
3312         (avx_movup<avxmodesuffixf2c><avxmodesuffix>): Likewise.
3313         (avx_movdqu<avxmodesuffix>): Likewise.
3314         (avx_lddqu<avxmodesuffix>): Likewise.
3315         (<plusminus_insn><mode>3): Likewise.
3316         (*avx_<plusminus_insn><mode>3): Likewise.
3317         (*avx_vm<plusminus_insn><mode>3): Likewise.
3318         (mul<mode>3): Likewise.
3319         (*avx_mul<mode>3): Likewise.
3320         (*avx_vmmul<mode>3): Likewise.
3321         (divv8sf3): Likewise.
3322         (divv4df3): Likewise.
3323         (avx_div<mode>3): Likewise.
3324         (*avx_div<mode>3): Likewise.
3325         (*avx_vmdiv<mode>3): Likewise.
3326         (avx_rcpv8sf2): Likewise.
3327         (*avx_vmrcpv4sf2): Likewise.
3328         (sqrtv8sf2): Likewise.
3329         (avx_sqrtv8sf2): Likewise.
3330         (*avx_vmsqrt<mode>2): Likewise.
3331         (rsqrtv8sf2): Likewise.
3332         (avx_rsqrtv8sf2): Likewise.
3333         (*avx_vmrsqrtv4sf2): Likewise.
3334         (<code><mode>3): Likewise.
3335         (*avx_<code><mode>3_finite): Likewise.
3336         (*avx_<code><mode>3): Likewise.
3337         (*avx_vm<code><mode>3): Likewise.
3338         (*avx_ieee_smin<mode>3): Likewise.
3339         (*avx_ieee_smax<mode>3): Likewise.
3340         (avx_addsubv8sf3): Likewise.
3341         (avx_addsubv4df3): Likewise.
3342         (*avx_addsubv4sf3): Likewise.
3343         (*avx_addsubv2df3): Likewise.
3344         (avx_h<plusminus_insn>v4df3): Likewise.
3345         (avx_h<plusminus_insn>v8sf3): Likewise.
3346         (*avx_h<plusminus_insn>v4sf3): Likewise.
3347         (*avx_h<plusminus_insn>v2df3): Likewise.
3348         (avx_cmpp<avxmodesuffixf2c><mode>3): Likewise.
3349         (avx_cmps<ssemodesuffixf2c><mode>3): Likewise.
3350         (*avx_maskcmp<mode>3): Likewise.
3351         (avx_nand<mode>3): Likewise.
3352         (*avx_<code><mode>3): Likewise.
3353         (*avx_nand<mode>3): Likewise.
3354         (*avx_<code><mode>3): Likewise.
3355         (*avx_cvtsi2ss): Likewise.
3356         (*avx_cvtsi2ssq): Likewise.
3357         (*avx_cvtsi2sd): Likewise.
3358         (*avx_cvtsi2sdq): Likewise.
3359         (*avx_cvtsd2ss): Likewise.
3360         (avx_cvtss2sd): Likewise.
3361         (avx_cvtdq2ps<avxmodesuffix>): Likewise.
3362         (avx_cvtps2dq<avxmodesuffix>): Likewise.
3363         (avx_cvttps2dq<avxmodesuffix>): Likewise.
3364         (*avx_cvtsi2sd): Likewise.
3365         (*avx_cvtsi2sdq): Likewise.
3366         (avx_cvtdq2pd256): Likewise.
3367         (avx_cvtpd2dq256): Likewise.
3368         (avx_cvttpd2dq256): Likewise.
3369         (*avx_cvtsd2ss): Likewise.
3370         (*avx_cvtss2sd): Likewise.
3371         (avx_cvtpd2ps256): Likewise.
3372         (avx_cvtps2pd256): Likewise.
3373         (*avx_movhlps): Likewise.
3374         (*avx_movlhps): Likewise.
3375         (avx_unpckhps256): Likewise.
3376         (*avx_unpckhps): Likewise.
3377         (avx_unpcklps256): Likewise.
3378         (*avx_unpcklps): Likewise.
3379         (avx_movshdup256): Likewise.
3380         (avx_movsldup256): Likewise.
3381         (avx_shufps256): Likewise.
3382         (avx_shufps256_1): Likewise.
3383         (*avx_shufps_<mode>): Likewise.
3384         (*avx_loadhps): Likewise.
3385         (*avx_storelps): Likewise.
3386         (*avx_loadlps): Likewise.
3387         (*avx_movss): Likewise.
3388         (*vec_dupv4sf_avx): Likewise.
3389         (*vec_concatv2sf_avx): Likewise.
3390         (*vec_concatv4sf_avx): Likewise.
3391         (*vec_setv4sf_0_avx): Likewise.
3392         (*vec_setv4sf_avx): Likewise.
3393         (*avx_insertps): Likewise.
3394         (avx_vextractf128<mode>): Likewise.
3395         (vec_extract_lo_<mode>): Likewise.
3396         (vec_extract_hi_<mode>): Likewise.
3397         (vec_extract_lo_<mode>): Likewise.
3398         (vec_extract_hi_<mode>): Likewise.
3399         (vec_extract_lo_v16hi): Likewise.
3400         (vec_extract_hi_v16hi): Likewise.
3401         (vec_extract_lo_v32qi): Likewise.
3402         (vec_extract_hi_v32qi): Likewise.
3403         (avx_unpckhpd256): Likewise.
3404         (*avx_unpckhpd): Likewise.
3405         (avx_movddup256): Likewise.
3406         (*avx_movddup): Likewise.
3407         (avx_unpcklpd256): Likewise.
3408         (*avx_unpcklpd): Likewise.
3409         (avx_shufpd256): Likewise.
3410         (avx_shufpd256_1): Likewise.
3411         (*avx_punpckhqdq): Likewise.
3412         (*avx_punpcklqdq): Likewise.
3413         (*avx_shufpd_<mode>): Likewise.
3414         (*avx_storehpd): Likewise.
3415         (*avx_loadhpd): Likewise.
3416         (*avx_loadlpd): Likewise.
3417         (*avx_movsd): Likewise.
3418         (*vec_concatv2df_avx): Likewise.
3419         (*avx_<plusminus_insn><mode>3): Likewise.
3420         (*avx_<plusminus_insn><mode>3): Likewise.
3421         (*avx_mulv8hi3): Likewise.
3422         (*avxv8hi3_highpart): Likewise.
3423         (*avx_umulv8hi3_highpart): Likewise.
3424         (*avx_umulv2siv2di3): Likewise.
3425         (*avx_mulv2siv2di3): Likewise.
3426         (*avx_pmaddwd): Likewise.
3427         (*avx_mulv4si3): Likewise.
3428         (*avx_ashr<mode>3): Likewise.
3429         (*avx_lshr<mode>3): Likewise.
3430         (*avx_ashl<mode>3): Likewise.
3431         (*avx_<code><mode>3): Likewise.
3432         (*avx_eq<mode>3): Likewise.
3433         (*avx_gt<mode>3): Likewise.
3434         (*avx_nand<mode>3): Likewise.
3435         (*avx_nand<mode>3): Likewise.
3436         (*avx_<code><mode>3): Likewise.
3437         (*avx_<code><mode>3): Likewise.
3438         (*avx_packsswb): Likewise.
3439         (*avx_packssdw): Likewise.
3440         (*avx_packuswb): Likewise.
3441         (*avx_punpckhbw): Likewise.
3442         (*avx_punpcklbw): Likewise.
3443         (*avx_punpckhwd): Likewise.
3444         (*avx_punpcklwd): Likewise.
3445         (*avx_punpckhdq): Likewise.
3446         (*avx_punpckldq): Likewise.
3447         (*avx_pinsr<avxmodesuffixs>): Likewise.
3448         (*avx_pinsrq): Likewise.
3449         (*avx_loadld): Likewise.
3450         (*vec_extractv2di_1_rex64_avx): Likewise.
3451         (*vec_extractv2di_1_avx): Likewise.
3452         (*vec_dupv2di_avx): Likewise.
3453         (*vec_concatv2si_avx): Likewise.
3454         (*vec_concatv4si_1_avx): Likewise.
3455         (*vec_concatv2di_avx): Likewise.
3456         (*vec_concatv2di_rex64_avx): Likewise.
3457         (*avx_uavgv16qi3): Likewise.
3458         (*avx_uavgv8hi3): Likewise.
3459         (*avx_psadbw): Likewise.
3460         (avx_movmskp<avxmodesuffixf2c>256): Likewise.
3461         (*avx_phaddwv8hi3): Likewise.
3462         (*avx_phadddv4si3): Likewise.
3463         (*avx_phaddswv8hi3): Likewise.
3464         (*avx_phsubwv8hi3): Likewise.
3465         (*avx_phsubdv4si3): Likewise.
3466         (*avx_phsubswv8hi3): Likewise.
3467         (*avx_pmaddubsw128): Likewise.
3468         (*avx_pmulhrswv8hi3): Likewise.
3469         (*avx_pshufbv16qi3): Likewise.
3470         (*avx_psign<mode>3): Likewise.
3471         (*avx_palignrti): Likewise.
3472         (avx_blendp<avxmodesuffixf2c><avxmodesuffix>): Likewise.
3473         (avx_blendvp<avxmodesuffixf2c><avxmodesuffix>): Likewise.
3474         (avx_dpp<avxmodesuffixf2c><avxmodesuffix>): Likewise.
3475         (*avx_mpsadbw): Likewise.
3476         (*avx_packusdw): Likewise.
3477         (*avx_pblendvb): Likewise.
3478         (*avx_pblendw): Likewise.
3479         (avx_vtestp<avxmodesuffixf2c><avxmodesuffix>): Likewise.
3480         (avx_ptest256): Likewise.
3481         (avx_roundp<avxmodesuffixf2c>256): Likewise.
3482         (*avx_rounds<ssemodesuffixf2c>): Likewise.
3483         (*avx_aesenc): Likewise.
3484         (*avx_aesenclast): Likewise.
3485         (*avx_aesdec): Likewise.
3486         (*avx_aesdeclast): Likewise.
3487         (avx_vzeroupper): Likewise.
3488         (avx_vzeroupper_rex64): Likewise.
3489         (avx_vpermil<mode>): Likewise.
3490         (avx_vpermilvar<mode>3): Likewise.
3491         (avx_vpermil2<mode>3): Likewise.
3492         (avx_vperm2f128<mode>3): Likewise.
3493         (avx_vbroadcasts<avxmodesuffixf2c><avxmodesuffix>): Likewise.
3494         (avx_vbroadcastss256): Likewise.
3495         (avx_vbroadcastf128_p<avxmodesuffixf2c>256): Likewise.
3496         (avx_vinsertf128<mode>): Likewise.
3497         (vec_set_lo_<mode>): Likewise.
3498         (vec_set_hi_<mode>): Likewise.
3499         (vec_set_lo_<mode>): Likewise.
3500         (vec_set_hi_<mode>): Likewise.
3501         (vec_set_lo_v16hi): Likewise.
3502         (vec_set_hi_v16hi): Likewise.
3503         (vec_set_lo_v32qi): Likewise.
3504         (vec_set_hi_v32qi): Likewise.
3505         (avx_maskloadp<avxmodesuffixf2c><avxmodesuffix>): Likewise.
3506         (avx_maskstorep<avxmodesuffixf2c><avxmodesuffix>): Likewise.
3507         (avx_<avxmodesuffixp><avxmodesuffix>_<avxmodesuffixp>): Likewise.
3508         (avx_<avxmodesuffixp>_<avxmodesuffixp><avxmodesuffix>): Likewise.
3509         (vec_init<mode>): Likewise.
3510         (*vec_concat<mode>_avx): Likewise.
3511         (blendbits): Support V8SF and V4DF.
3512         (sse2_movq128): Support AVX.
3513         (<sse>_movnt<mode>): Likewise.
3514         (sse2_movntv2di): Likewise.
3515         (sse_rcpv4sf2): Likewise.
3516         (sse_sqrtv4sf2): Likewise.
3517         (sse_rsqrtv4sf2): Likewise.
3518         (<sse>_comi): Likewise.
3519         (<sse>_ucomi): Likewise.
3520         (sse_cvtss2si): Likewise.
3521         (sse_cvtss2si_2): Likewise.
3522         (sse_cvtss2siq): Likewise.
3523         (sse_cvtss2siq_2): Likewise.
3524         (sse_cvttss2si): Likewise.
3525         (sse_cvttss2siq): Likewise.
3526         (sse2_cvtsd2si): Likewise.
3527         (sse2_cvtsd2si_2): Likewise.
3528         (sse2_cvtsd2siq): Likewise.
3529         (sse2_cvtsd2siq_2): Likewise.
3530         (sse2_cvttsd2si): Likewise.
3531         (sse2_cvttsd2siq): Likewise.
3532         (sse2_cvtdq2pd): Likewise.
3533         (*sse2_cvtpd2dq): Likewise.
3534         (*sse2_cvttpd2dq): Likewise.
3535         (*sse2_cvtpd2ps): Likewise.
3536         (sse2_cvtps2pd): Likewise.
3537         (sse3_movshdup): Likewise.
3538         (sse3_movsldup): Likewise.
3539         (sse_storehps): Likewise.
3540         (*sse4_1_extractps): Likewise.
3541         (sse2_storelpd): Likewise.
3542         (vec_dupv2df_sse3): Likewise.
3543         (*vec_concatv2df_sse3): Likewise.
3544         (*sse4_1_pextrb): Likewise.
3545         (*sse4_1_pextrb_memory): Likewise.
3546         (*sse2_pextrw): Likewise.
3547         (*sse4_1_pextrw_memory): Likewise.
3548         (*sse4_1_pextrd): Likewise.
3549         (*sse4_1_pextrq): Likewise.
3550         (sse2_pshufd_1): Likewise.
3551         (sse2_pshuflw_1): Likewise.
3552         (sse2_pshufhw_1): Likewise.
3553         (*sse2_storeq_rex64): Likewise.
3554         (*vec_dupv4si): Likewise.
3555         (<sse>_movmskp<ssemodesuffixf2c>): Likewise.
3556         (sse2_pmovmskb): Likewise.
3557         (*sse2_maskmovdqu): Likewise.
3558         (*sse2_maskmovdqu_rex64): Likewise.
3559         (sse_ldmxcsr): Likewise.
3560         (sse_stmxcsr): Likewise.
3561         (abs<mode>2): Likewise.
3562         (sse4_1_movntdqa): Likewise.
3563         (sse4_1_phminposuw): Likewise.
3564         (sse4_1_extendv8qiv8hi2): Likewise.
3565         (*sse4_1_extendv8qiv8hi2): Likewise.
3566         (sse4_1_extendv4qiv4si2): Likewise.
3567         (*sse4_1_extendv4qiv4si2): Likewise.
3568         (sse4_1_extendv2qiv2di2): Likewise.
3569         (*sse4_1_extendv2qiv2di2): Likewise.
3570         (sse4_1_extendv4hiv4si2): Likewise.
3571         (*sse4_1_extendv4hiv4si2): Likewise.
3572         (sse4_1_extendv2hiv2di2): Likewise.
3573         (*sse4_1_extendv2hiv2di2): Likewise.
3574         (sse4_1_extendv2siv2di2): Likewise.
3575         (*sse4_1_extendv2siv2di2): Likewise.
3576         (sse4_1_zero_extendv8qiv8hi2): Likewise.
3577         (*sse4_1_zero_extendv8qiv8hi2): Likewise.
3578         (sse4_1_zero_extendv4qiv4si2): Likewise.
3579         (*sse4_1_zero_extendv4qiv4si2): Likewise.
3580         (sse4_1_zero_extendv2qiv2di2): Likewise.
3581         (*sse4_1_zero_extendv2qiv2di2): Likewise.
3582         (sse4_1_zero_extendv4hiv4si2): Likewise.
3583         (*sse4_1_zero_extendv4hiv4si2): Likewise.
3584         (sse4_1_zero_extendv2hiv2di2): Likewise.
3585         (*sse4_1_zero_extendv2hiv2di2): Likewise.
3586         (sse4_1_zero_extendv2siv2di2): Likewise.
3587         (*sse4_1_zero_extendv2siv2di2): Likewise.
3588         (sse4_1_ptest): Likewise.
3589         (sse4_1_roundp<ssemodesuffixf2c>): Likewise.
3590         (sse4_2_pcmpestri): Likewise.
3591         (sse4_2_pcmpestrm): Likewise.
3592         (sse4_2_pcmpistri): Likewise.
3593         (sse4_2_pcmpistrm): Likewise.
3594         (aesimc): Likewise.
3595         (aeskeygenassist): Likewise.
3596
3597 2008-08-28  Uros Bizjak  <ubizjak@gmail.com>
3598
3599         * config/i386/predicates.md (vzeroall_operation): New.
3600
3601         * config/i386/sse.md (avx_vzeroall): New.
3602         (*avx_vzeroall): Likewise.
3603
3604 2008-08-28  Paul Brook  <paul@codesourcery.com>
3605             Mark Shinwell  <shinwell@codesourcery.com>
3606             Richard Earnshaw  <richard.earnshaw@arm.com>
3607
3608         * config/arm/arm.c (TARGET_MAX_ANCHOR_OFFSET): New.
3609         (TARGET_MIN_ANCHOR_OFFSET): New.
3610         (arm_override_options): Set correct anchor ranges for Thumb-1
3611         and Thumb-2 if required.
3612         (legitimize_pic_address): Handle case involving a TLS symbol
3613         reference with an addend.
3614         (arm_optimization_options): Enable section anchors at -O1 and
3615         above.
3616         * config/arm/arm.h (OPTIMIZATION_OPTIONS): New.
3617         * config/arm/arm-protos.h (arm_optimization_options): New.
3618
3619 2008-08-28  Nick Clifton  <nickc@redhat.com>
3620
3621         * config/stormy16/stormy16.h (IRA_COVER_CLASSES): Define.
3622         * config/stormy16/stormy16.md (zero_extendqihi2): Fix length
3623         attribute.
3624
3625         * config/v850/v850.h (IRA_COVER_CLASSES): Define.
3626         * config/v850/v850.md (return): Remove frame size restriction.
3627
3628         * config/mcore/mcore.h (IRA_COVER_CLASSES): Define.
3629
3630         * config/iq2000/iq2000.h (IRA_COVER_CLASSES): Define.
3631
3632         * config/fr30/fr30.h (IRA_COVER_CLASSES): Define.
3633
3634         * config/m32r/m32r.h (IRA_COVER_CLASSES): Define.
3635
3636 2008-08-28  Paul Brook  <paul@codesourcery.com>
3637
3638         * config/arm/vfp11.md: Update license notice.
3639         * config/arm/cortex-r4.md: Ditto.
3640
3641 2008-08-28  Richard Guenther  <rguenther@suse.de>
3642
3643         PR tree-optimization/37207
3644         * tree-ssa-ifcombine.c (recognize_single_bit_test): Fix
3645         tuplification bug.
3646
3647 2008-08-28  Dodji Seketeli  <dodji@redhat.com>
3648
3649         PR c++/36741
3650         * tree.c (int_fits_type_p): Don't forget unsigned integers
3651           of type sizetype which higher end word equals -1.
3652
3653 2008-08-28  Ira Rosen  <irar@il.ibm.com>
3654
3655         * target.h (struct vectorize): Add new target builtin.
3656         * tree-vectorizer.c (destroy_loop_vec_info): Call
3657         vect_free_slp_instance instead of vect_free_slp_node.
3658         * tree-vectorizer.h (enum slp_load_perm_type): New.
3659         (struct _slp_instance): Add new fields.
3660         (SLP_INSTANCE_LOAD_PERMUTATION): New.
3661         (SLP_INSTANCE_LOADS): New.
3662         (vect_free_slp_tree): Remove.
3663         (vect_free_slp_instance): Declare.
3664         (SLP_TREE_LOADS_PERM_TYPE, TARG_VEC_PERMUTE_COST): New.
3665         (vectorizable_load): Add argument.
3666         (vect_transform_slp_perm_load): New.
3667         * tree-vect-analyze.c (vect_analyze_operations): Add an argument to
3668         vectorizable_load.
3669         (vect_get_place_in_interleaving_chain): New function.
3670         (vect_free_slp_tree): Make static.
3671         (vect_free_slp_instance): New function.
3672         (vect_build_slp_tree): Add new arguments. Allow load permutations and
3673         collect the load location in the interleaving chain.
3674         (vect_supported_slp_permutation_p): New function.
3675         (vect_supported_load_permutation_p): Likewise.
3676         (vect_analyze_slp_instance): In case of loads permutation, call
3677         vect_supported_load_permutation_p to check that the permutation is
3678         supported.
3679         * target-def.h (TARGET_VECTORIZE_BUILTIN_VEC_PERM): New.
3680         * tree-vect-transform.c (vect_transform_stmt): Add new argument.
3681         (vect_create_mask_and_perm): New function.
3682         (vect_get_mask_element, vect_transform_slp_perm_load): Likewise.
3683         (vectorizable_load): Add an argument. Don't keep the created vectors
3684         statements in the node if permutation is required. Call
3685         vect_transform_slp_perm_load to generate the permutation.
3686         (vect_transform_stmt): Add new argument. Call vectorizable_load with
3687         additional argument.
3688         (vect_schedule_slp_instance): In case of loads permutation, allocate
3689         vectorized statements structure for all the related SLP nodes. Call
3690         vect_transform_stmt with addditional argument.
3691         (vect_transform_loop): Call vect_transform_stmt with correct arguments.
3692         * config/spu/spu.c (spu_builtin_vec_perm): New.
3693         (TARGET_VECTORIZE_BUILTIN_VEC_PERM): Redefine.
3694         * config/spu/spu.h (TARG_VEC_PERMUTE_COS): Define.
3695         * config/rs6000/rs6000.c (rs6000_builtin_vec_perm): New.
3696         (TARGET_VECTORIZE_BUILTIN_VEC_PERM): Redefine.
3697
3698 2008-08-28  Chris Fairles  <chris.fairles@gmail.com>
3699
3700         * gthr-posix.h (__gthread_create,  __gthread_join, __gthread_detach,
3701         __gthread_mutex_timed_lock, __gthread_recursive_mutex_timed_lock,
3702         __gthread_cond_signal, __gthread_cond_timedwait,
3703         __gthread_cond_timedwait_recursive): New functions.
3704         * gthr-posix.c (pthread_mutex_timedlock, pthread_cond_timedwait):
3705         Likewise.
3706         * gthr.h: Comment on defining __GTHREADS_CXX0X macro in conforming
3707         thread interfaces.
3708
3709 2008-08-28  Richard Guenther  <rguenther@suse.de>
3710
3711         PR middle-end/37005
3712         * fold-const.c (maybe_canonicalize_comparison_1): Require
3713         undefined overflow only for canonicalizing A +- CST cmp CST.
3714         Make sure to not generate new constants that are not inside
3715         their TYPE_MIN/MAX_VALUE range.
3716         (maybe_canonicalize_comparison): Remove undefined overflow
3717         checking from here.
3718         (fold_binary): Remove now duplicate folding.
3719
3720 2008-08-27  Paolo Carlini  <paolo.carlini@oracle.com>
3721
3722         * c-typeck.c (convert_for_assignment): Adjust WARN_FOR_ASSIGNMENT
3723         use not updated in the last change.
3724
3725 2008-08-27  Kaz Kojima  <kkojima@gcc.gnu.org>
3726
3727         * config/sh/sh.h (REG_CLASS_CONTENTS): Drop fr32 from FPUL_REGS.
3728         (IRA_COVER_CLASSES): Add FPUL_REGS.
3729
3730 2008-08-27  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
3731
3732         PR 37217
3733         * c-common.c (conversion_warning): Check for null operands.
3734
3735 2008-08-27  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
3736
3737         PR c/31673
3738         * c-decl.c (check_for_loop_decls): Improve error message. Give
3739         hint.
3740
3741 2008-08-27  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
3742
3743         PR c/37186
3744         * c-typeck.c (WARN_FOR_ASSIGNMENT): Add OPT parameter.
3745         (convert_for_assignment): Pass corrent OPT_W* parameter to
3746         WARN_FOR_ASSIGNMENT.
3747
3748 2008-08-27  Paolo Carlini  <paolo.carlini@oracle.com>
3749
3750         PR c++/35321
3751         * c-common.c (fold_offsetof_1): Handle TARGET_EXPR like CALL_EXPR.
3752
3753 2008-08-27  Paul Brook  <paul@codesourcery.com>
3754
3755         * config.gcc: Loosen checks for arm uclinux eabi targets.
3756
3757 2008-08-27  Paul Brook  <paul@codesourcery.com>
3758
3759         * config/arm/t-arm-coff (LIB1ASMFUNCS): Add missing undescrore on
3760         _clzsi2.
3761         * config/arm/t-linux (LIB1ASMFUNCS): Ditto.
3762
3763 2008-08-26  Douglas Gregor  <doug.gregor@gmail.com>
3764
3765         * c-common.c (do_switch_warnings): Look through the CONST_DECLs in
3766         the enumerators of an ENUMERAL_TYPE.
3767         * dbxout.c (dbxout_type): Ditto.
3768
3769 2008-08-26  Andrew Pinski  <andrew_pinski@playstation.sony.com>
3770
3771         PR rtl-opt/37219
3772         * fwprop.c (fwprop): Check that the loop_father is the outer loop.
3773         (fwprop_addr): Check that the loop_father is not the outer loop.
3774
3775 2008-08-26  Paul Brook  <paul@codesourcery.com>
3776
3777         * config/arm/vfp.md: Document fmul{s,d} and fmac{s,d} types.
3778         Remove documentation entry for fmul type.
3779         Use fmuls to annotate single-precision multiplication patterns,
3780         fmuld to annotate double-precision multiplication patterns,
3781         fmacs to annotate single-precision multiply-accumulate patterns
3782         and fmacd to annotate double-precision multiply-accumulate patterns.
3783         * config/arm/vfp11.md: Update reservations accordingly.
3784         * config/arm/arm.md: Note that certain values of the "type"
3785         attribute are documented in vfp.md.
3786         * config/arm/arm1020e.md: Remove out of date duplicate comment.
3787         (v10_cvt): Use new fmul types.
3788
3789 2008-08-26  Paul Brook  <paul@codesourcery.com>
3790
3791         * config/arm/vfp.md: Move pipeline description for VFP11 to...
3792         * config/arm/vfp11.md: ...here.  New.
3793         * config/arm/arm.md: Include vfp11.md.
3794
3795 2008-08-26  Hans-Peter Nilsson  <hp@axis.com>
3796
3797         * opts.c (decode_options) [!IRA_COVER_CLASSES]: Add missing
3798         parameter to inform call.
3799
3800 2008-08-26  Jeff Law  <law@redhat.com>
3801
3802         * mn10300.md (movqi, movhi): Split i->d*a case into two cases to
3803         avoid the possibility of getting DATA_OR_ADDRESS_REGS as the
3804         preferred class when copying a constant into a partial word register.
3805
3806 2008-08-26  Ben Elliston  <bje@au.ibm.com>
3807
3808         * rtlanal.c: Fix uses of "it's" with "its" where appropriate.
3809         * cp/typeck.c: Likewise.
3810         * cp/tree.c: Likewise.
3811         * gimple-low.c: Likewise.
3812         * jump.c: Likewise.
3813
3814 2008-08-26  Vladimir Makarov  <vmakarov@redhat.com>
3815
3816         * ira-build.c, ira-color.c, ira-costs.c, ira.h, ira-lives.c,
3817         ira.c, ira-conflicts.c, ira-emit.c, ira-int.h: New files.
3818
3819         * doc/passes.texi: Describe IRA.
3820
3821         * doc/tm.texi (IRA_COVER_CLASSES,
3822         IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Describe the new macros.
3823
3824         * doc/invoke.texi (ira-max-loops-num): Describe the new parameter.
3825         (-fira, -fira-algorithm, -fira-coalesce, -fno-ira-move-spills,
3826         -fira-propagate-cost, -fno-ira-share-save-slots,
3827         -fno-ira-share-spill-slots, -fira-verbose): Describe new options.
3828
3829         * flags.h (ira_algorithm): New enumeration.
3830         (flag_ira_algorithm, flag_ira_verbose): New external variable
3831         declarations.
3832
3833         * postreload.c (gate_handle_postreload): Don't do post reload
3834         optimizations unless the reload is completed.
3835
3836         * reload.c (push_reload, find_dummy_reload): Use DF_LR_OUT for
3837         IRA.
3838
3839         * tree-pass.h (pass_ira): New external variable declaration.
3840
3841         * reload.h: Add 2008 to the Copyright.
3842
3843         * cfgloopanal.c: Include params.h.
3844         (estimate_reg_pressure_cost): Decrease cost for IRA optimization
3845         mode.
3846
3847         * params.h (IRA_MAX_LOOPS_NUM): New macro.
3848
3849         * toplev.c (ira.h): New include.
3850         (flag_ira_algorithm, flag_ira_verbose): New external variables.
3851         (backend_init_target): Call ira_init.
3852         (backend_init): Call ira_init_once.
3853         (finalize): Call finish_ira_once.
3854
3855         * toplev.h (flag_ira, flag_ira_coalesce, flag_ira_move_spills,
3856         flag_ira_share_save_slots, flag_ira_share_spill_slots): New
3857         external variables.
3858
3859         * regs.h (contains_reg_of_mode, move_cost, may_move_in_cost,
3860         may_move_out_cost): New external variable declarations.
3861         (move_table): New typedef.
3862
3863         * caller-save.c: Include headers output.h and ira.h.
3864         (no_caller_save_reg_set): New global variable.
3865         (save_slots_num, save_slots): New variables.
3866         (reg_save_code, reg_restore_code, add_stored_regs): Add
3867         prototypes.
3868         (init_caller_save): Set up no_caller_save_reg_set.
3869         (init_save_areas): Reset save_slots_num.
3870         (saved_hard_reg): New structure.
3871         (hard_reg_map, saved_regs_num, all_saved_regs): New variables.
3872         (initiate_saved_hard_regs, new_saved_hard_reg,
3873         finish_saved_hard_regs, saved_hard_reg_compare_func): New
3874         functions.
3875         (setup_save_areas): Add code for sharing stack slots.
3876         (all_blocks): New variable.
3877         (save_call_clobbered_regs): Process pseudo-register too.
3878         (mark_set_regs): Process pseudo-register too.
3879         (insert_one_insn): Put the insn after bb note in a empty basic
3880         block.  Add insn check.
3881
3882         * global.c (eliminable_regset): Make it external.
3883         (mark_elimination): Use DF_LR_IN for IRA.
3884         (pseudo_for_reload_consideration_p): New.
3885         (build_insn_chain): Make it external.  Don't ignore spilled
3886         pseudos for IRA.  Use pseudo_for_reload_consideration_p.
3887         (gate_handle_global_alloc): New function.
3888         (pass_global_alloc): Add the gate function.
3889
3890         * opts.c (decode_options): Set up flag_ira.  Print the warning for
3891         -fira.
3892         (common_handle_option): Process -fira-algorithm and -fira-verbose.
3893
3894         * timevar.def (TV_IRA, TV_RELOAD): New passes.
3895
3896         * regmove.c (regmove_optimize): Don't do replacement of output for
3897         IRA.
3898
3899         * hard-reg-set.h (no_caller_save_reg_set, reg_class_subclasses):
3900         New external variable declarations.
3901
3902         * local-alloc.c (update_equiv_regs): Make it external.  Return
3903         true if jump label rebuilding should be done.  Rescan new_insn for
3904         notes.
3905         (gate_handle_local_alloc): New function.
3906         (pass_local_alloc): Add the gate function.
3907
3908         * alias.c (value_addr_p, stack_addr_p): New functions.
3909         (nonoverlapping_memrefs_p): Use them for IRA.
3910
3911         * common.opt (fira, fira-algorithm, fira-coalesce,
3912         fira-move-spills, fira-share-save-slots, fira-share-spill-slots,
3913         fira-verbose): New options.
3914
3915         * regclass.c (reg_class_subclasses, contains_reg_of_mode,
3916         move_cost, may_move_in_cost, may_move_out_cost): Make the
3917         variables external.
3918         (move_table): Remove typedef.
3919         (init_move_cost): Make it external.
3920         (allocate_reg_info, resize_reg_info, setup_reg_classes): New
3921         functions.
3922
3923         * rtl.h (init_move_cost, allocate_reg_info, resize_reg_info,
3924         setup_reg_classes): New function prototypes.
3925         (eliminable_regset): New external variable declaration.
3926         (build_insn_chain, update_equiv_regs): New function prototypes.
3927
3928         * Makefile.in (IRA_INT_H): New definition.
3929         (OBJS-common): Add ira.o, ira-build.o, ira-costs.o,
3930         ira-conflicts.o, ira-color.o, ira-emit.o, and ira-lives.o.
3931         (reload1.o, toplev.o): Add dependence on ira.h.
3932         (cfgloopanal.o): Add PARAMS_H.
3933         (caller-save.o): Add dependence on output.h and ira.h.
3934         (ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o,
3935         ira-emit.o, ira-lives.o): New entries.
3936
3937         * passes.c (pass_ira): New pass.
3938
3939         * params.def (PARAM_IRA_MAX_LOOPS_NUM): New parameter.
3940
3941         * reload1.c (ira.h): Include the header.
3942         (changed_allocation_pseudos): New bitmap.
3943         (init_reload): Initiate the bitmap.
3944         (compute_use_by_pseudos): Permits spilled registers in FROM.
3945         (temp_pseudo_reg_arr): New variable.
3946         (reload): Allocate and free temp_pseudo_reg_arr.  Sort pseudos for
3947         IRA.  Call alter_reg with the additional parameter.  Don't clear
3948         spilled_pseudos for IRA.  Restore original insn chain for IRA.
3949         Clear changed_allocation_pseudos at the end of reload.
3950         (calculate_needs_all_insns): Call IRA's mark_memory_move_deletion.
3951         (hard_regno_to_pseudo_regno): New variable.
3952         (count_pseudo): Check spilled pseudos.  Set up
3953         hard_regno_to_pseudo_regno.
3954         (count_spilled_pseudo): Check spilled pseudos. Update
3955         hard_regno_to_pseudo_regno.
3956         (find_reg): Use better_spill_reload_regno_p.  Check
3957         hard_regno_to_pseudo_regno.
3958         (alter_reg): Set up spilled_pseudos.  Add a new parameter.  Add
3959         code for IRA.
3960         (eliminate_regs_1): Use additional parameter for alter_reg.