OSDN Git Service

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