OSDN Git Service

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