OSDN Git Service

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