OSDN Git Service

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