OSDN Git Service

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