OSDN Git Service

2012-12-15 Richard Guenther <rguenther@suse.de>
[pf3gnuchains/gcc-fork.git] / gcc / ChangeLog
1 2012-12-15  Richard Guenther  <rguenther@suse.de>
2
3         Revert
4         PR lto/48437
5         * lto-streamer-out.c (tree_is_indexable): Exclude block-local
6         extern declarations.
7
8         PR lto/48508
9         PR lto/48437
10         * tree-streamer-out.c (streamer_write_chain): Stream DECL_EXTERNAL
11         VAR_DECLs and FUNCTION_DECLs locally.
12
13 2011-12-14  Richard Henderson  <rth@redhat.com>
14
15         * config/arm/arm.md (*addsi3_compare0_scratch): Set predicable.
16         (*compare_negsi_si, *compare_addsi2_op0): Likewise.
17         (*compare_addsi2_op1, *zeroextractsi_compare0_scratch): Likewise.
18         (*compareqi_eq0, *arm_cmpsi_insn, *arm_cmpsi_negshiftsi_si): Likewise.
19
20 2011-12-14  Richard Guenther  <rguenther@suse.de>
21
22         * tree-cfg.c (replace_uses_by): Fixup TREE_CONSTANT for
23         propagating all kinds of constants.
24
25 2011-12-14  Richard Guenther  <rguenther@suse.de>
26
27         PR lto/51497
28         * lto-streamer-in.c (lto_read_body): Fixup local types
29         TYPE_CANONICAL and variant chain.
30
31 2011-12-14  Richard Guenther  <rguenther@suse.de>
32
33         * tree.c (free_lang_data_in_type): Do not clear fields
34         dependent on debuginfo level setting.
35         (find_decls_types_r): Use TYPE_STUB_DECL rathern than TREE_CHAIN.
36         * tree.h (TYPE_STUB_DECL): Properly check that we access a type.
37
38 2011-12-14  Georg-Johann Lay  <avr@gjlay.de>
39
40         PR target/50931
41         * config/avr/avr.md (mulpsi3): New expander.
42         (*umulqihipsi3, *umulhiqipsi3): New insns.
43         (*mulsqipsi3.libgcc, *mulpsi3.libgcc): New insns.
44         (mulsqipsi3, *mulpsi3): New insn-and-splits.
45         (ashlpsi3): Turn to expander.  Move insn code to...
46         (*ashlpsi3): ...this new insn.
47
48 2011-12-14  Richard Guenther  <rguenther@suse.de>
49
50         * tree-cfg.c (replace_uses_by): Only mark blocks altered
51         that will make a difference.  Only recompute ADDR_EXPR
52         invariantness if it could possibly have changed.  Do so
53         before folding the statement.
54
55 2011-12-13  Eric Botcazou  <ebotcazou@adacore.com>
56
57         * lto-streamer-out.c (write_symbol): Use proper 64-bit host type.
58         * lto-cgraph.c (input_cgraph_opt_section): Use 'int' for offsets.
59         * lto-streamer-in.c (lto_read_body): Likewise.
60         (lto_input_toplevel_asms): Likewise.
61         * lto-section-in.c (lto_create_simple_input_block): Likewise.
62         * ipa-inline-analysis.c (inline_read_section): Likewise.
63         * ipa-prop.c (ipa_prop_read_section): Likewise.
64
65         * df.h (DF_NOTE): Fix typo in comment.
66
67 2011-12-13  Aldy Hernandez  <aldyh@redhat.com>
68
69         * trans-mem.c (ipa_tm_create_version_alias): Set DECL_CONTEXT and
70         DECL_LANG_SPECIFIC.
71
72 2011-12-13  Andreas Krebbel  <Andreas.Krebbel@de.ibm.com>
73
74         * regmove.c (fixup_match_2): Only access call_used_regs with hard regs.
75
76 2011-12-13  Andrew Pinski  <apinski@cavium.com>
77             Adam Nemet  <anemet@caviumnetworks.com>
78
79         * config/mips/mips-cpus.def: Add Octeon2.
80         * config/mips/mips-tables.opt: Regenerate.
81         * config/mips/mips.md (define_attr "cpu"): Add Octeon2.
82         * config/mips/driver-native.c (host_detect_local_cpu): Support Octeon2.
83         * config/mips/octeon.md (octeon_arith): Add Octeon2.
84         (octeon_condmove): Likewise.
85         (octeon_load): Rename to ..
86         (octeon_load_o1): this.
87         (octeon_load_o2): New reserve.
88         (octeon_cop_o2): New reserve.
89         (octeon_store):  Match Octeon2 also.
90         (octeon_brj): Rename to ..
91         (octeon_brj_o1): this.
92         (octeon_brj_o2): New reserve.
93         (octeon_imul3): Rename to ...
94         (octeon_imul3_o1): this.
95         (octeon_imul3_o2): New reserve.
96         (octeon_imul): Rename to ...
97         (octeon_imul_o1): this.
98         (octeon_imul_o2): New reserve.
99         (octeon_mfhilo): Rename to ...
100         (octeon_mfhilo_o1): This.
101         (octeon_mfhilo_o2): New reserve.
102         (octeon_imadd): Rename to ...
103         (octeon_imadd_o1): this.
104         (octeon_imadd_o2): New reserve.
105         (octeon_idiv): Rename to ..
106         (octeon_idiv_o1): This.
107         (octeon_idiv_o2_si): New reserve.
108         (octeon_idiv_o2_di): Likewise.
109         (octeon_unknown): Match Octeon2 also.
110         * config/mips/mips.c (mips_rtx_cost_data): Add Octeon2 cost data.
111         (mips_issue_rate): Octeon2 can issue 2 at a time.
112         * config/mips/mips.h (TARGET_OCTEON): Match Octeon2 also.
113         (TARGET_OCTEON2): New define.
114         (TUNE_OCTEON): Match Octeon2 also.
115
116 2011-12-13  Richard Henderson  <rth@redhat.com>
117
118         * config/sparc/tso.h: New file.
119         * config.gcc (sparc-*-linux*, sparc*-*-solaris2*): Use it.
120         * config/sparc/sparc.c (sparc_option_override): Honor
121         SUBTARGET_DEFAULT_MEMORY_MODEL.
122         * config/sparc/sparc.h (SUBTARGET_DEFAULT_MEMORY_MODEL): New.
123
124 2011-12-13  Aldy Hernandez  <aldyh@redhat.com>
125
126         PR middle-end/51443
127         * trans-mem.c (struct diagnose_tm): Remove saw_unsafe.
128         (diagnose_tm_1): Same.
129         (ipa_tm_execute): Do not test tm_may_enter_irr before we set it.
130         (ipa_tm_scan_irr_function): Return gracefully when no
131         DECL_STRUCT_FUNCTION.
132         (ipa_tm_scan_irr_block): Believe the user on TM attributes.
133
134 2011-12-13  Martin Jambor  <mjambor@suse.cz>
135
136         PR middle-end/50628
137         * tree-sra.c (propagate_subaccesses_across_link): Do not propagate
138         sub-accesses of scalar accesses.
139
140 2011-12-13  Martin Jambor  <mjambor@suse.cz>
141
142         PR tree-optimization/51362
143         * ipa-cp.c (estimate_local_effects): When estimated size of a
144         specialized clone is zero, bump it to one.
145
146 2011-12-13  Richard Guenther  <rguenther@suse.de>
147
148         PR lto/48354
149         * tree.c (find_decls_types_r): Also walk DECL_ORIGINAL_TYPE.
150         * tree-streamer-in.c (lto_input_ts_decl_non_common_tree_pointers):
151         Stream DECL_ORIGINAL_TYPE.
152         * tree-streamer-out.c (write_ts_decl_non_common_tree_pointers):
153         Likewise.
154
155 2011-12-13  Jakub Jelinek  <jakub@redhat.com>
156
157         Revert
158         2011-12-12  Jakub Jelinek  <jakub@redhat.com>
159
160         PR tree-optimization/51481
161         * gimple-fold.c (gimple_fold_call): Call
162         maybe_clean_or_replace_eh_stmt.  Avoid optimization if stmt has EH
163         edges, but gimple_fold_builtin result can't throw.
164
165 2011-12-13  Jakub Jelinek  <jakub@redhat.com>
166             Michael Matz  <matz@suse.de>
167
168         PR tree-optimization/51117
169         * tree-eh.c (sink_clobbers): New function.
170         (execute_lower_eh_dispatch): Call it for BBs ending with
171         internally throwing RESX.
172         * cfgexpand.c (add_scope_conflicts_1): Add all conflicts only
173         at the first real instruction.
174
175 2011-12-13  Tristan Gingold  <gingold@adacore.com>
176
177         * final.c (final_scan_insn): Guard the call to begin_epilogue
178         debug hook.
179
180 2011-12-13  Tristan Gingold  <gingold@adacore.com>
181
182         * vmsdbgout.c (vmsdbgout_write_source_line): New function.
183         (vmsdbgout_end_prologue): Call vmsdbgout_write_source_line.
184         (vmsdbgout_begin_epilogue): Likewise.
185         (vmsdbgout_end_epilogue): Likewise.
186         (vmsdbgout_source_line): Move code to vmsdbgout_write_source_line.
187
188 2011-12-13  Richard Guenther  <rguenther@suse.de>
189
190         PR middle-end/51481
191         * tree-cfg.c (replace_uses_by): Pass proper arguments to
192         maybe_clean_or_replace_eh_stmt.
193
194 2011-12-13  Richard Guenther  <rguenther@suse.de>
195
196         PR tree-optimization/51519
197         * ipa-inline.c (edge_badness): Use edge growth in non-guessed
198         branch probability case as well.
199
200 2011-12-13  Revital Eres  <revital.eres@linaro.org>
201
202         * modulo-sched.c (mark_loop_unsched): Free bbs.
203
204 2011-12-12  Jakub Jelinek  <jakub@redhat.com>
205
206         PR rtl-optimization/51495
207         * function.c (thread_prologue_and_epilogue_insns): Don't add
208         to bb_tail basic blocks that have EDGE_COMPLEX predecessor edges
209         from basic blocks not needing prologue.
210
211         PR tree-optimization/51481
212         * gimple-fold.c (gimple_fold_call): Call
213         maybe_clean_or_replace_eh_stmt.  Avoid optimization if stmt has EH
214         edges, but gimple_fold_builtin result can't throw.
215
216 2011-12-12  Vladimir Makarov  <vmakarov@redhat.com>
217
218         PR rtl-optimization/21617
219         * ira-color.c (bucket_allocno_compare_func): Don't compare
220         allocno classes.  Compare number of hard registers needed.
221
222 2011-12-12  Eric Botcazou  <ebotcazou@adacore.com>
223
224         PR tree-optimization/50569
225         * tree-sra.c (build_ref_for_model): Replicate a chain of COMPONENT_REFs
226         in the expression of MODEL instead of just the last one.
227
228 2011-12-12  Jakub Jelinek  <jakub@redhat.com>
229
230         PR middle-end/51510
231         * calls.c (internal_arg_pointer_based_exp_scan): Don't use
232         VEC_safe_grow_cleared if idx is smaller than VEC_length.
233
234 2011-12-12  Richard Sandiford  <richard.sandiford@linaro.org>
235
236         PR middle-end/50873
237         * optabs.c (maybe_legitimize_operand_same_code): Use copy_to_mode_reg
238         instead of force_reg.  Do nothing if the address is already a
239         non-virtual pseudo register.
240
241 2011-12-12  Torvald Riegel  <triegel@redhat.com>
242
243         * gimplify.c (voidify_wrapper_expr): Add default handling for
244         outermost wrapper.
245
246 2011-12-12  Torvald Riegel  <triegel@redhat.com>
247
248         * tree-ssa-tail-merge.c (gimple_equal_p): Don't treat transaction
249         commits as equal.
250
251 2011-12-12  Iain Sandoe  <iains@gcc.gnu.org>
252
253         * config/darwin-sections.def (zobj_const_data_section): Fix over-
254         length section name.
255
256 2011-12-11  Richard Henderson  <rth@redhat.com>
257
258         * config/rs6000/rs6000.c (rs6000_expand_interleave): Use
259         BYTES_BIG_ENDIAN, not TARGET_BIG_ENDIAN.
260
261 2011-12-11  Jakub Jelinek  <jakub@redhat.com>
262
263         PR tree-optimization/51485
264         * tree-vect-data-refs.c (vect_analyze_data_refs): Give up on
265         DRs in call stmts.
266
267 2011-12-11  Patrick Marlier  <patrick.marlier@gmail.com>
268
269         * trans-mem.c (ipa_tm_transform_calls_redirect): Do not remove edge.
270
271 2011-12-10  Richard Henderson  <rth@redhat.com>
272
273         * config/rs6000/altivec.md (altivec_vmrghb): Rewrite pattern as
274         vec_select + vec_concat.
275         (altivec_vmrghh, altivec_vmrghw, altivec_vmrghsf, altivec_vmrglb,
276         altivec_vmrglh, altivec_vmrglw, altivec_vmrglsf): Likewise.
277         (vec_perm_constv16qi): New.
278         (vec_extract_evenv4si, vec_extract_evenv4sf, vpkuhum_nomode,
279         vpkuwum_nomode, vec_extract_oddv8hi, vec_extract_oddv16qi,
280         vec_interleave_high<VI>, vec_interleave_low<VI>): Remove.
281         * config/rs6000/paired.md (paired_merge00): Rewrite pattern as
282         vec_select + vec_concat.
283         (paired_merge10, paired_merge01, paired_merge11): Likewise.
284         (vec_perm_constv2sf): New.
285         (vec_interleave_highv2sf, vec_interleave_lowv2sf,
286         vec_extract_evenv2sf, vec_extract_oddv2sf): Remove.
287         * config/rs6000/spe.md (spe_evmergehi): Rewrite pattern as
288         vec_select + vec_concat.
289         (spe_evmergehilo, spe_evmergelo, spe_evmergelohi): New.
290         (vec_perm_constv2si): New.
291         * config/rs6000/vector.md (vec_interleave_highv4sf,
292         vec_interleave_lowv4sf, vec_interleave_high<VEC_64>,
293         vec_interleave_low<VEC_64>): Remove.
294         * config/rs6000/vsx.md (VS_double): New mode attribute.
295         (UNSPEC_VSX_XXPERMDI): Remove.
296         (vsx_xxpermdi_<VSX_L>_1): Rewrite pattern as vec_select + vec_concat.
297         (vsx_xxmrghw_<VSX_W>, vsx_xxmrglw_<VSX_W>): Likewise.
298         (vsx_xxpermdi_<VSX_L>): Change to expander.
299         (vec_perm_const<VSX_D>): New.
300         (vsx_mergel_<VSX_D>, vsx_mergeh_<VSX_D>): New.
301         * config/rs6000/predicates.md (const_0_to_1_operand): New.
302         (const_2_to_3_operand): New.
303         * config/rs6000/rs6000.c (TARGET_VECTORIZE_VEC_PERM_CONST_OK): New.
304         (altivec_expand_vec_perm_const): New.
305         (rs6000_expand_vec_perm_const_1, rs6000_expand_vec_perm_const): New.
306         (rs6000_vectorize_vec_perm_const_ok): New.
307         (rs6000_do_expand_vec_perm): New.
308         (rs6000_expand_extract_even, rs6000_expand_interleave): New.
309         * config/rs6000/rs6000-builtin.def (VEC_MERGE*): Update rtx codes.
310         * config/rs6000/rs6000-modes.def: Add double-wide vector modes.
311         * config/rs6000/rs6000-protos.h: Update.
312
313 2011-12-10  Richard Henderson  <rth@redhat.com>
314
315         * expr.c (expand_expr_real_2) [VEC_PERM_EXPR]: Avoid passing a
316         CONST_INT to expand_vec_perm as the selector.
317         * optabs.c (expand_vec_perm): Assert the selector is of a proper mode.
318
319 2011-12-10  Richard Henderson  <rth@redhat.com>
320
321         * genmodes.c (struct mode_data): Remove wider_2x member.
322         (blank_mode): Adjust initializer.
323         (calc_wider_mode): Use XALLOCAVEC.
324         (emit_move_wider): Select double-width same-element vectors for
325         2xwider vectors.
326         * machmode.h (GET_MODE_2XWIDER_MODE): Update documentation.
327         * config/i386/i386.c (doublesize_vector_mode): Remove.
328         (expand_vselect_vconcat): Use GET_MODE_2XWIDER_MODE instead.
329
330 2011-12-10  Joern Rennecke  <joern.rennecke@embecosm.com>
331
332         * config/epiphany/epiphany.h (USE_LOAD_POST_INCREMENT): Define.
333         (USE_LOAD_POST_DECREMENT, USE_STORE_POST_INCREMENT): Likewise.
334         (USE_STORE_POST_DECREMENT): Likewise.
335
336         * config/epiphany/epiphany.h (EPIPHANY_RETURN_REGNO): New macro,
337         broken out of ..
338         (INCOMING_RETURN_ADDR_RTX) .. this.  Use EPIPHANY_RETURN_REGNO.
339         (DWARF_FRAME_RETURN_COLUMN): New macro.
340
341         * config/epiphany/epiphany-protos.h (epiphany_start_function): Declare.
342         * config/epiphany/epiphany.c (epiphany_handle_interrupt_attribute):
343         Split "timer" value into "timer0" and "timer1".
344         Handle page_miss, message and wand.  Don't handle static_flag.
345         Adjust warning text.
346         (epiphany_start_function): New function.
347         (epiphany_compute_function_type): Split "timer" value into "timer0"
348         and "timer1".  Handle page_miss, message and wand.
349         Don't handle static_flag.
350         (epiphany_expand_epilogue): Don't use frame_insn for status / iret
351         restore.
352         * config/epiphany/epiphany.h: ASM_DECLARE_FUNCTION_NAME: Define.
353         (enum epiphany_function_type):
354         Split EPIPHANY_FUNCTION_TIMER value into EPIPHANY_FUNCTION_TIMER0
355         and EPIPHANY_FUNCTION_TIMER1.
356         Remove EPIPHANY_FUNCTION_ILINK1 and EPIPHANY_FUNCTION_ILINK2 values.
357         Add EPIPHANY_FUNCTION_PAGE_MISS and EPIPHANY_FUNCTION_MESSAGE values.
358         Rename EPIPHANY_FUNCTION_STATIC_FLAG to EPIPHANY_FUNCTION_WAND.
359
360 2011-12-10  Nathan Sidwell  <nathan@acm.org>
361
362         PR gcov-profile/51449
363         * coverage.c (coverage_end_function): Always process the coverage
364         variables.
365
366 2011-12-09  Aldy Hernandez  <aldyh@redhat.com>
367
368         PR/51291
369         * tree.c (build_common_builtin_nodes): Do not use TM_PURE
370         attribute unless language has support for TM.
371         * config/i386/i386.c (ix86_init_tm_builtins): Exit gracefully in
372         the absence of TM builtins.
373
374 2011-12-09  Eric Botcazou  <ebotcazou@adacore.com>
375
376         * gimple-fold.c (gimple_fold_stmt_to_constant_1) <GIMPLE_UNARY_RHS>:
377         Also check the TYPE_MODE to recognize useless pointer conversions.
378
379 2011-12-09  Jakub Jelinek  <jakub@redhat.com>
380
381         PR tree-optimization/51117
382         * tree-eh.c (optimize_clobbers): Don't remove just one
383         clobber, but all consecutive clobbers before RESX.
384         Use gimple_clobber_p predicate.
385
386 2011-12-09  Michael Meissner  <meissner@the-meissners.org>
387
388         * config/rs6000/rs6000.c (altivec_expand_builtin): Call
389         expand_call to return a valid funciton instead of return
390         cosnt0_rtx/NULL_RTX if there was an error with the builtin.
391         (altivec_expand_ld_builtin): Ditto.
392         (rs6000_inner_target_options): If VSX is selected as a target
393         attribute or pragma, enable ALTIVEC also.
394         (rs6000_pragma_target_parse): Call rs6000_option_override_internal
395         to do all of the standard processing when switching options,
396         including redefining appropriate macros.
397
398         PR rtl-optimization/51469
399         * varasm.c (default_binds_local_p_1): If the symbol is a gnu
400         indirect function, mark the symbol as non-local.
401
402 2011-12-09  H.J. Lu  <hongjiu.lu@intel.com>
403
404         PR bootstrap/51479
405         * Makefile.in (errors.o): Restored.
406
407 2011-12-09  Richard Guenther  <rguenther@suse.de>
408
409         PR lto/48042
410         * tree.c (free_lang_data_in_decl): Remove freeing conditional
411         on debuginfo level.
412
413 2011-12-09  Joern Rennecke  <joern.rennecke@embecosm.com>
414
415         PR middle-end/40154
416         * emit-rtl.c (set_dst_reg_note): New function.
417         * rtl.h (set_dst_reg_note): Declare.
418         * optabs.c (expand_binop, expand_absneg_bit): Use set_dst_reg_note.
419         (emit_libcall_block, expand_fix): Likewise.
420         * function.c (assign_parm_setup_reg, expand_function_start): Likewise.
421         * expmed.c (expand_mult_const, expand_divmod): Likewise.
422         * reload1.c (gen_reload): Likewise.
423
424         * dse.c (get_stored_val, get_call_args): Use gen_int_mode.
425         * expmed.c (expand_divmod): Likewise.
426         * combine.c (simplify_if_then_else): Likewise.
427
428 2011-12-09  Kai Tietz  <ktietz@redhat.com>
429
430         * ira-color.c (print_hard_regs_subforest): Use
431         HOST_WIDEST_INT_PRINT_DEC instead of %lld.
432         (allocno_hard_regs): Change type of cost member to HOST_WIDEST_INT.
433         (add_allocno_hard_regs): Change type of argument cost
434         to HOST_WIDEST_INT.
435         * ira-conflict.c (build_conflict_bit_table): Replace use
436         of long-long by HOST_WIDEST_INT.
437
438 2011-12-09  Georg-Johann Lay  <avr@gjlay.de>
439
440         PR target/51425
441         * config/avr/avr.md (config/avr/avr.md, *sbix_branch_tmp): Use
442         zero_extract:QIHI instead of zero_extract:HI.
443
444 2011-12-09  Jakub Jelinek  <jakub@redhat.com>
445             Andrew Pinski  <apinski@cavium.com>
446
447         PR tree-optimization/51117
448         * tree-eh.c (optimize_clobbers): New function.
449         (execute_lower_eh_dispatch): Call it.
450
451 2011-12-09  Richard Guenther  <rguenther@suse.de>
452
453         PR tree-optimization/51482
454         * tree-vect-stmts.c (get_vectype_for_scalar_type_and_size):
455         Make sure to only create REAL_TYPE and INTEGER_TYPE component vectors.
456
457 2011-12-09  Kai Tietz  <ktietz@redhat.com>
458
459         * implicit-zee.c (num_realized): Change type to long.
460         (num_ze_opportunities): Likewise.
461
462 2011-12-08  Andrew Pinski  <apinski@cavium.com>
463
464         * config/mips/mips-cpus.def (octeon+): New CPU.
465         * config/mips/mips-tables.opt: Regenerate.
466         * config/mips/mips.h (MIPS_CPP_SET_PROCESSOR): Emit '+' as 'P'.
467
468 2011-12-08  Bill Schmidt  <wschmidt@linux.vnet.ibm.com>
469
470         PR middle-end/39976
471         * tree-ssa-dom.c (enum expr_kind): Add EXPR_PHI.
472         (struct hashable_expr): Add struct phi field.
473         (initialize_hash_element): Handle phis; change to use XCNEWVEC.
474         (hashable_expr_equal_p): Handle phis.
475         (iterative_hash_hashable_expr): Likewise.
476         (print_expr_hash_elt): Likewise.
477         (free_expr_hash_elt): Likewise.
478         (dom_opt_enter_block): Create equivalences from redundant phis.
479         (eliminate_redundant_computations): Handle redundant phis.
480         (lookup_avail_expr): Handle phis.
481
482 2011-12-08  Jakub Jelinek  <jakub@redhat.com>
483
484         PR tree-optimization/51466
485         * tree-ssa-forwprop.c (forward_propagate_addr_expr_1): Also copy
486         TREE_SIDE_EFFECTS.
487
488 2011-12-08  Richard Guenther  <rguenther@suse.de>
489
490         * tree-ssa-operands.c (add_stmt_operand): Do not mark stmts
491         volatile when processing operands of an ADDR_EXPR.
492         (get_indirect_ref_operands): Likewise.
493         (get_tmr_operands): Likewise.
494         (get_expr_operands): Likewise.
495
496 2011-12-08  Andreas Krebbel  <Andreas.Krebbel@de.ibm.com>
497
498         PR target/50395
499         * config/s390/s390.c (s390_mainpool_finish): Emit the jump over
500         the literal pool as jump insn.
501
502 2011-12-08  Richard Guenther  <rguenther@suse.de>
503
504         PR tree-optimization/49772
505         * tree-inline.c (optimize_inline_calls): Remove bail out on errors.
506
507 2011-12-08  Richard Guenther  <rguenther@suse.de>
508
509         PR lto/50747
510         * lto-streamer-out.c (produce_symtab): Remove asserts.
511
512 2011-12-08  Richard Guenther  <rguenther@suse.de>
513
514         PR lto/49945
515         * lto-streamer-out.c (tree_is_indexable): Localize variably
516         modified types and their FIELD_DECLs.
517
518 2011-12-08  Eric Botcazou  <ebotcazou@adacore.com>
519
520         PR tree-optimization/51315
521         * tree.h (get_object_or_type_alignment): Declare.
522         * expr.c (get_object_or_type_alignment): Move to...
523         * builtins.c (get_object_or_type_alignment): ...here.  Add assertion.
524         * tree-sra.c (tree_non_mode_aligned_mem_p): Rename to...
525         (tree_non_aligned_mem_p): ...this.  Add ALIGN parameter.  Look into
526         MEM_REFs and use get_object_or_type_alignment for them.
527         (build_accesses_from_assign): Adjust for above change.
528         (access_precludes_ipa_sra_p): Likewise.
529
530 2011-12-08  Richard Guenther  <rguenther@suse.de>
531
532         PR lto/48437
533         * lto-streamer-out.c (tree_is_indexable): Exclude block-local
534         extern declarations.
535
536 2011-12-07  Andrew Pinski  <apinski@cavium.com>
537
538         PR middle-end/45416
539         * expr.c (do_store_flag): Rewrite code that looks for BIT_AND_EXPR for
540         SSA-expand.
541
542 2011-12-07  Richard Guenther  <rguenther@suse.de>
543
544         PR tree-optimization/50823
545         * ipa-inline.c (edge_badness): Do not account for the number of
546         remaining calls.
547
548 2011-12-07  Martin Jambor  <mjambor@suse.cz>
549
550         PR tree-optimization/50744
551         * ipa-cp.c (good_cloning_opportunity_p): Assert size_cost is positive,
552         compute evaluation in HOST_WIDEST_INT.
553         (safe_add): New function
554         (propagate_effects): Use safe_add to accumulate effects.
555
556 2011-12-06  Joel Sherrill <joel.sherrill@oarcorp.com>
557
558         * config/rs6000/rtems.h: Switch to using global_options_set
559         in SUBSUBTARGET_OVERRIDE_OPTIONS.
560
561 2011-12-06  David S. Miller  <davem@davemloft.net>
562
563         * config/sparc/visintrin.h: Add appropriate __VIS__ cpp protection.
564
565 2011-12-06  Georg-Johann Lay  <avr@gjlay.de>
566
567         * config/avr/avr.c (avr_file_start): Fix missing ,
568
569 2011-12-06  Jakub Jelinek  <jakub@redhat.com>
570
571         PR target/51354
572         * config/i386/i386.c (ix86_emit_leave): Call ix86_add_cfa_restore_note
573         unconditionally.
574
575 2011-12-06  Georg-Johann Lay  <avr@gjlay.de>
576
577         Forward-port from gcc-4_6-branch r181936 2011-12-02.
578         * config/avr/avr-mcus.def (avr_mcu_types): ATtiny4313 and
579         AT86RF401 have a 16-bit SP (their manual is bogus).
580
581 2011-12-06  Georg-Johann Lay  <avr@gjlay.de>
582
583         Forward-port from gcc-4_6-branch r181936 2011-12-02.
584
585         PR target/51002
586         * config/avr/avr.md (movhi_sp_r): Set insn condition to
587         !AVR_HAVE_8BIT_SP.
588         * config/avr/avr.c (output_movhi): Use "clr%B0" instead of "in
589         %B0,__SP_H__" if AVR_HAVE_8BIT_SP.
590         (avr_file_start): Only print "__SP_H__ = 0x3e" if !AVR_HAVE_8BIT_SP.
591
592 2011-12-06  Georg-Johann Lay  <avr@gjlay.de>
593
594         PR target/51409
595         PR target/49868
596         * config/avr/avr.h (ADDR_SPACE_PGM, ADDR_SPACE_PGM1,
597         ADDR_SPACE_PGM2, ADDR_SPACE_PGM3, ADDR_SPACE_PGM4,
598         ADDR_SPACE_PGM5, ADDR_SPACE_PGMX): Write as enum.
599         (avr_addrspace_t): New typedef.
600         (avr_addrspace): New declaration.
601         * config/avr/avr-c.c (avr_toupper): New static function.
602         (avr_register_target_pragmas, avr_cpu_cpp_builtins): Use
603         avr_addrspace to get address space information.
604         * config/avr/avr.c (avr_addrspace): New variable.
605         (avr_out_lpm, avr_pgm_check_var_decl, avr_insert_attributes,
606         avr_asm_named_section, avr_section_type_flags,
607         avr_asm_select_section, avr_addr_space_address_mode,
608         avr_addr_space_convert, avr_emit_movmemhi): Use it.
609         (avr_addr_space_pointer_mode): Forward to avr_addr_space_address_mode.
610         (avr_pgm_segment): Remove.
611
612 2011-12-06  Richard Guenther  <rguenther@suse.de>
613
614         PR middle-end/50601
615         * varasm.c (assemble_alias): Move DECL_EXTERNAL implementation
616         quirk adjustjment ...
617         * passes.c (rest_of_decl_compilation): ... here.
618
619 2011-12-06  Richard Guenther  <rguenther@suse.de>
620
621         PR middle-end/51436
622         * gimple-fold.c (gimplify_and_update_call_from_tree): Guard vdef check
623         for the fact we do not have virtual operands when not optimizing.
624
625 2011-12-06  Richard Guenther  <rguenther@suse.de>
626
627         PR tree-optimization/51245
628         * tree-ssa-sccvn.c (vn_reference_lookup_or_insert_constant_for_pieces):
629         New function.
630         (vn_reference_lookup_3): Use it.  Properly valueize all refs we create.
631
632 2011-12-06  Iain Sandoe  <iains@gcc.gnu.org>
633
634         * config/rs6000/rs6000.c (darwin_rs6000_override_options): Initialize
635         rs6000_current_abi.
636
637 2011-12-06  Richard Guenther  <rguenther@suse.de>
638
639         PR tree-optimization/51363
640         * gimple.c (gimple_rhs_has_side_effects): Remove.
641         * gimple.h (gimple_rhs_has_side_effects): Likewise.
642         * tree-ssa-dom.c (optimize_stmt): Simplify conditional.
643
644 2011-12-06  Alan Modra  <amodra@gmail.com>
645
646         PR target/50906
647         * config/rs6000/rs6000.c (rs6000_emit_prologue <TARGET_SPE_ABI>):
648         Do not mark r11 setup as frame-related.  Pass correct offset to
649         rs6000_emit_savres_rtx.  Correct out-of-line rs6000_frame_related
650         arguments.  Correct sp_offset.  Remove "offset" fudge from
651         in-line rs6000_frame_related call.  Rename misleading variable.
652         Fix comments and whitespace.  Tidy some expressions.
653         (rs6000_emit_epilogue <TARGET_SPE_ABI>): Always set frame_reg_rtx
654         to r11 in out-of-line case.  Correct sp_offset.  Pass correct
655         offset to rs6000_emit_savres_rtx.  Rename misleading variable.
656         Fix comments and whitespace.  Tidy some expressions.
657         (rs6000_emit_epilogue <non-TARGET_SPE_ABI>): Add sp_offset
658         adjustment when !saving_GPRs_inline.  Correct register mode
659         used in address calcs.
660         (rs6000_emit_epilogue <non-TARGET_SPE_ABI>): Similarly when
661         !restoring_GPRs_inline.
662
663 2011-12-06  Ramana Radhakrishnan  <ramana.radhakrishnan@linaro.org>
664
665         * config/arm/vfp.md (*combine_vcvt_f64_<FCVTI32typename>): Fix
666         formatting character for vmov.f64 case.
667
668 2011-12-05  Jakub Jelinek  <jakub@redhat.com>
669
670         PR tree-optimization/51396
671         * tree-ssa-math-opts.c (convert_mult_to_fma): Don't optimize
672         if MUL_RESULT has zero uses.
673
674         PR debug/51410
675         * c-decl.c (pop_scope): Don't add DECL_EXTERNAL decls
676         for debug info if scope is file_scope.
677
678         PR c/51339
679         * c-decl.c (c_finish_incomplete_decl, finish_decl): Call
680         relayout_decl instead of layout_decl.
681
682 2011-12-05  Richard Sandiford  <rdsandiford@googlemail.com>
683
684         * resource.c (init_resource_info): Only consider EXIT_IGNORE_STACK
685         if there is in epilogue.
686
687 2011-12-05  Richard Sandiford  <rdsandiford@googlemail.com>
688
689         * optabs.c (maybe_emit_sync_lock_test_and_set): Pass a null target
690         to emit_library_call_value.
691         (expand_atomic_compare_and_swap): Likewise.
692
693 2011-12-05  Vladimir Makarov  <vmakarov@redhat.com>
694
695         PR other/50775
696         * ira-int.h (struct ira_object): Remove add_data.
697         (OBJECT_ADD_DATA): Remove.
698
699         * ira-build.c (ira_create_object): Remove OBJECT_ADD_DATA
700         initialization.
701
702         * ira-color.c (object_hard_regs_t, object_hard_regs): Rename to
703         allocno_hard_regs_t, allocno_hard_regs.
704         (object_hard_regs_node_t, object_hard_regs_node): Rename to
705         allocno_hard_regs_node_t and allocno_hard_regs_node.
706         (struct allocno_color_data): Add new member last_process.  Move
707         profitable_hard_regs, hard_regs_node, and hard_regs_subnodes_start
708         from object_color_data.
709         (object_color_data_t, object_color_data, OBJECT_COLOR_DATA): Remove.
710         (curr_allocno_process): New static variable.
711         (object_hard_regs_eq, object_hard_regs_htab): Rename to
712         allocno_hard_regs_eq and allocno_hard_regs_htab.
713         (init_object_hard_regs, finish_object_hard_regs): Rename to
714         init_allocno_hard_regs and finish_allocno_hard_regs.
715         (object_hard_regs_compare, object_hard_regs_node_t): Rename to
716         allocno_hard_regs_compare and allocno_hard_regs_node_t.
717         (create_new_object_hard_regs_node): Rename to
718         create_new_allocno_hard_regs_node.
719         (add_new_object_hard_regs_node_to_forest): Rename to
720         add_new_allocno_hard_regs_node_to_forest.
721         (add_object_hard_regs_to_forest, collect_object_hard_regs_cover):
722         Rename to add_allocno_hard_regs_to_forest and
723         collect_allocno_hard_regs_cover.
724         (setup_object_hard_regs_nodes_parent): Rename to
725         setup_allocno_hard_regs_nodes_parent.
726         (remove_unused_object_hard_regs_nodes): Rename to
727         remove_unused_allocno_hard_regs_nodes.
728         (enumerate_object_hard_regs_nodes, object_hard_regs_nodes_num):
729         Rename to enumerate_allocno_hard_regs_nodes and
730         allocno_hard_regs_nodes_num.
731         (object_hard_regs_nodes, object_hard_regs_subnode_t): Rename to
732         allocno_hard_regs_nodes and allocno_hard_regs_subnode_t.
733         (object_hard_regs_subnode, object_hard_regs_subnodes): Rename to
734         allocno_hard_regs_subnode and allocno_hard_regs_subnodes.
735         (object_hard_regs_subnode_index): Rename to
736         allocno_hard_regs_subnode_index.
737         (setup_object_hard_regs_subnode_index): Rename to
738         setup_allocno_hard_regs_subnode_index.
739         (get_object_hard_regs_subnodes_num): Rename to
740         get_allocno_hard_regs_subnodes_num.
741         (form_object_hard_regs_nodes_forest): Rename to
742         form_allocno_hard_regs_nodes_forest.
743         (finish_object_hard_regs_nodes_tree): Rename to
744         form_allocno_hard_regs_nodes_forest
745         (finish_object_hard_regs_nodes_forest): Rename to
746         finish_allocno_hard_regs_nodes_forest.
747         (setup_left_conflict_sizes_p): Use allocno data instead of object ones.
748         Process conflict allocnos once.
749         (update_left_conflict_sizes_p): Use allocno data instead of object
750         ones.  Change prototype signature.
751         (empty_profitable_hard_regs): Use allocno data instead of object ones.
752         (setup_profitable_hard_regs): Ditto.
753         (get_conflict_profitable_regs): Rename to
754         get_conflict_and_start_profitable_regs.  Use allocno data for
755         profitable regs calculation.
756         (check_hard_reg_p): Change prototype signature.  Check profitable
757         regs for allocno not the objects.
758         (assign_hard_reg): Process conflict allocnos only once for
759         updating conflict costs.
760         (setup_allocno_available_regs_num): Use allocno data instead of
761         object ones.  Modify debug output.
762         (color_pass): Remove initialization and finalization of object
763         color data.
764
765 2011-12-05  Kazu Hirata  <kazu@codesourcery.com>
766
767         PR target/51408
768         * config/arm/arm.md (*minmax_arithsi): Always require the else
769         clause in the MINUS case.
770
771 2011-12-05  Richard Guenther  <rguenther@suse.de>
772
773         PR tree-optimization/50904
774         * tree-ssa-loop-im.c (struct mem_ref): Remove vops member.
775         (MEM_ANALYZABLE): New.
776         (memory_references): Remove clobbered_vops and vop_ref_map
777         members, add all_refs_stored_in_loop member.
778         (memref_free): Adjust.
779         (mem_ref_alloc): Likewise.
780         (gather_mem_refs_stmt): Do not record clobbers, instead
781         record refs for unanalyzable stmts.
782         (gather_mem_refs_in_loops): Do not propagate clobbers.
783         (struct vop_to_refs_elt, vtoe_hash, vtoe_eq, vtoe_free,
784         record_vop_access, get_vop_accesses, get_vop_stores,
785         add_vop_ref_mapping): Remove.
786         (create_vop_ref_mapping_loop): Adjust to simply record all stores.
787         (analyze_memory_references): Adjust.
788         (refs_independent_p): Check for not analyzable refs.
789         (can_sm_ref_p): Likewise.
790         (ref_indep_loop_p_1): Simplify.
791         (tree_ssa_lim_finalize): Adjust.
792
793         * tree-ssa-loop-im.c (stmt_cost): Simplify, use LIM_EXPENSIVE
794         rather than magic constants.  Assign zero cost to PAREN_EXPR
795         and SSA_NAME copies.  Assign cost proportional to the vector
796         size for vector constructors.
797
798 2011-12-05  Richard Guenther  <rguenther@suse.de>
799
800         * tree-ssa-alias.h (struct ao_ref_s): Add volatile_p field.
801         * tree-ssa-alias.c (ao_ref_init): Initialize it.
802         (ao_ref_init_from_ptr_and_size): Likewise.
803         (refs_may_alias_p_1): Two volatile accesses conflict.
804         (ref_maybe_used_by_call_p_1): Likewise.
805         (call_may_clobber_ref_p_1): Likewise.
806         * tree-ssa-sccvn.c (ao_ref_init_from_vn_reference): Initialize
807         volatile_p field.
808
809 2011-12-05  Richard Guenther  <rguenther@suse.de>
810
811         * tree-ssa.c (verify_ssa): Verify SSA names in the loop over all SSA
812         names.  Remove SSA operand checking, call verify_ssa_operands.
813         * tree-ssa-operands.h (verify_ssa_operands): Declare.
814         * tree-ssa-operands.c (verify_ssa_operands): New function.
815
816 2011-12-05  Ramana Radhakrishnan  <ramana.radhakrishnan@linaro.org>
817
818         * config/arm/arm.c (vfp3_const_double_for_fract_bits): Define.
819         * config/arm/arm-protos.h (vfp3_const_double_for_fract_bits): Declare.
820         * config/arm/constraints.md ("Dt"): New constraint.
821         * config/arm/predicates.md
822         (const_double_vcvt_power_of_two_reciprocal): New.
823         * config/arm/vfp.md (FCVTI32typename): New.
824         (FCVT): New iterator.
825         (*combine_vcvt_f32_<FCVTI32typename>): New.
826         (*combine_vcvt_f64_<FCVTI32typename>): New.
827
828 2011-12-05  Richard Guenther  <rguenther@suse.de>
829
830         * cgraph.c (cgraph_create_edge_1): Initialize
831         call_stmt_cannot_inline_p from the stmt if possible.
832         (cgraph_make_edge_direct): Likewise.
833         * gimple-streamer-in.c (input_gimple_stmt): Do not
834         call gimple_call_set_cannot_inline.
835         * gimple.h (enum gf_mask): Remove GF_CALL_CANNOT_INLINE, shift values.
836         (gimple_call_set_cannot_inline): Remove.
837         (gimple_call_cannot_inline_p): Likewise.
838         * ipa-inline-analysis.c (initialize_inline_failed): Look
839         at the edge call_stmt_cannot_inline_p flag.
840         * ipa-inline.c (can_inline_edge_p): Likewise.
841         (early_inliner): Only update the edge flag.
842         * ipa-prop.c (update_indirect_edges_after_inlining): Likewise.
843         (ipa_modify_call_arguments): Do not call gimple_call_set_cannot_inline.
844         * cgraphunit.c (assemble_thunk): Likewise.
845         * gimple-fold.c (gimple_fold_call): Likewise.
846
847         * tree.h (CALL_CANNOT_INLINE_P): Remove.
848         * tree-mudflap.c (mf_xform_statements): Do not modify alloca calls.
849         * builtins.c (expand_builtin_alloca): With -fmudflap do not expand
850         alloca calls inline.
851         * cfgexpand.c (expand_call_stmt): Do not set CALL_CANNOT_INLINE_P.
852         * gimple.c (gimple_build_call_from_tree): Do not read
853         CALL_CANNOT_INLINE_P.
854         * gimplify.c (gimplify_call_expr): Do not copy CALL_CANNOT_INLINE_P.
855
856 2011-12-05  Jakub Jelinek  <jakub@redhat.com>
857             Eric Botcazou  <ebotcazou@adacore.com>
858
859         PR middle-end/51323
860         PR middle-end/50074
861         * calls.c (internal_arg_pointer_exp_state): New variable.
862         (internal_arg_pointer_based_exp_1,
863         internal_arg_pointer_exp_scan): New functions.
864         (internal_arg_pointer_based_exp): New function.
865         (mem_overlaps_already_clobbered_arg_p): Use it.
866         (expand_call): Free internal_arg_pointer_exp_state.cache vector
867         and clear internal_arg_pointer_exp_state.scan_start.
868
869 2011-12-04  Kaz Kojima  <kkojima@gcc.gnu.org>
870
871         * config/sh/linux.h (TARGET_DEFAULT): Add MASK_SOFT_ATOMIC.
872         * config/sh/sync.md: New file.
873         * config/sh/sh.md: Include sync.md.
874         * config/sh/sh.opt (msoft-atomic): New option.
875         * doc/invoke.texi (SH Options): Document it.
876
877 2011-12-04  Nathan Sidwell  <nathan@acm.org>
878
879         * gcov-io.h (struct gcov_info): Replace trailing array with
880         pointer to array.
881         * profile.c (branch_prob): Only call renamed
882         coverage_begin_function once.
883         * coverage.h (coverage_begin_output): Rename to ...
884         (coverage_begin_function): ... here.
885         * coverage.c (struct function_list): Rename to ...
886         (struct coverage_data): ... this.  Update all uses.
887         (gcov_info_var, gcov_fn_info_type, gcov_fn_info_ptr_type): New globals.
888         (bbg_file_opened, bbg_function_announced): Remove.
889         (get_coverage_counts): Adjust message.
890         (coverage_begin_ouput): Rename to ...
891         (coverage_begin_function): ... here.  Move file opening to
892         coverage_init.  Adjust for being called only once.
893         (coverage_end_function): Remove bbg file and inhibit further
894         output here on error.
895         (build_info_type): Adjust for change to pointer to array.
896         (build_info): Receive array of function pointers and adjust.
897         (create_coverage): Break into ...
898         (coverage_obj_init, coverage_obj_fn, coverage_obj_finish):
899         ... these, and adjust.
900         (coverage_init): Open the notes file here.  Tidy.
901         (coverage_finish): Call coverage_obj_init etc.
902
903 2011-12-04  Ira Rosen  <ira.rosen@linaro.org>
904
905         PR middle-end/51285
906         * tree-vect-loop.c (vect_create_epilog_for_reduction): Create exit
907         phi nodes for outer loop in case of double reduction.
908
909 2011-12-04  Jérémie Detrey  <Jeremie.Detrey@loria.fr>
910
911         PR target/51393
912         * config/i386/avxintrin.h (_mm256_insert_epi64): Declare second
913         parameter as long long.
914
915 2011-12-04  Richard Sandiford  <rdsandiford@googlemail.com>
916
917         PR middle-end/51351
918         * optabs.c (init_sync_libfuncs): Use "or" rather than "ior"
919         in the external names.
920
921 2011-12-03  Jack Howarth <howarth@bromo.med.uc.edu>
922
923         * config/darwin10.h (LINK_GCC_C_SEQUENCE_SPEC): Pass -no_pie for
924         non-PIC code when targeting 10.7 or later.
925
926 2011-12-03  Iain Sandoe  <iains@gcc.gnu.org>
927
928         * config/darwin.h (STARTFILE_SPEC): Do not use -lbundle1.o when
929         Darwin >= 10.
930         (DARWIN_DYLIB1_SPEC): Do not use -ldylib1.10.5.o when Darwin >= 10.
931         (DARWIN_CRT1_SPEC): Use -lcrt1.10.6.o when Darwin >= 10.
932
933 2011-12-03  Jakub Jelinek  <jakub@redhat.com>
934
935         * fold-const.c (fold_unary_loc): Fold VEC_UNPACK_LO_EXPR,
936         VEC_UNPACK_HI_EXPR, VEC_UNPACK_FLOAT_LO_EXPR and
937         VEC_UNPACK_FLOAT_HI_EXPR with VECTOR_CST argument.
938         (fold_binary_loc): Fold VEC_PACK_TRUNC_EXPR,
939         VEC_PACK_FIX_TRUNC_EXPR, VEC_WIDEN_MULT_LO_EXPR
940         and VEC_WIDEN_MULT_HI_EXPR with VECTOR_CST arguments.
941
942         PR debug/50317
943         * tree-ssa.c (target_for_debug_bind): Also allow is_gimple_reg_type
944         vars that aren't referenced.
945         (tree-ssa-live.c (remove_unused_locals): Don't clear TREE_ADDRESSABLE
946         of unreferenced local vars.
947         * cfgexpand.c (expand_debug_expr): For DEBUG_IMPLICIT_PTR allow also
948         TREE_ADDRESSABLE vars that satisfy target_for_debug_bind.
949
950 2011-12-03  Anatoly Sokolov  <aesok@post.ru>
951
952         * config/arm/arm.h (LIBCALL_VALUE, FUNCTION_VALUE_REGNO_P): Remove.
953         * config/arm/arm-protos.h (aapcs_libcall_value): Remove.
954         * config/arm/arm.c (TARGET_FUNCTION_VALUE_REGNO_P): Define.
955         (arm_libcall_value_1, arm_function_value_regno_p): New function.
956         (arm_function_value, arm_libcall_value): Use arm_libcall_value_1.
957         (aapcs_libcall_value): Make static.
958         (arm_libcall_value): Add static qualifier.
959
960 2011-12-02  Jakub Jelinek  <jakub@redhat.com>
961
962         PR target/51387
963         * config/i386/sse.md (mul<mode>3 with VI1_AVX2 iterator): For
964         V32QImode use { 0,2,..,14,32,34,..,46,16,18,..,30,48,50,..,62 }
965         permutation instead of extract even permutation.
966
967 2011-12-02  Nathan Sidwell  <nathan@acm.org>
968
969         * gcov.c (struct arc_info): Add is_throw field.
970         (struct (block_info): Add exceptional field, reduce flags size to
971         account for it.
972         (struct function_info): Add has_catch field.
973         (struct line_info): Add unexceptional field.
974         (process_file): Call find_exception_blocks if necessary.
975         (read_graph_file): Adjust.  Note if an exceptional edge is seen.
976         (find_exception_blocks): New.
977         (add_line_counts): Set line's unexceptional flag if not exceptional.
978         (output_branch_count): Note exceptional arcs, lines and blocks.
979         * gcov-dump.c (tag_arcs): Decode arc flags.
980         * doc/gcov.texi: Document '=====' lines.
981
982 2011-12-02  Anatoly Sokolov  <aesok@post.ru>
983
984         * config/ia64/ia64.h (PRINT_OPERAND, PRINT_OPERAND_ADDRESS,
985         PRINT_OPERAND_PUNCT_VALID_P): Remove macros.
986         * config/ia64/ia64-protos.h (ia64_print_operand,
987         ia64_print_operand_address): Remove.
988         * config/ia64/ia64.c (TARGET_PRINT_OPERAND,
989         TARGET_PRINT_OPERAND_ADDRESS, TARGET_PRINT_OPERAND_PUNCT_VALID_P):
990         Define.
991         (ia64_print_operand_punct_valid_p): New function.
992         (ia64_print_operand, ia64_print_operand_address): Make static.
993
994 2011-12-02  Michael Meissner  <meissner@the-meissners.org>
995
996         PR target/51390
997         * config/rs6000/rs6000.c (def_builtin): Use the correct field to
998         figure out the function's attributes.
999         (struct builtin_description): Mark mask field as const since we no
1000         longer need to modify it for SPE and PAIRED builtins.
1001
1002 2011-12-02  Joseph Myers  <joseph@codesourcery.com>
1003
1004         Revert:
1005
1006         2008-09-18  Andrew Pinski  <andrew_pinski@playstation.sony.com>
1007
1008         PR rtl-opt/37451
1009         * loop-doloop.c (doloop_modify): New argument zero_extend_p and
1010         zero extend count after the correction to it is done.
1011         (doloop_optimize): Update call to doloop_modify, don't zero extend
1012         count before call.
1013
1014         2008-11-03  Andrew Pinski  <andrew_pinski@playstation.sony.com>
1015
1016         PR rtl-opt/37782
1017         * loop-doloop.c (doloop_modify): Add from_mode argument that says what
1018         mode count is in.
1019         (doloop_optimize): Update call to doloop_modify.
1020
1021 2011-12-02  Richard Guenther  <rguenther@suse.de>
1022
1023         PR lto/47259
1024         * ipa.c (varpool_externally_visible_p): Register variables
1025         are always externally visible.
1026
1027 2011-12-02  Sameera Deshpande  <sameera.deshpande@arm.com>
1028
1029         * gimple-pretty-print.c (dump_gimple_call): Dereference fn only if
1030           non-NULL.
1031
1032 2011-12-02  Martin Jambor  <mjambor@suse.cz>
1033
1034         PR tree-optimization/50622
1035         * tree-sra.c (load_assign_lhs_subreplacements): Force gimple operand
1036         if both lacc and racc are grp_partial_lhs.
1037
1038 2011-12-01  Kaz Kojima  <kkojima@gcc.gnu.org>
1039
1040         PR target/50814.
1041         * config/sh/sh.c (expand_ashiftrt): Handle TARGET_SH2A same as
1042         TARGET_SH3.
1043         (shl_sext_kind): Likewise.
1044         * config/sh/sh.h (SH_DYNAMIC_SHIFT_COST): Likewise.
1045         * config/sh/sh.md (ashlsi3_sh2a, ashrsi3_sh2a, lshrsi3_sh2a): Remove.
1046         (ashlsi3_std): Handle TARGET_SH2A same as TARGET_SH3.
1047         (ashlsi3): Likewise.
1048         (ashrsi3_d): Likewise.
1049         (lshrsi3_d): Likewise.
1050         (lshrsi3): Likewise.
1051
1052 2011-12-01  Diego Novillo  <dnovillo@google.com>
1053
1054         PR bootstrap/51346
1055         * ipa-inline.c (can_inline_edge_p): If the edge E has a statement,
1056         use the statement's inline indicator instead of E's.
1057         Remove consistency check.
1058
1059 2011-12-01  Diego Novillo  <dnovillo@google.com>
1060
1061         PR bootstrap/51346
1062         Revert
1063
1064         2011-11-29  Diego Novillo  <dnovillo@google.com>
1065
1066         * gimple.c (gimple_call_set_cannot_inline): Move from gimple.h.
1067         Update field call_stmt_cannot_inline_p from call
1068         graph edge, if needed.
1069         * gimple.h (gimple_call_set_cannot_inline): Move to gimple.c.
1070
1071 2011-12-01  Nathan Sidwell  <nathan@acm.org>
1072
1073         PR gcov-profile/51113
1074         * coverage.c (build_var): Keep coverage variables static.
1075
1076 2011-12-01  Jakub Jelinek  <jakub@redhat.com>
1077
1078         PR tree-optimization/51356
1079         * tree-vect-patterns.c (vect_recog_bool_pattern): Give up if
1080         vectype doesn't have VECTOR_MODE_P.
1081
1082         PR debug/50317
1083         * tree-ssa-dce.c (remove_dead_stmt): Add a debug stmt when removing
1084         as unnecessary a store to a variable with gimple reg type.
1085         * tree-ssa-live.c (remove_unused_locals): Clear TREE_ADDRESSABLE bit
1086         on local unreferenced variables.
1087         * cfgexpand.c (expand_gimple_basic_block): Don't emit DEBUG_INSNs
1088         for !target_for_debug_bind variables.
1089
1090 2011-12-01  Patrick Marlier  <patrick.marlier@gmail.com>
1091
1092         PR middle-end/51273
1093         * cgraph.h (cgraph_call_node_duplication_hooks): Declare.
1094         * cgraph.c (cgraph_call_node_duplication_hooks): Make global.
1095         * cgraphunit.c (cgraph_copy_node_for_versioning): Call it.
1096
1097 2011-12-01  Andrew Pinski  <apinski@cavium.com>
1098
1099         PR lto/51198
1100         * tree.c (free_lang_data_in_decl): Clear FIELD_DECL's
1101         DECL_INITIAL also.
1102
1103 2011-12-01  Jakub Jelinek  <jakub@redhat.com>
1104
1105         PR tree-optimization/51246
1106         * tree-predcom.c (replace_ref_with): Handle also clobber on the rhs.
1107
1108         PR rtl-optimization/51014
1109         * loop-unroll.c (apply_opt_in_copies): Ignore label DEBUG_INSNs
1110         both from bb and orig_bb.
1111
1112 2011-12-01  Joern Rennecke  <joern.rennecke@embecosm.com>
1113
1114         PR tree-optimization/50802
1115         * tree-vrp.c (simplify_conversion_using_ranges): Rewrite test
1116         considering what happens to ranges during sign changes and/or
1117         intermediate narrowing conversions.
1118
1119 2011-11-30  John David Anglin  <dave.anglin@nrc-cnrc.gc.ca>
1120
1121         PR middle-end/50283
1122         * config/pa/pa.md (in_branch_delay): Disallow frame related insns.
1123         (in_nullified_branch_delay): Likewise.
1124         (in_call_delay): Likewise.
1125
1126 2011-11-30  Richard Henderson  <rth@redhat.com>
1127
1128         * predict.c (expr_expected_value_1): Assume compare-and-swap builtin
1129         boolean return is true.
1130
1131 2011-11-30  Jakub Jelinek  <jakub@redhat.com>
1132
1133         PR rtl-optimization/51044
1134         * dse.c (emit_inc_dec_insn_before): Ensure new_insn is an instruction
1135         rather than just insn body.
1136
1137         PR target/50725
1138         * function.c (thread_prologue_and_epilogue_insns): If
1139         stack_realign_drap, add drap_reg to SET_UP_BY_PROLOGUE
1140         regset.
1141
1142         PR middle-end/51089
1143         * tree-eh.c (cleanup_empty_eh_merge_phis): Add check to
1144         avoid creating duplicate edges here.
1145         (cleanup_empty_eh_unsplit): And remove it in the caller.
1146
1147 2011-11-30  Andrew Pinski  <apinski@cavium.com>
1148
1149         PR c/51321
1150         * c-parser.c (c_parser_postfix_expression): Check groktypename results
1151         before looking at the main variant.
1152
1153 2011-11-30  Jakub Jelinek  <jakub@redhat.com>
1154
1155         PR rtl-optimization/48721
1156         * sched-deps.c (sched_analyze_insn): For SIBLING_CALL_P set
1157         reg_pending_barrier to TRUE_BARRIER.
1158
1159         PR rtl-optimization/48721
1160         * sched-ebb.c (begin_move_insn): Insert empty unreachable
1161         block after BARRIER if insn is followed by it.
1162
1163 2011-11-30  Richard Henderson  <rth@redhat.com>
1164
1165         * config/sparc/sparc-opts.h (enum sparc_memory_model_type): New.
1166         * config/sparc/sparc.opt (mmemory-model=): New option.
1167         * doc/invoke.texi (Sparc Options): Document it.
1168         * config/sparc/sparc.c (sparc_option_override): Provide default
1169         for sparc_memory_model.
1170         (sparc_emit_membar_for_model): Omit barrier combinations that are
1171         implied by the memory model.
1172
1173 2011-11-30  Richard Henderson  <rth@redhat.com>
1174
1175         * config/sparc/sync.md (I124MODE): New mode iterator.
1176         (memory_barrier): Remove.
1177         (atomic_exchangesi): New.
1178         (swapsi): Rename from *swapsi.
1179         (atomic_test_and_set<I124MODE>): New.
1180         (ldstubqi): Rename from *ldstubqi, merge with expander.
1181         (ldstub<I24MODE>): Rename from *ldstub<I24MODE>, merge with expander.
1182         (sync_lock_test_and_setsi): Remove.
1183         (sync_lock_test_and_set<I12MODE>): Remove.
1184
1185 2011-11-30  Richard Henderson  <rth@redhat.com>
1186
1187         * config/sparc/constraints.md ("w"): New.
1188         * config/sparc/predicates.md (mem_noofs_operand): New.
1189         * config/sparc/sparc.c (sparc_expand_compare_and_swap_12): Make static.
1190         Generate the boolean result of the atomic_compare_exchange.
1191         (sparc_expand_compare_and_swap): New.
1192         * config/sparc/sync.md (atomic_compare_and_swap<I>): New.
1193         (atomic_compare_and_swap<I48MODE>_1): Rename from
1194         *sync_compare_and_swap<I48MODE>, use mem_noofs_operand.
1195         (*atomic_compare_and_swapdi_v8plus): Rename from
1196         *sync_compare_and_swapdi_v8plus, use mem_noofs_operand.
1197         (sync_compare_and_swap<I12MODE>): Remove.
1198         (sync_compare_and_swap<I48MODE>): Remove.
1199
1200 2011-11-30  Richard Henderson  <rth@redhat.com>
1201
1202         * config/sparc/predicates.md (register_or_v9_zero_operand): New.
1203         * config/sparc/sparc.md (UNSPEC_ATOMIC): New.
1204         * config/sparc/sync.md (atomic_load<I>): New.
1205         (atomic_loaddi_1, atomic_store<I>, atomic_storedi_1): New.
1206
1207 2011-11-30  Richard Henderson  <rth@redhat.com>
1208
1209         * config/sparc/predicates.md (zero_or_v7_operand): New.
1210         * config/sparc/sparc.c (sparc_emit_membar_for_model): New.
1211         * config/sparc/sparc-protos.h: Update.
1212         * config/sparc/sync.md (mem_thread_fence): New.
1213         (memory_barrier): Use sparc_emit_membar_for_model.
1214         (membar, *membar_empty, *membar_storestore, *membar_storeload): New.
1215         (*membar_v8): Accept and ignore the membar mask.
1216         (*membar): Accept and print the membar mask.
1217
1218 2011-11-30  Matthew Gretton-Dann  <matthew.gretton-dann@arm.com>
1219
1220         * config/arm/arm.c (arm_issue_rate): Cortex-A15 can triple issue.
1221         * config/arm/arm.md (mul64): New attribute.
1222         (generic_sched): Cortex-A15 is not scheduled generically.
1223         (cortex-a15.md): Include.
1224         * config/arm/cortex-a15.md: New machine description.
1225         * config/arm/t-arm (MD_INCLUDES): Add cortex-a15.md.
1226
1227 2011-11-30  Matthew Gretton-Dann  <matthew.gretton-dann@arm.com>
1228
1229         * config/arm/t-arm (MD_INCLUDES): Ensure all md files are listed.
1230
1231 2011-11-30  Iain Sandoe  <iains@gcc.gnu.org>
1232
1233         * doc/tm.texi.in (NEXT_OBJC_RUNTIME): Update macro description.
1234         * doc/tm.texi: Regenerate.
1235         * flags.h (flag_next_runtime): Remove references.
1236         * toplev.c: Likewise.
1237         * defaults.h (NEXT_OBJC_RUNTIME): Provide default.
1238         * gccspec.c (lang_specific_driver): Adjust use of NEXT_OBJC_RUNTIME.
1239         * config/darwin.c (darwin_override_options): Provide default
1240         Objective-C abi settings and target conflict checks.
1241         * config/darwin.h (SUBTARGET_C_COMMON_OVERRIDE_OPTIONS): Remove unused
1242         code. Adjust indenting.
1243
1244 2011-11-29  Joseph Myers  <joseph@codesourcery.com>
1245
1246         * config/sh/sh.h (enum reg_class, REG_CLASS_NAMES)
1247         (REG_CLASS_CONTENTS): Add NON_SP_REGS.
1248         (REGCLASS_HAS_GENERAL_REG): Handle NON_SP_REGS.
1249         * config/sh/constraints.md (u): New constraint.
1250
1251 2011-11-29  Oleg Endo  <oleg.endo@t-online.de>
1252
1253         PR target/51337
1254         * config/sh/sh.c (sh_secondary_reload): Add case when FPUL
1255         register is being loaded from a pseudo in memory.
1256
1257 2011-11-29  DJ Delorie  <dj@redhat.com>
1258
1259         * config.gcc (rl78-*-elf): New case.
1260         * doc/extend.texi: Add RL78 documentation.
1261         * doc/invoke.texi: Likewise.
1262         * doc/md.texi: Likewise.
1263         * doc/contrib.texi: Add RL78.
1264         * doc/install.texi: Add rl78-*-elf.
1265         * config/rl78: New directory for the Renesas RL78.
1266
1267 2011-11-29  Jakub Jelinek  <jakub@redhat.com>
1268
1269         PR tree-optimization/51247
1270         * tree-vrp.c (extract_range_from_assert): For signed 1-bit precision
1271         types instead of adding 1 subtract -1 and instead of subtracting 1
1272         add -1 to avoid overflows.
1273
1274 2011-11-29  Andrew MacLeod  <amacleod@redhat.com>
1275
1276         PR target/50123
1277         * optabs.c (maybe_optimize_fetch_op): New.  Look for more optimal
1278         instructions for a FECTH_OP or OP_FECTH sequence.
1279         (expand_atomic_fetch_op): Call maybe_optimize_fetch_op.
1280
1281 2011-11-29  Uros Bizjak  <ubizjak@gmail.com>
1282
1283         * config/i386/sync.md (UNSPEC_LDA, UNSPEC_STA): New unspecs.
1284         (movdi_via_fpu): Remove.
1285         (loaddi_via_fpu): New insn pattern.
1286         (storedi_via_fpu): Ditto.
1287         (atomic_loaddi_fpu): Use loaddi_via_fpu and storedi_via_fpu.
1288         (atomic_storedi_fpu): Ditto.
1289         * reg-stack.c (get_true_reg): Handle UNSPEC_LDA.
1290         (subst_stack_regs_pat): Handle UNSPEC_STA.
1291
1292 2011-11-29  Uros Bizjak  <ubizjak@gmail.com>
1293
1294         * config/i386/i386.md (*floathi<mode>2_i387_with_temp): Do not
1295         allocate scratch memory for alternative 0.
1296
1297 2011-11-29  Michael Meissner  <meissner@linux.vnet.ibm.com>
1298
1299         * config/rs6000/rs6000-builtins.def: Completely rewrite builtin
1300         handling to centralize more of the builtins in this file.  Change
1301         some builtin enumerations to be more consistant.  Use a new mask
1302         to hold the current builtins, including SPE and PAIRED builtins
1303         which no longer are set via target_flags masks.  Add
1304         -mdebug=builtin debug support.  For power machines, define all
1305         Altivec and VSX buitins when the compiler starts, but don't allow
1306         the use of a builtin unless the appropriate switch is used, or
1307         #pragma GCC target is used to change the options.  If the user
1308         uses #pragma GCC target, update the appropriate hardware macros.
1309         * common/config/rs6000/rs6000-common.c (rs6000_handle_option): Ditto.
1310         * config/rs6000/rs6000.opt (rs6000_builtin_mask): Ditto.
1311         * config/rs6000/rs6000-c.c (rs6000_macro_to_expand): Ditto.
1312         (rs6000_define_or_undefine_macro): Ditto.
1313         (rs6000_target_modify_macros): Ditto.
1314         (rs6000_cpu_cpp_builtins): Ditto.
1315         (altivec_overloaded_builtins): Ditto.
1316         (altivec_build_resolved_builtin): Ditto.
1317         * config/rs6000/rs6000.c (rs6000_target_modify_macros_ptr): Ditto.
1318         (rs6000_builtin_info): Ditto.
1319         (def_builtin): Ditto.
1320         (enable_mask_for_builtins): Ditto.
1321         (DEBUG_FMT_X): Ditto.
1322         (rs6000_debug_reg_global): Ditto.
1323         (rs6000_builtin_mask_calculate): Ditto.
1324         (rs6000_option_override_internal): Ditto.
1325         (rs6000_builtin_conversion): Ditto.
1326         (rs6000_builtin_vectorized_function): Ditto.
1327         (bdesc_3arg): Ditto.
1328         (bdesc_dst): Ditto.
1329         (bdesc_2arg): Ditto.
1330         (builtin_description_predicates): Ditto.
1331         (bdesc_altivec_preds): Ditto.
1332         (bdesc_spe_predicates): Ditto.
1333         (bdesc_spe_evsel): Ditto.
1334         (bdesc_paired_preds): Ditto.
1335         (bdesc_abs): Ditto.
1336         (bdesc_1arg): Ditto.
1337         (rs6000_overloaded_builtin_p): Ditto.
1338         (rs6000_expand_unop_builtin): Ditto.
1339         (bdesc_2arg_spe): Ditto.
1340         (spe_expand_builtin): Ditto.
1341         (rs6000_invalid_builtin): Ditto.
1342         (rs6000_expand_builtin): Ditto.
1343         (rs6000_init_builtins): Ditto.
1344         (spe_init_builtins): Ditto.
1345         (paired_init_builtins): Ditto.
1346         (altivec_init_builtins): Ditto.
1347         (builtin_function_type): Ditto.
1348         (rs6000_common_init_builtins): Ditto.
1349         (rs6000_builtin_reciprocal): Ditto.
1350         (rs6000_builtin_mask_names): Ditto.
1351         (rs6000_pragma_target_parse): Ditto.
1352         (rs6000_function_specific_print): Ditto.
1353         * config/rs6000/rs6000.h (MASK_DEBUG_BUILTIN): Ditto.
1354         (MASK_DEBUG_ALL): Ditto.
1355         (TARGET_DEBUG_BUILTIN): Ditto.
1356         (TARGET_EXTRA_BUILTINS): Ditto.
1357         (REGISTER_TARGET_PRAGMAS): Ditto.
1358         (enum rs6000_btc): Ditto.
1359         (RS6000_BTC_*): Ditto.
1360         (RS6000_BTM_*): Ditto.
1361         (enum rs6000_builtins): Ditto.
1362         * config/rs6000/rs6000-protos.h (rs6000_overloaded_builtin_p): Ditto.
1363         (rs6000_target_modify_macros): Ditto.
1364         (rs6000_target_modify_macros_ptr): Ditto.
1365
1366         * config/rs6000/vector.md (unsfloat<VEC_int><mode>2): Use the
1367         standard name for converting vector unsigned values to floating
1368         point.  Delete the TARGET_VECTORIZE_BUILTIN_CONVERSION hook, which
1369         is handled by machine independent code.
1370         * config/rs6000/rs6000.c (TARGET_VECTORIZE_BUILTIN_CONVERSION): Ditto.
1371         (rs6000_builtin_conversion): Ditto.
1372
1373 2011-11-29  Dodji Seketeli  <dodji@redhat.com>
1374
1375         * tree-diagnostic (struct loc_t): Rename into struct loc_map_pair.
1376         (maybe_unwind_expanded_macro_loc): Adjust.
1377
1378 2011-11-29  David Edelsohn  <dje.gcc@gmail.com>
1379             Aldy Hernandez  <aldyh@redhat.com>
1380
1381         * trans-mem.c (ipa_tm_create_version_alias): Mangle new_decl
1382         if DECL_ONE_ONLY.
1383         (ipa_tm_create_version): Same.
1384
1385 2011-11-29  Bernd Schmidt  <bernds@codesourcery.com>
1386
1387         * haifa-sched.c (recompute_todo_spec): Simplify and correct the
1388         code checking for a clobber of a condition register when deciding
1389         whether to predicate.
1390
1391 2011-11-29  Diego Novillo  <dnovillo@google.com>
1392
1393         * gimple.c (gimple_call_set_cannot_inline): Move from gimple.h.
1394         Update field call_stmt_cannot_inline_p from call graph edge, if needed.
1395         * gimple.h (gimple_call_set_cannot_inline): Move to gimple.c.
1396
1397 2011-11-29  Sameera Deshpande  <sameera.deshpande@arm.com>
1398
1399         * config/arm/arm.md (arm_movdi): Update NEG_POOL_RANGE.
1400         (movdf_soft_insn): Likewise.
1401         * config/arm/fpa.md (thumb2_movdf_fpa): Likewise.
1402         * config/arm/neon.md (neon_mov<mode>): Likewise.
1403         * config/arm/vfp.md (movdi_vfp): Likewise.
1404         (movdi_vfp_cortexa8): Likewise.
1405         (movdf_vfp): Likewise.
1406
1407 2011-11-29  Jakub Jelinek  <jakub@redhat.com>
1408
1409         PR middle-end/50074
1410         * expr.c (expand_expr_addr_expr_1): Don't call force_operand for
1411         EXPAND_SUM modifier.
1412
1413 2011-11-29  Ira Rosen  <ira.rosen@linaro.org>
1414
1415         PR tree-optimization/51301
1416         * tree-vect-patterns.c (vect_recog_over_widening_pattern): Check that
1417         the last statement doesn't convert to a bigger type than the original
1418         type of the computation.
1419
1420 2011-11-28  Richard Henderson  <rth@redhat.com>
1421
1422         * config/rs6000/rs6000.c (rs6000_expand_atomic_compare_and_swap):
1423         Handle overlap between retval and oldval.  Always compute boolval
1424         from CR0 EQ value.
1425
1426 2011-11-28  Jakub Jelinek  <jakub@redhat.com>
1427
1428         PR debug/50317
1429         * tree-ssa.c (execute_update_addresses_taken): Remove
1430         var ={v} {CLOBBER} stmts instead of rewriting them into
1431         var_N ={v} {CLOBBER}.
1432
1433         PR middle-end/50907
1434         * function.c (convert_jumps_to_returns): When redirecting an edge
1435         succ to EXIT_BLOCK_PTR, clear EDGE_CROSSING flag.
1436
1437         PR tree-optimization/50078
1438         * tree-ssa-forwprop.c (forward_propagate_addr_expr_1): Copy over
1439         TREE_THIS_VOLATILE also from the old to new lhs resp. rhs.
1440
1441         PR tree-optimization/50682
1442         * tree-eh.c (maybe_remove_unreachable_handlers): New function.
1443         * tree-flow.h (maybe_remove_unreachable_handlers): New prototype.
1444         * tree-optimize.c (execute_cleanup_cfg_post_optimizing): Call it.
1445
1446 2011-11-28  Georg-Johann Lay  <avr@gjlay.de>
1447
1448         * doc/extend.texi (AVR Built-in Functions): Add documentation for
1449         __builtin_avr_map8 and __builtin_avr_map16.
1450
1451         * config/avr/avr.md: Document new %t and %T asm output codes.
1452         (define_c_enum "unspec"): Add UNSPEC_MAP_BITS.
1453         (adjust_len): Add map_bits.
1454         (map_bitsqi, map_bitshi): New insns.
1455         * config/avr/avr-protos.h (avr_out_map_bits): New.
1456         * config/avr/avr-protos.c (print_operand): Implement %t and %T.
1457         (adjust_insn_length): Handle ADJUST_LEN_MAP_BITS.
1458         (avr_double_int_push_digit): New function.
1459         (avr_map, avr_revert_map, avr_swap_map, avr_id_map): New functions.
1460         (avr_sig_map, avr_map_hamming_byte): New functions.
1461         (avr_out_swap_bits, avr_out_revert_bits, avr_move_bits,
1462         avr_out_map_bits): New functions.
1463         (enum avr_builtin_id): Add AVR_BUILTIN_MAP8, AVR_BUILTIN_MAP16.
1464         (avr_init_builtins): Populate __builtin_avr_map8, __builtin_avr_map16.
1465         (bdesc_2arg): Add __builtin_avr_map8, __builtin_avr_map16 ...
1466         (avr_expand_builtin): ...and expand them.
1467         * config/avr/avr-c.c (avr_cpu_cpp_builtins): New built-in defines:
1468         __BUILTIN_AVR_MAP8, __BUILTIN_AVR_MAP16.
1469
1470 2011-11-27  Richard Sandiford  <rdsandiford@googlemail.com>
1471
1472         PR target/51278
1473         * config/mips/mips.c (mips_rtx_costs): Handle baddu.
1474
1475 2011-11-27  Richard Sandiford  <rdsandiford@googlemail.com>
1476
1477         * config/mips/mips.c (mips16_unextended_reference_p): Test for BLKmode.
1478
1479 2011-11-27  Richard Sandiford  <rdsandiford@googlemail.com>
1480
1481         * config/mips/mips-protos.h (mips_emit_binary): Declare.
1482         * config/mips/mips.c (mips_emit_binary): Make global.
1483         (mips_set_mips16_mode): Turn off -mfix-r4000 in MIPS16 mode.
1484         (mips_conditional_register_usage): Don't treat LO and HI as
1485         register operands in MIPS16 mode.
1486         (mips_mulsidi3_gen_fn): Use {u,}mulsidi3_{32,64}bit_mips16
1487         for MIPS16 code.
1488         * config/mips/predicates.md (muldiv_target_operand): New predicate.
1489         (move_operand): Allow hilo_operand.
1490         * config/mips/mips.md (mul<mode>3): Explicitly specify LO as the
1491         target of MIPS16 multiplies, then move it into the target register.
1492         (mul<mode>3_internal, *macc2, *msac2): Use muldiv_target_operand.
1493         (<u>mulsidi3_32bit_mips16): New expander.
1494         (<u>mulsidi3_32bit): Use muldiv_target_operand.
1495         (<u>mulsidi3_32bit_r4000): Disable for ISA_HAS_DSP.
1496         (<u>mulsidi3_64bit): Require !TARGET_MIPS16.  Split into
1497         <u>mulsidi3_64bit_split.
1498         (<u>mulsidi3_64bit_mips16): New expander.
1499         (<u>mulsidi3_64bit_split): Likewise, using expansions from
1500         two previous define_splits.
1501         (<u>mulsidi3_64bit_hilo, *muls<u>_di, <u>msubsidi4): Use
1502         muldiv_target_operand.
1503         (<su>mulsi3_highpart): Use <su>mulsi3_highpart_split for MIPS16 code.
1504         (<su>mulsi3_highpart_internal): Require !TARGET_MIPS16.
1505         Split into <su>mulsi3_highpart_split.
1506         (<su>mulsi3_highpart_split): New expander.
1507         (<su>muldi3_highpart): Turn into a define_expand.
1508         Use <su>muldi3_highpart_split for MIPS16 code.
1509         (<su>muldi3_highpart_internal): Renamed from <su>muldi3_highpart.
1510         Require !TARGET_MIPS16.  Split into <su>muldi3_highpart_split.
1511         (<su>muldi3_highpart_split): New expander.
1512         (<u>mulditi3): Explicitly specify LO as the target of MIPS16
1513         multiplies, then move it into the target register.
1514         (<u>mulditi3_internal, <u>maddsidi4): Use muldiv_target_operand.
1515         (divmod<mode>4, udivmod<mode>4): Turn into define_expands.
1516         Use <u>divmod<mode>4_split for MIPS16 code, then explicitly
1517         move LO into operand 0.
1518         (divmod<mode>4_internal, udivmod<mode>4_internal): Renamed
1519         from <u>divmod<mode>4.  Use muldiv_target_operand.
1520         Require !TARGET_MIPS16.  Split into <u>divmod<mode>4_split.
1521         (<u>divmod<mode>4_split): New expander.
1522         (<u>divmod<GPR:mode>4_hilo_<HILO:mode>): Use muldiv_target_operand.
1523         (mfhi<GPR:mode>_<HILO:mode>): Use hilo_operand.
1524
1525 2011-11-27  Richard Sandiford  <rdsandiford@googlemail.com>
1526
1527         * hard-reg-set.h (target_hard_regs): Add x_accessible_reg_set
1528         and x_operand_reg_set.
1529         (accessible_reg_set, operand_reg_set): New macros.
1530         * reginfo.c (init_reg_sets): Initialize accessible_reg_set and
1531         operand_reg_set.
1532         (saved_accessible_reg_set, saved_operand_reg_set): New variables.
1533         (save_register_info): Save them.
1534         (restore_register_info): Restore them.
1535         (init_reg_sets_1): Limit operand_reg_set to accessible_reg_set.
1536         Remove NO_REGS registers from operand_reg_set.  Treat members
1537         of operand_reg_set as fixed.
1538         * recog.c (general_operand): Check operand_reg_set rather than NO_REGS.
1539         (register_operand, nonmemory_operand): Likewise.
1540         * varasm.c (make_decl_rtl): Always use DECL_MODE as the mode of
1541         register variables.  Check accessible_reg_set and operand_reg_set.
1542         * config/mips/mips.c (mips_conditional_register_usage): Remove
1543         inaccessible register from accessible_reg_set, rather than just
1544         making them fixed.
1545
1546 2011-11-27  Gerald Pfeifer  <gerald@pfeifer.com>
1547
1548         * config/pa/pa-linux.h (TARGET_GAS): Remove comment.
1549
1550 2011-11-26  Richard Henderson  <rth@redhat.com>
1551
1552         * config/arm/arm.c (arm_init_libfuncs): Call init_sync_libfuncs
1553         for Linux.
1554
1555 2011-11-26  Richard Henderson  <rth@redhat.com>
1556
1557         * optabs.c (expand_atomic_fetch_op): Always return result.
1558
1559         * optabs.c (init_sync_libfuncs_1): Include max in iteration.
1560
1561         * omp-low.c (expand_omp_atomic): Assume anything aligned to
1562         BIGGEST_ALIGNMENT is aligned.
1563
1564 2011-11-26  Richard Henderson  <rth@redhat.com>
1565
1566         * config/m68k/m68k.md (UNSPECV_CAS_1, UNSPECV_CAS_2): New.
1567         (UNSPECV_TAS_1, UNSPECV_TAS_2): New.
1568         (I): New mode iterator.
1569         (xz): New mode attribute.
1570         * config/m68k/sync.md: New file.
1571
1572         * config/m68k/linux.h (TARGET_INIT_LIBFUNCS): New.
1573         * config/m68k/m68k.c (m68k_init_sync_libfuncs): New.
1574
1575 2011-11-26  Nathan Sidwell  <nathan@acm.org>
1576
1577         PR gcov-profile/51297
1578         * gcov.c (main): Allocate initial names and sources arrays.
1579         (find_source): Don't check for null name or source arrays here.
1580
1581 2011-11-26  Jakub Jelinek  <jakub@redhat.com>
1582
1583         PR rtl-optimization/49912
1584         * cfgrtl.c (rtl_verify_flow_info_1): Ignore also EDGE_PRESERVE bit
1585         when counting n_branch.
1586
1587 2011-11-26  Uros Bizjak  <ubizjak@gmail.com>
1588
1589         * config/i386/sync.md (movdi_via_fpu): Add %Z insn suffixes.
1590
1591 2011-11-26  Joern Rennecke  <joern.rennecke@embecosm.com>
1592
1593         PR middle-end/50074
1594         * calls.c (mem_overlaps_already_clobbered_arg_p):
1595         Return false if no outgoing arguments have been stored so far.
1596
1597 2011-11-25  Georg-Johann Lay  <avr@gjlay.de>
1598
1599         * config/avr/avr.c (print_operand): Support code = 'i' for CONST_INT.
1600
1601 2011-11-24  Andrew MacLeod  <amacleod@redhat.com>
1602
1603         PR other/51011
1604         * tree.h (is_builtin_name): No longer external.
1605         * builtins.c (is_builtin_name): Make static.
1606         * varasm.c (incorporeal_function_p): __sync and __atomic external calls
1607         are not incorporeal and may need asm label processing.
1608
1609 2011-11-25  Georg-Johann Lay  <avr@gjlay.de>
1610
1611         PR target/50566
1612         * config/avr/avr-protos.h (avr_log_t): Add field .builtin.
1613         * config/avr/avr-log.c (avr_log_set_avr_log): Initialize it.
1614         Don't bypass TARGET_ALL_DEBUG.  Print self-info with ?.
1615         (avr_log_vadump): Support %D and %X to print double_int.
1616         (avr_double_int_pop_digit): New static function.
1617         (avr_dump_double_int_hex): New static function.
1618
1619 2011-11-24  Enkovich Ilya  <ilya.enkovich@intel.com>
1620
1621         PR target/51287
1622         * config/i386/i386.c (distance_non_agu_define_in_bb): Fix insn
1623         attr check.
1624
1625 2011-11-24  Andrew MacLeod  <amacleod@redhat.com>
1626
1627         * optab.c (maybe_emit_atomic_exchange): New.  Try to emit an
1628         atomic_exchange pattern.
1629         (maybe_emit_sync_lock_test_and_set): New.  Try to emit an exchange
1630         using __sync_lock_test_and_set.
1631         (maybe_emit_compare_and_swap_exchange_loop): New. Try to emit an
1632         exchange using a compare_and_swap loop.
1633         (expand_sync_lock_test_and_set): New.  Expand sync_lock_test_and_set.
1634         (expand_atomic_test_and_set): New.  Expand test_and_set operation.
1635         (expand_atomic_exchange): Use new maybe_emit_* functions.
1636         (expand_atomic_store): Use new maybe_emit_* functions.
1637         * builtins.c (expand_builtin_sync_lock_test_and_set): Call
1638         expand_sync_lock_test_and_set routine.
1639         (expand_builtin_atomic_exchange): Remove parameter from call.
1640         (expand_builtin_atomic_clear): Use atomic_clear pattern if present.
1641         (expand_builtin_atomic_test_and_set): Add target and simply call
1642         expand_atomic_test_and_set.
1643         (expand_builtin): Add target to expand_builtin_atomic_test_and_set.
1644         * expr.h (expand_atomic_exchange): Add parameter.
1645         (expand_sync_lock_test_and_set): New prototype.
1646         (expand_atomic_test_and_set, expand_atomic_clear): New prototypes.
1647
1648 2011-11-24  H.J. Lu  <hongjiu.lu@intel.com>
1649
1650         PR target/51134
1651         * config/i386/i386.h (processor_costs): Revert revision 181357.
1652         * config/i386/i386.c (cost models): Likewise.
1653         (core_cost): Likewise.
1654         (promote_duplicated_reg): Likewise.
1655         (promote_duplicated_reg_to_size): Likewise.
1656         (processor_target): Likewise.
1657         (expand_set_or_movmem_via_loop_with_iter): Likewise.
1658         (expand_set_or_movmem_via_loop): Likewise.
1659         (emit_strset): Likewise.
1660         (expand_movmem_epilogue): Likewise.
1661         (expand_setmem_epilogue): Likewise.
1662         (expand_movmem_prologue): Likewise.
1663         (expand_setmem_prologue): Likewise.
1664         (expand_constant_movmem_prologue): Likewise.
1665         (expand_constant_setmem_prologue): Likewise.
1666         (decide_alg): Likewise.
1667         (decide_alignment): Likewise.
1668         (ix86_expand_movmem): Likewise.
1669         (ix86_expand_setmem): Likewise.
1670         (ix86_slow_unaligned_access): Likewise.
1671         * config/i386/i386.md (strset): Likewise.
1672         * config/i386/sse.md (vec_dupv4si): Likewise.
1673         (vec_dupv2di): Likewise.
1674
1675 2011-11-24  Georg-Johann Lay  <avr@gjlay.de>
1676
1677         * config/avr/avr.md (*rotlhi2.15): Set length to 4.
1678
1679 2011-11-24  Razya Ladelsky  <razya@il.ibm.com>
1680
1681         * tree-data-ref.c (initialize_data_dependence_relation): Update
1682         comment for the self dependence case.
1683         (compute_self_dependence): Remove.
1684         * tree-vect-data-refs.c (vect_analyze_data_refs): Remove call to
1685         compute_self_dependenc.
1686
1687 2011-11-24  Alan Modra  <amodra@gmail.com>
1688
1689         * c-decl.c (warn_if_shadowing): Don't warn if shadowed
1690         identifier is from system header.
1691
1692 2011-11-23  Jakub Jelinek  <jakub@redhat.com>
1693
1694         PR target/51261
1695         * config/i386/i386.c (decide_alg): Initialize *dynamic_check
1696         even if !optimize.
1697
1698 2011-11-23  Vladimir Makarov  <vmakarov@redhat.com>
1699
1700         PR rtl-optimization/48455
1701         * doc/invoke.texi (-fira-region): Document default values.
1702
1703         * flags-types.h (enum ira_region): Add new value
1704         IRA_REGION_AUTODETECT.
1705
1706         * common.opt (fira-region): Set up initial value to
1707         IRA_REGION_AUTODETECT.
1708
1709         * toplev.c (process_options): Set up flag_ira_region depending on
1710         -O options.
1711
1712         * ira.c (ira.c): Remove optimize guard for ira_build.
1713
1714 2011-11-23  Chung-Lin Tang  <cltang@codesourcery.com>
1715
1716         PR rtl-optimization/50496
1717         * jump.c (redirect_jump): Assert fail on nlabel == NULL_RTX
1718         only after epilogue is created. Add comments.
1719
1720 2011-11-22  Richard Henderson  <rth@redhat.com>
1721
1722         * config/ia64/ia64.c (ia64_expand_atomic_op): Add model parameter.
1723         Generate the barrier required for the memory model.
1724         (rtx_needs_barrier): Handle UNSPEC_FETCHADD_REL, UNSPEC_CMPXCHG_REL.
1725         * config/ia64/ia64-protos.h: Update.
1726         * config/ia64/ia64.md (UNSPEC_FETCHADD_REL): New.
1727         (UNSPEC_CMPXCHG_REL): New.
1728         * config/ia64/sync.md (mem_thread_fence): New.
1729         (atomic_load<IMODE>, atomic_store<IMODE>): New.
1730         (atomic_compare_and_swap<IMODE>): New.
1731         (cmpxchg_acq_<I124MODE>, cmpxchg_acq_di): New.
1732         (atomic_exchange<IMODE>): New.
1733         (xchg_acq_<IMODE>): Rename from sync_lock_test_and_set<IMODE>.
1734         (atomic_<FETCHOP><IMODE>, atomic_nand<IMODE>): New.
1735         (atomic_fetch_<FETCHOP><IMODE>, atomic_fetch_nand<IMODE>): New.
1736         (atomic_<FETCHOP>_fetch<IMODE>, atomic_nand_fetch<IMODE>): New.
1737         (fetchadd_rel_<I48MODE>): New.
1738         (sync_<FETCHOP><IMODE>, sync_nand<IMODE>): Remove.
1739         (sync_old_<FETCHOP><IMODE>, sync_old_nand<IMODE>): Remove.
1740         (sync_new_<FETCHOP><IMODE>, sync_new_nand<IMODE>): Remove.
1741         (sync_compare_and_swap<IMODE>): Remove.
1742         (sync_lock_release<IMODE>): Remove.
1743
1744         * config/ia64/ia64.md: Use define_c_enum for UNSPEC_*
1745         and UNSPECV_* constants.
1746
1747 2011-11-22  Tom de Vries  <tom@codesourcery.com>
1748
1749         PR rtl-optimization/50764
1750         * sched-deps.c (sched_analyze_insn): Make sure frame-related insns are
1751         not moved past preceding jump.
1752
1753 2011-11-22  Jeff Law  <law@redhat.com>
1754
1755         * doc/contrib.texi: Add entry for David Binderman.
1756
1757 2011-11-22  Andreas Krebbel  <Andreas.Krebbel@de.ibm.com>
1758
1759         * postreload.c (reload_combine): Mark reg_state as invalid at
1760         volatile insns if there has been a use already.
1761
1762 2011-11-21  Aldy Hernandez  <aldyh@redhat.com>
1763
1764         * opts.c (finish_options): Do not fail for -fgnu-tm.
1765         * gimple-streamer-out.c (output_gimple_stmt): Handle
1766         GIMPLE_TRANSACTION.
1767         * gimple-streamer-in.c (input_gimple_stmt): Same.
1768         * lto-cgraph.c (input_overwrite_node): Read tm_clone bit.
1769         (lto_output_node): Write tm_clone bit.
1770
1771 2011-11-22  Ian Lance Taylor  <iant@google.com>
1772
1773         * doc/install.texi (Configuration): Correct doc of
1774         --enable-build-poststage1-with-cxx: it is not experimental.
1775
1776 2011-11-22  Jakub Jelinek  <jakub@redhat.com>
1777
1778         PR tree-optimization/51074
1779         * fold-const.c (fold_binary_loc): Fix up VEC_INTERLEAVE_*_EXPR
1780         handling for BYTES_BIG_ENDIAN.
1781         * optabs.c (can_vec_perm_for_code_p): Likewise.
1782
1783 2011-11-22  Michael Matz  <matz@suse.de>
1784
1785         PR other/51125
1786         * trans-mem.c (expand_block_tm): Ignore clobbers.
1787
1788 2011-11-22  Iain Sandoe  <iains@gcc.gnu.org>
1789
1790         *  config/darwin.h (ENDFILE_SPEC): New.
1791         (DARWIN_CRT1_SPEC): Add crttms.o.
1792         (STARTFILE_SPEC): Likewise for dynamic libs and bundles.
1793         * config/i386.h (ENDFILE_SPEC): Amend to include crttme.o.
1794
1795 2011-11-22  Michael Matz  <matz@suse.de>
1796
1797         PR c++/51264
1798         * tree.c (iterative_hash_expr): Remove break after return.
1799
1800 2011-11-22  Iain Sandoe  <iains@gcc.gnu.org>
1801
1802         * target.def (tm_clone_table_section): New hook.
1803         * doc/tm.texi.in (TARGET_ASM_TM_CLONE_TABLE_SECTION): Define.
1804         * doc/tm.texi: Regenerate.
1805         * varasm.c (dump_tm_clone_pairs): Use target tm_clone_table_section.
1806         * output.h (default_clone_table_section): New prototype.
1807         * config/darwin.h (TARGET_ASM_TM_CLONE_TABLE_SECTION): New.
1808         * config/darwin-protos.h (darwin_tm_clone_table_section): New prototype.
1809         * config/darwin.c (darwin_tm_clone_table_section): New.
1810
1811 2011-11-21  Torvald Riegel  <triegel@redhat.com>
1812
1813         * trans-mem.c (diagnose_tm_1): Print an expression instead of a
1814         declaration in error messages for indirect calls.
1815
1816 2011-11-21  David S. Miller  <davem@davemloft.net>
1817
1818         * config/sparc/sparc.c (sparc_regmode_natural_size): New function
1819         implementing REGMODE_NATURAL_SIZE taking into consideration vector
1820         modes.
1821         (sparc_modes_tieable_p): Similarly for MODES_TIEABLE_P.
1822         * config/sparc/sparc-protos.h (sparc_regmode_natural_size,
1823         sparc_modes_tieable_p): Declare.
1824         * gcc/config/sparc/sparc.h (REGMODE_NATURAL_SIZE,
1825         MODES_TIEABLE_P): Use new helper functions.
1826
1827         Revert
1828         2011-11-16  Andreas Krebbel  <Andreas.Krebbel@de.ibm.com>
1829
1830         PR middle-end/50325
1831         * expmed.c (store_bit_field_1): Use extract_bit_field on big
1832         endian targets if the source cannot be exactly covered by word
1833         mode chunks.
1834
1835 2011-11-21  Jakub Jelinek  <jakub@redhat.com>
1836
1837         PR debug/50827
1838         * var-tracking.c (loc_cmp): For ENTRY_VALUEs use ENTRY_VALUE_EXP
1839         macro instead of XEXP.
1840
1841 2011-11-21  Andreas Tobler  <andreast@fgznet.ch>
1842
1843         * configure: Regenerate.
1844
1845 2011-11-21  Georg-Johann Lay  <avr@gjlay.de>
1846
1847         * config/avr/avr.c (output_reload_in_const): Loading a byte with 0
1848         must not affect cc0.
1849         * config/avr/avr.md (*movhi, *movpsi, *movsi, *movsf): Zero to any
1850         register does not change cc0. Same for any constant to ld-register.
1851
1852 2011-11-21  Uros Bizjak  <ubizjak@gmail.com>
1853
1854         * config/i386/mmx.md (unspec) <UNSPEC_MOVNTQ, UNSPEC_PFRCP,
1855         UNSPEC_PFRCPIT1, UNSPEC_PFRCPIT2, UNSPEC_PFRSQRT, UNSPEC_PFRSQIT1>:
1856         Move from config/i386/i386.md
1857         (unspecv) <UNSPECV_EMMS, UNSPECV_FEMMS>: Ditto.
1858         * config/i386/sse.md (unspec) <UNSPEC_MOVNT,UNSPEC_MOVU, UNSPEC_LDDQU,
1859         UNSPEC_PSHUFB, UNSPEC_PSIGN, UNSPEC_PALIGNR, UNSPEC_EXTRQI,
1860         UNSPEC_EXTRQ, UNSPEC_INSERTQI, UNSPEC_INSERTQ, UNSPEC_BLENDV,
1861         UNSPEC_INSERTPS, UNSPEC_DP, UNSPEC_MOVNTDQA, UNSPEC_MPSADBW,
1862         UNSPEC_PHMINPOSUW, UNSPEC_PTEST, UNSPEC_PCMPESTR, UNSPEC_PCMPISTR,
1863         UNSPEC_FMADDSUB, UNSPEC_XOP_UNSIGNED_CMP, UNSPEC_XOP_TRUEFALSE,
1864         UNSPEC_XOP_PERMUTE, UNSPEC_FRCZ, UNSPEC_AESENC, UNSPEC_AESENCLAST,
1865         UNSPEC_AESDEC, UNSPEC_AESDECLAST, UNSPEC_AESIMC,
1866         UNSPEC_AESKEYGENASSIST, UNSPEC_PCLMUL, UNSPEC_PCMP, UNSPEC_VPERMIL,
1867         UNSPEC_VPERMIL2, UNSPEC_VPERMIL2F128, UNSPEC_CAST, UNSPEC_VTESTP,
1868         UNSPEC_VCVTPH2PS, UNSPEC_VCVTPS2PH, UNSPEC_VPERMSI, UNSPEC_VPERMDF,
1869         UNSPEC_VPERMSF, UNSPEC_VPERMTI, UNSPEC_GATHER, UNSPEC_VSIBADDR>: Ditto.
1870         (unspecv) <UNSPECV_LDMXCSR, UNSPECV_STMXCSR, UNSPECV_CLFLUSH,
1871         UNSPECV_MONITOR, UNSPECV_MWAIT, UNSPECV_VZEROALL, UNSPECV_VZEROUPPER>:
1872         Ditto.
1873         * config/i386/sync.md (unspec) <UNSPEC_LFENCE, UNSPEC_SFENCE,
1874         UNSPEC_MFENCE, UNSPEC_MOVA>: Ditto.
1875         (unspecv) <UNSPECV_CMPXCHG_1, UNSPECV_CMPXCHG_2, UNSPECV_CMPXCHG_3,
1876         UNSPECV_CMPXCHG_4, UNSPECV_XCHG, UNSPECV_LOCK>: Ditto.
1877         (sse2_lfence): Move from config/i386/sse.md.
1878         (*sse2_lfence): Ditto.
1879         (sse_sfence): Ditto.
1880         (*sse_sfence): Ditto.
1881         (sse2_mfence): Ditto.
1882         (mfence_sse2): Ditto.  Rename from *sse2_mfence.  Enable also
1883         for TARGET_64BIT.
1884         (mem_thread_fence): Use mfence_sse2.
1885
1886 2011-11-21  Georg-Johann Lay  <avr@gjlay.de>
1887
1888         * config/avr/avr.h (struct base_arch_s): Add field sfr_offset.
1889         * config/avr/avr-devices.c: Ditto. And initialize it.
1890         * config/avr/avr-c.c (avr_cpu_cpp_builtins): New built-in define
1891         __AVR_SFR_OFFSET__.
1892         * config/avr/avr-protos.h (out_movqi_r_mr, out_movqi_mr_r): Remove.
1893         (out_movhi_r_mr, out_movhi_mr_r): Remove.
1894         (out_movsi_r_mr, out_movsi_mr_r): Remove.
1895         * config/avr/avr.md (*cbi, *sbi): Use %i instead of %m-0x20.
1896         (*insv.io, *insv.not.io): Ditto.
1897         * config/avr/avr.c (out_movsi_r_mr, out_movsi_mr_r): Make static.
1898         (print_operand): Implement "%i" to print address as I/O address.
1899         (output_movqi): Clean up call of out_movqi_mr_r.
1900         (output_movhi): Clean up call of out_movhi_mr_r.
1901         (avr_file_start): Use avr_current_arch->sfr_offset instead of
1902         magic -0x20. Use TMP_REGNO, ZERO_REGNO instead of 0, 1.
1903         (avr_out_sbxx_branch): Use %i instead of %m-0x20.
1904         (out_movqi_r_mr, out_movqi_mr_r): Ditto. And make static.
1905         (out_movhi_r_mr, out_movhi_mr_r): Ditto. And use avr_asm_len.
1906         (out_shift_with_cnt): Clean up code: Use avr_asm_len.
1907         (output_movsisf): Use output_reload_insisf for all CONSTANT_P sources.
1908         (avr_out_movpsi): USE avr_out_reload_inpsi for all CONSTANT_P sources.
1909         Clean up call of avr_out_store_psi.
1910         (output_reload_in_const): Don't cut symbols longer than 2 bytes.
1911         (output_reload_insisf): Filter CONST_INT_P or CONST_DOUBLE_P to
1912         try if setting pre-cleared register is advantageous.
1913         (avr_out_plus_1): Use gen_int_mode instead of GEN_INT.
1914
1915 2011-11-20  Joey Ye  <joey.ye@arm.com>
1916
1917         * expr.c (expand_expr_real_1): Correctly handle strict volatile
1918         bitfield loads smaller than mode size.
1919
1920 2011-11-20  Richard Henderson  <rth@redhat.com>
1921
1922         * config/mips/mips.c (mips_init_libfuncs): Call init_sync_libfuncs.
1923
1924 2011-11-20  Uros Bizjak  <ubizjak@gmail.com>
1925
1926         PR target/51235
1927         * config/i386/i386.c (ix86_expand_vcond): Generate TARGET_XOP
1928         patterns for supported mode only.
1929
1930         PR target/51236
1931         * config/i386/i386.c (ix86_expand_builtin)
1932         <IX86_BUILTIN_GATHERALTSIV4DI>: Use CODE_FOR_avx2_gathersiv4di.
1933
1934 2011-11-20  Uros Bizjak  <ubizjak@gmail.com>
1935
1936         * config/i386/i386.md (UNSPEC_MOVNTI): Remove.
1937         (UNSPEC_MOVNTQ): New unspec.
1938         * config/i386/mmx.md (sse_movntq): Rename from sse_movntdi.
1939         Use UNSPEC_MOVNTQ instead of UNSPEC_MOVNT.
1940         * config/i386/sse.md (sse2_movnti<mode>): Use UNSPEC_MOVNT instead of
1941         UNSPEC_MOVNTI.
1942         (STORENT_MODE): Add DI and V4DI modes.
1943
1944 2011-11-20  Nathan Sidwell  <nathan@acm.org>
1945
1946         PR gcov-profile/51113
1947         * coverage.c (build_var): Propagate visibility for public
1948         decls.  Use make_decl_one_only for PIC correctness.
1949
1950         testsuite/
1951         * gcc.misc-tests/gcov-13.c: Check gcovpart-13b coverage
1952         * gcc.misc-tests/gcov-16.c: New.
1953         * gcc.misc-tests/gcov-17.c: New.
1954         * g++.dg/gcov/gcov-8.C: New.
1955         * g++.dg/gcov/gcov-9.C: New.
1956         * g++.dg/gcov/gcov-10.C: New.
1957
1958 2011-11-19  Eric Botcazou  <ebotcazou@adacore.com>
1959
1960         PR rtl-optimization/51187
1961         * reorg.c (relax_delay_slots): Do not consider a jump useless if there
1962         is a barrier between the jump and its target label.
1963
1964 2011-11-19  Patrick Marlier  <patrick.marlier@gmail.com>
1965
1966         PR middle-end/51211
1967         * tracer.c (ignore_bb_p): Don't copy GIMPLE_TRANSACTION.
1968
1969 2011-11-19  Eric Botcazou  <ebotcazou@adacore.com>
1970
1971         * expmed.c (store_bit_field_1): Revert bogus formatting change.
1972
1973 2011-11-19  Richard Earnshaw  <rearnsha@arm.com>
1974
1975         PR target/50493
1976         * config/arm/arm.c (neon_disambiguate_copy): Correctly handle partial
1977         overlap of src and dest operands.
1978
1979 2011-11-19  Iain Sandoe  <iains@gcc.gnu.org>
1980
1981         * config/darwin.h (ASM_DEBUG_SPEC): New.
1982         * config/darwin9.h (ASM_DEBUG_SPEC): New.
1983
1984 2011-11-18  Jan Hubicka  <jh@suse.cz>
1985
1986         * config/i386/i386.c (atom_cost): Disable SSE loop until alignment
1987         issues are fixed.
1988
1989 2011-11-18  Anatoly Sokolov  <aesok@post.ru>
1990
1991         * config/cris/cris.c (cris_function_value_regno_p): Make static.
1992         (TARGET_FUNCTION_VALUE_REGNO_P): Define.
1993         * config/cris/cris.h (FUNCTION_VALUE_REGNO_P): Remove.
1994         * config/cris/cris-protos.h (cris_function_value_regno_p): Remove.
1995
1996 2011-11-18  H.J. Lu  <hongjiu.lu@intel.com>
1997
1998         PR target/33944
1999         * doc/extend.texi: Document __builtin_ia32_movnti64.
2000
2001         * config/i386/emmintrin.h (_mm_stream_si64): New.
2002
2003         * config/i386/i386-builtin-types.def: Add VOID_FTYPE_PLONGLONG_LONGLONG.
2004
2005         * config/i386/i386.c (ix86_builtins): Add IX86_BUILTIN_MOVNTI64.
2006         (bdesc_special_args): Update __builtin_ia32_movnti.  Add
2007         __builtin_ia32_movnti64.
2008         (ix86_expand_special_args_builtin): Handle
2009         VOID_FTYPE_PLONGLONG_LONGLONG.
2010
2011         * config/i386/i386.md (UNSPEC_MOVNTI): New.
2012
2013         * config/i386/sse.md (sse2_movntsi): Renamed to ...
2014         (sse2_movnti<mode>): This.
2015
2016 2011-11-18  Georg-Johann Lay  <avr@gjlay.de>
2017
2018         PR target/49868
2019         * config/avr/avr.h (base_arch_s): Add field n_segments.
2020         (ADDR_SPACE_PGM1, ADDR_SPACE_PGM2, ADDR_SPACE_PGM3,
2021         ADDR_SPACE_PGM4, ADDR_SPACE_PGM5, ADDR_SPACE_PGMX): New address spaces.
2022         (AVR_HAVE_ELPM, AVR_HAVE_ELPMX): New defines.
2023         (INIT_EXPANDERS): New define.
2024         * config/avr/avr-protos.h (avr_mem_pgmx_p): New.
2025         (avr_init_expanders): New.
2026         (avr_emit_movmemhi, avr_out_movmem): New.
2027         (avr_xload_libgcc_p): New.
2028         * config/avr/avr-c.c (avr_register_target_pragmas): Register
2029         address spaces __pgm1, __pgm2,  __pgm3,  __pgm4  __pgm5,  __pgmx.
2030         (avr_cpu_cpp_builtins): Add built-in defines __PGM1,
2031         __PGM2, __PGM3, __PGM4, __PGM5, __PGMX.
2032         * config/avr/avr-devices.c (avr_arch_types): Set field n_segments.
2033
2034         * config/avr/avr.c (AVR_SECTION_PROGMEM): Change define to cover
2035         3 bits instead of just 1.
2036         (xstring_empty, xstring_e, rampz_rtx): New static GTYed variables.
2037         (progmem_section): Change from section to array of sections.
2038         (progmem_section_prefix): New static variable.
2039         (avr_file_start): Print set for __RAMPZ__
2040         (avr_option_override): Move initialization of RTXes from here...
2041         (avr_init_expanders): ...to this new function.
2042         (avr_pgm_segment): New static function.
2043         (avr_decl_pgm_p): Handle error_mark_node.
2044         (avr_mem_pgmx_p, avr_decl_pgmx_p): New static functions.
2045         (avr_out_xload, avr_find_unused_d_reg): New static functions.
2046         (expand_prologue, expand_epilogue): Use rampz_rtx.
2047         (print_operand): Hande CONST_STRING.
2048         (avr_xload_libgcc_p): New static function.
2049         (avr_out_lpm_no_lpmx, avr_out_lpm): Handle ELPM.
2050         (avr_progmem_p): Return 2 for 24-bit flash address space.
2051         (avr_out_sbxx_branch): Clean-up code from ASn macros.
2052         (out_movqi_r_mr, out_movqi_mr_r): Ditto. And recognize RAMPZ's
2053         address and print symbolically.
2054         (avr_asm_named_section, avr_section_type_flags,
2055         avr_encode_section_info, avr_asm_select_section,
2056         avr_addr_space_address_mode, avr_addr_space_pointer_mode,
2057         avr_addr_space_legitimate_address_p, avr_addr_space_convert,
2058         avr_addr_space_legitimize_address): Handle new address spaces.
2059         (avr_output_progmem_section_asm_op): New static function.
2060         (avr_asm_init_sections): Initialize progmem_section[].
2061         (adjust_insn_length): Handle ADJUST_LEN_XLOAD, ADJUST_LEN_MOVMEM.
2062         (avr_const_address_lo16): New static function.
2063         (avr_assemble_integer): Use it to handle 3-byte integers.
2064         (avr_emit_movmemhi, avr_out_movmem): New functions.
2065
2066         * config/avr/predicates.md (nox_general_operand): Handle new
2067         address spaces.
2068         * config/avr/avr.md (unspec): Add UNSPEC_MOVMEM.
2069         (adjust_len): Add xload, movmem.
2070         (SP_ADDR): New define_constants.
2071         (isa): Add "lpm", "lpmx", "elpm", "elpmx".
2072         (enabled): Handle them.
2073         (load<mode>_libgcc): New expander.
2074         (*load.<mode>.libgcc): Rename to load_<mode>_libgcc.
2075         (xload8_A, xload<mode>_A): New insn-and-splits.
2076         (xload_8, xload_<mode>_libgcc, xload_<mode>, loadmem_elpm): New insns.
2077         (mov<mode>): Handle new address spaces.
2078         (movmemhi): Rewrite using avr_emit_movmemhi.
2079         (MOVMEM_r_d): New mode attribute.
2080         (movmem_<mode>, movmem_qi_elpm): New insns.
2081         (setmemhi, *clrmemqi, *clrmemhi, strlenhi, *strlenhi): Unquote
2082         C-code.  Use label instead of hard-coded instrunction lengths.
2083
2084 2011-11-18  Martin Jambor  <mjambor@suse.cz>
2085
2086         PR tree-optimization/50605
2087         * gimple.c (is_gimple_ip_invariant_address): Also handle MEM_REFs
2088         of IPA invariant decls.
2089
2090 2011-11-18  Bill Schmidt  <wschmidt@linux.vnet.ibm.com>
2091
2092         * tree-outof-ssa.c (insert_back_edge_copies):  Add call to
2093         mark_dfs_back_edges.
2094
2095 2011-11-18  Iain Sandoe  <iains@gcc.gnu.org>
2096
2097         PR target/49992
2098         * configure.ac: Remove ranlib special-casing for Darwin.
2099         * configure: Regenerate.
2100
2101 2011-11-18  Uros Bizjak  <ubizjak@gmail.com>
2102
2103         PR tree-optimization/51118
2104         * fold-const.c (fold_checksum_tree): Check for TS_TYPED structure
2105         before using TREE_TYPE accessor on expr.
2106
2107 2011-11-17  Jan Hubicka  <jh@suse.cz>
2108
2109         PR bootstrap/51134
2110         * i386.c (atom_cost): Fix 32bit memset description.
2111         (expand_set_or_movmem_via_loop_with_iter): Output proper bounds check
2112         for epilogue loops.
2113         (expand_movmem_epilogue): Handle epilogues up to size 15 w/o producing
2114         byte loop.
2115         (decide_alg): sse_loop is not useable wthen SSE2 is disabled;
2116         when not optimizing always use rep movsb or lincall; do not produce
2117         word sized loops when optimizing memset for size (to avoid need
2118         for large constants).
2119         (ix86_expand_movmem): Get into sync with ix86_expand_setmem;
2120         choose unroll factors better; always do 128bit moves when producing
2121         SSE loops; do not produce loopy epilogue when size is too small.
2122         (promote_duplicated_reg_to_size): Do not look into desired alignments
2123         when doing vector expansion.
2124         (ix86_expand_setmem): Track better when promoted value is available;
2125         choose unroll factors more sanely. Output loopy epilogue only
2126         when needed.
2127
2128 2011-11-17  Steve Ellcey  <sje@cup.hp.com>
2129
2130         PR middle-end/51144
2131         * output.h (fprint_w): Remove.
2132         * final.c (fprint_w): Remove.
2133         (output_addr_const): Change fprint_w back to fprintf.
2134
2135 2011-11-17  Andrew Pinski  <apinski@cavium.com>
2136
2137         * config/host-linux.c (TRY_EMPTY_VM_SPACE): Define for MIPS.
2138
2139 2011-11-17  Andrew MacLeod  <amacleod@redhat.com>
2140
2141         * builtins.c (expand_builtin): Remove 4th parameter representing
2142         weak/strong mode when __atomic_compare_exchange becomes a library call.
2143
2144 2011-11-17  Richard Henderson  <rth@redhat.com>
2145
2146         * config/rs6000/rs6000.c (rs6000_expand_atomic_compare_and_swap): Get
2147         new pseudo for target after convert_modes.
2148         (rs6000_expand_atomic_exchange, rs6000_expand_atomic_op): Likewise.
2149
2150 2011-11-17  Richard Henderson  <rth@redhat.com>
2151
2152         * config/rs6000/rs6000.c (rs6000_expand_atomic_compare_and_swap): Get
2153         new pseudo for target after convert_modes.
2154         (rs6000_expand_atomic_exchange, rs6000_expand_atomic_op): Likewise.
2155
2156 2011-11-17  Richard Henderson  <rth@redhat.com>
2157
2158         * builtins.c (expand_builtin_mem_thread_fence): Remove.
2159         (expand_builtin_mem_signal_fence): Remove.
2160         (expand_builtin_atomic_thread_fence): Use expand_mem_thread_fence.
2161         (expand_builtin_sync_synchronize): Likewise.
2162         (expand_builtin_atomic_signal_fence): Use expand_mem_signal_fence.
2163         * optabs.c (expand_asm_memory_barrier): Split out from
2164         expand_builtin_mem_signal_fence.
2165         (expand_mem_thread_fence): New, a combination of code from
2166         expand_builtin_mem_thread_fence and expand_builtin_sync_synchronize.
2167         (expand_mem_signal_fence): Moved and renamed from
2168         expand_builtin_mem_signal_fence.
2169         (expand_atomic_exchange): Use expand_mem_thread_fence.
2170         (expand_atomic_load, expand_atomic_store): Likewise.
2171         * expr.h, optabs.h: Update decls.
2172
2173 2011-11-17  Bin Cheng  <bin.cheng@arm.com>
2174
2175         PR rtl-optimization/50663
2176         * cprop.c (implicit_set_indexes): New global variable.
2177         (insert_set_in_table): Add additional parameter and record implicit
2178         set information.
2179         (hash_scan_set): Add additional parameter and pass it to above.
2180         (hash_scan_insn): Pass false to hash_scan_set.
2181         (compute_hash_table_work): Pass true to hash_scan_set.
2182         (compute_cprop_data): Add implicit set to AVIN of block which the
2183         implicit set is recorded for.
2184         (one_cprop_pass): Handle implicit_set_indexes array.
2185
2186 2011-11-17  Michael Matz  <matz@suse.de>
2187
2188         PR middle-end/50644
2189         PR middle-end/50741
2190         * tree-ssa-live.c (mark_all_vars_used_1): Recurse only for decls of
2191         current function.
2192         (remove_unused_locals): Ditto.
2193
2194 2011-11-16  Richard Henderson  <rth@redhat.com>
2195
2196         * config/alpha/alpha.c (alpha_split_compare_and_swap_12): Copy
2197         ALIAS_SET_MEMORY_BARRIER when creating a new memory.
2198         (alpha_split_atomic_exchange_12): Likewise.
2199         * config/rs6000/rs6000.c (rs6000_adjust_atomic_subword): Likewise.
2200
2201 2011-11-16  Joseph Myers  <joseph@codesourcery.com>
2202
2203         * config/i386/i386elf.h (PREFERRED_DEBUGGING_TYPE): Remove.
2204
2205 2011-11-16  David Edelsohn  <dje.gcc@gmail.com>
2206
2207         * config/rs6000/rs6000.c (rs6000_xcoff_section_type_flags):
2208         Default to minimum alignment if decl is NULL.
2209
2210 2011-11-16  Uros Bizjak  <ubizjak@gmail.com>
2211
2212         * config/i386/sse.md (round<mode>2_vec_pack_sfix): Optimize V2DFmode
2213         sequence for AVX.
2214         (<sse4_1>_round<ssemodesuffix>_vec_pack_sfix<avxsizesuffix>): Ditto.
2215
2216 2011-11-16  Venkataramanan Kumar  <venkataramanan.kumar@amd.com>
2217
2218         * doc/invoke.texi: Document AMD bdver1 and btver1.
2219
2220 2011-11-16  Richard Earnshaw  <rearnsha@arm.com>
2221             Bernd Schmidt <bernds@coudesourcery.com>
2222             Sebastian Huber <sebastian.huber@embedded-brains.de>
2223
2224         PR target/49641
2225         * config/arm/arm.c (store_multiple_sequence): Avoid cases where
2226         the base reg is stored iff compiling for Thumb1.
2227
2228 2011-11-16  Razya Ladelsky  <razya@il.ibm.com>
2229
2230         PR tree-optimization/49960
2231         * tree-data-ref.c (initialize_data_dependence_relation): Add
2232         initializations.
2233         Remove call to compute_self_dependence.
2234         (compute_affine_dependence): Remove the !DDR_SELF_REFERENCE condition.
2235         (compute_self_dependence): Remove old code. Add call to
2236         compute_affine_dependence.
2237         (compute_all_dependences): Remove call to compute_self_dependence.
2238         Add call to compute_affine_dependence.
2239
2240 2011-11-16  Andreas Krebbel  <Andreas.Krebbel@de.ibm.com>
2241
2242         PR middle-end/50325
2243         * expmed.c (store_bit_field_1): Use extract_bit_field on big
2244         endian targets if the source cannot be exactly covered by word
2245         mode chunks.
2246
2247 2011-11-15  Joseph Myers  <joseph@codesourcery.com>
2248
2249         * config/i386/i386elf.h (ASM_OUTPUT_ASCII): Change STRING_LIMIT to
2250         ELF_STRING_LIMIT.
2251
2252 2011-11-15  Richard Henderson  <rth@redhat.com>
2253
2254         * config/alpha/alpha.c (alpha_pre_atomic_barrier): New.
2255         (alpha_post_atomic_barrier): New.
2256         (alpha_split_atomic_op): New memmodel argument; honor it.
2257         (alpha_split_compare_and_swap): Take array of operands.  Honor
2258         memmodel; always set bool output
2259         (alpha_expand_compare_and_swap_12): Similarly.
2260         (alpha_split_compare_and_swap_12): Similarly.
2261         (alpha_split_atomic_exchange): Similarly.  Rename from
2262         alpha_split_lock_test_and_set.
2263         (alpha_expand_atomic_exchange_12): Similarly.  Rename from
2264         alpha_expand_lock_test_and_set_12.
2265         (alpha_split_atomic_exchange_12): Similarly.  Rename from
2266         alpha_split_lock_test_and_set_12.
2267         * config/alpha/alpha-protos.h: Update.
2268         * config/alpha/alpha.md (UNSPECV_CMPXCHG): New.
2269         * config/alpha/constraints.md ("w"): New.
2270         * config/alpha/predicates.md (mem_noofs_operand): New.
2271         * config/alpha/sync.md (atomic_compare_and_swap<mode>): Rename from
2272         sync_compare_and_swap<mode>; add the new parameters.
2273         (atomic_exchange<mode>): Update from sync_test_and_set<mode>.
2274         (atomic_fetch_<op><mode>): Update from sync_old_<op><mode>.
2275         (atomic_<op>_fetch<mode>): Update from sync_new_<op><mode>.
2276         (atomic_<op><mode>): Update from sync_<op><mode>.
2277
2278 2011-11-16  Tom de Vries  <tom@codesourcery.com>
2279
2280         * tree-ssa-tail-merge.c (replace_block_by): Add frequency of bb2 to bb1.
2281
2282 2011-11-16  Alan Modra  <amodra@gmail.com>
2283
2284         PR rtl-optimization/51051
2285         PR bootstrap/51086
2286         * function.c (thread_prologue_and_epilogue_insns): Guard
2287         emitting return with single_succ_p test.
2288
2289 2011-11-15  Joern Rennecke  <joern.rennecke@embecosm.com>
2290
2291         * config/epiphany/epiphany.md (mov<mode>cc): Fix code to
2292         get mode from CMP_OP1 if CMP_OP0 is VOIDmode.
2293
2294 2011-11-15  Uros Bizjak  <ubizjak@gmail.com>
2295
2296         * config/i386/sse.md (vec_pack_trunc_v2df): Optimize sequence for AVX.
2297         (vec_pack_sfix_trunc_v2df): Ditto.
2298         (vec_pack_sfix_v2df): Ditto.
2299         (vec_pack_sfix_trunc_v4df): Generate fix_truncv4dfv4si2 and
2300         avx_vec_concatv8si patterns.
2301         (vec_pack_sfix_v4df): Generate avx_cvtpd2dq256 and
2302         avx_vec_concatv8si patterns.
2303
2304 2011-11-15  Torvald Riegel  <triegel@redhat.com>
2305
2306         * c-parser.c (c_parser_transaction_expression): Require parentheses
2307         when parsing transaction expressions.
2308
2309 2011-11-15  Tristan Gingold  <gingold@adacore.com>
2310
2311         * incpath.c (get_added_cpp_dirs): New function.
2312         * incpath.h (get_added_cpp_dirs): Declare.
2313         * config/vms/vms-c.c (vms_c_register_includes): New function.
2314         (vms_std_modules): New variable.
2315         * config/vms/vms.h (TARGET_EXTRA_INCLUDES): Define.
2316         (vms_c_register_includes): Declare.
2317
2318 2011-11-15  Tristan Gingold  <gingold@adacore.com>
2319
2320         * c-family/c-pragma.h (pragma_extern_prefix): Declare.
2321         * c-family/c-pragma.c (pragma_extern_prefix): Make it public.
2322         * config/vms/vms-c.c (saved_extern_prefix): New variable.
2323         (vms_pragma_extern_prefix): New function.
2324         (vms_c_register_pragma): Register vms_pragma_extern_prefix.
2325
2326 2011-11-15  Georg-Johann Lay  <avr@gjlay.de>
2327
2328         PR target/49868
2329         * config/avr/avr.h (ADDR_SPACE_PGM): New address spaces.
2330         (REGISTER_TARGET_PRAGMAS): New define.
2331         * config/avr/avr-protos.h (avr_mem_pgm_p): New.
2332         (avr_load_libgcc_p): New.
2333         (avr_register_target_pragmas): New.
2334         (asm_output_external_libcall): Remove.
2335         (avr_log_t): Add field "progmem".  Order alphabetically.
2336         * config/avr/avr-log.c (avr_log_set_avr_log): Set avr_log.progmem.
2337         * config/avr/avr-c.c (langhooks.h): New include.
2338         (avr_register_target_pragmas): New function. Register address
2339         space __pgm.
2340         (avr_cpu_cpp_builtins): Add built-in define __PGM.
2341
2342         * config/avr/avr.c: Include "c-family/c-common.h".
2343         (TARGET_LEGITIMATE_ADDRESS_P): Remove define.
2344         (TARGET_LEGITIMIZE_ADDRESS): Remove define.
2345         (TARGET_ADDR_SPACE_SUBSET_P): Define to...
2346         (avr_addr_space_subset_p): ...this new static function.
2347         (TARGET_ADDR_SPACE_CONVERT): Define to...
2348         (avr_addr_space_convert): ...this new static function.
2349         (TARGET_ADDR_SPACE_ADDRESS_MODE): Define to...
2350         (avr_addr_space_address_mode): ...this new static function.
2351         (TARGET_ADDR_SPACE_POINTER_MODE): Define to...
2352         (avr_addr_space_pointer_mode): ...this new static function.
2353         (TARGET_ADDR_SPACE_LEGITIMATE_ADDRESS_P): Define to...
2354         (avr_addr_space_legitimate_address_p): ...this new static function.
2355         (TARGET_ADDR_SPACE_LEGITIMIZE_ADDRESS): Define to...
2356         (avr_addr_space_legitimize_address): ...this new static function.
2357         (avr_mode_code_base_reg_class): Handle address spaces.
2358         (avr_regno_mode_code_ok_for_base_p): Ditto.
2359         (lpm_addr_reg_rtx, lpm_reg_rtx, all_regs_rtx): New static variables.
2360         (avr_option_override): Initialize them.
2361         (output_reload_in_const): Use all_regs_rtx. Fix signedness of loop
2362         variables.
2363         (avr_pgm_segment): New static function.
2364         (avr_decl_pgm_p, avr_mem_pgm_p): New static functions.
2365         (avr_out_lpm, avr_out_lpm_no_lpmx): New static functions.
2366         (output_movqi, output_movhi, output_movsisf, avr_out_movpsi): Call
2367         avr_out_lpm to handle loads from progmem.
2368         (avr_load_libgcc_p): New static function.
2369         (avr_progmem_p): Test if decl is in flash.
2370         (avr_pgm_pointer_const_p): New static function.
2371         (avr_nonconst_pointer_addrspace): New static function.
2372         (avr_pgm_check_var_decl): New static function.
2373         (avr_insert_attributes): Use it.  Change error message to report
2374         cause (progmem or address space) when code wants to write to flash.
2375         (avr_section_type_flags): Unset section flag SECTION_BSS for
2376         data in progmem.
2377
2378         * config/avr/predicates.md (nop_general_operand): New predicate.
2379         (nox_general_operand): New predicate.
2380         * config/avr/avr.md (LPM_REGNO): New define_constant.
2381         (load<mode>_libgcc): New expander.
2382         (*load.<mode>.libgcc): New insn.
2383         (mov<mode>): Handle loads from non-generic AS.
2384         (movmemhi): Ditto.  Propagate address space information to newly
2385         created MEM.
2386         (movqi_insn, *movhi, *movpsi, *movsi, *movsf): Change predicate #1
2387         to nox_general_operand.
2388         (ashrqi3, ashrhi3, ashrsi3): Change predicate #1 to
2389         nop_general_operand.
2390         (ashlqi3, *ashlqi3, ashlhi3, ashlsi3): Ditto.
2391         (lshrqi3, *lshrqi3, lshrhi3, lshrsi3): Ditto.
2392         (split-lpmx): New split.
2393         (*ashlhi3_const, *ashlsi3_const, *ashrhi3_const, *ashrsi3_const,
2394         *lshrhi3_const, *lshrsi3_const): Indent, unquote C.
2395
2396 2011-11-15  Maxim Kuvyrkov  <maxim@codesourcery.com>
2397
2398         * ipa-cp.c (ipa_value_from_jfunc): Make global.
2399         (ipa_cst_from_jfunc): Remove, use ipa_value_from_jfunc instead.
2400         (get_indirect_edge_target): Rename, make global.
2401         (devirtualization_time_bonus, estimate_local_effects,)
2402         (ipcp_discover_new_direct_edges): Update.
2403         * ipa-inline-analysis.c (evaluate_conditions_for_edge):
2404         Generalize to also handle types.  Rename to ...
2405         (evaluate_properties_for_edge): Use instead of
2406         evaluate_conditions_for_edge.
2407         (estimate_edge_devirt_benefit): New function.
2408         (estimate_calls_size_and_time): Use it.
2409         (estimate_node_size_and_time, estimate_ipcp_clone_size_and_time,)
2410         (inline_merge_summary): Update.
2411         (do_estimate_edge_time, do_estimate_edge_growth): Update.  Calculate
2412         parameter information at the call site and pass it on to subroutines.
2413         * tree-inline.c (estimate_num_insns): Distinguish between direct and
2414         indirect calls.
2415         (init_inline_once): Set size and time costs or indirect calls.
2416         * tree-inline.h (eni_weights): Add indirect_call_cost.
2417
2418 2011-11-15  Tom de Vries  <tom@codesourcery.com>
2419
2420         PR tree-optimization/51005
2421         * tree-ssa-tail-merge.c (delete_basic_block_same_succ): Rename to
2422         mark_basic_block_deleted.
2423         (update_worklist): Inline purge_bbs.
2424         (purge_bbs, unlink_virtual_phi, update_vuses, vop_at_entry)
2425         (delete_block_update_dominator_info): Remove.
2426         (replace_block_by): Remove update_vops parameter.  Partially evaluate
2427         for update_vops == false.
2428         (apply_clusters): Remove update_vops parameter.  Remove update_vops
2429         argument in replace_block_by call.
2430         (update_debug_stmts): Remove MAY_HAVE_DEBUG_STMTS test.
2431         (tail_merge_optimize): Remove update_vops argument to apply_clusters.
2432         Remove call to purge_bbs.  Add calls to calculate_dominance_info and
2433         free_dominance_info.  Add MAY_HAVE_DEBUG_STMTS  before calling
2434         update_debug_stmts.  Mark vop var for renaming, if necessary.
2435
2436 2011-11-15  Bernd Schmidt  <bernds@codesourcery.com>
2437
2438         PR rtl-optimization/51051
2439         * cfgrtl.c (cfg_layout_can_merge_blocks_p): Return FALSE if the
2440         move would cause fallthrough into the exit block.
2441
2442 2011-11-14  Richard Henderson  <rth@redhat.com>
2443
2444         * config/rs6000/rs6000.c (emit_load_locked): Assert the mode is
2445         handled.
2446         (emit_store_conditional): Likewise.
2447         (rs6000_pre_atomic_barrier, rs6000_post_atomic_barrier): New.
2448         (rs6000_adjust_atomic_subword): New.
2449         (rs6000_mask_atomic_subword, rs6000_finish_atomic_subword): New.
2450         (rs6000_expand_atomic_op): Rename from rs6000_emit_sync; rewrite
2451         for pre-reload expansion.
2452         (rs6000_split_compare_and_swap, rs6000_split_compare_and_swapqhi,
2453         rs6000_expand_compare_and_swapqhi): Merge into ...
2454         (rs6000_expand_atomic_compare_and_swap): ... here.  New function.
2455         rs6000_split_lock_test_and_set; expand immediately.  Handle
2456         QImode and HImode.
2457         * config/rs6000/rs6000.md (UNSPEC_LWSYNC): Move and rename
2458         from UNSPECV_LWSYNC.
2459         * config/rs6000/sync.md (fetchopsi_constr, fetchopdi_constr): Remove.
2460         (mem_thread_fence): New.
2461         (hwsync): Rename from memory_barrier.
2462         (*hwsync): Rename from *sync_internal.
2463         (lwsync, *lwsync): Mirror hwsync implementation.
2464         (isync): Don't reference memory.
2465         (loadsync): New.
2466         (atomic_load<INT>, atomic_store<INT>): New.
2467         (ATOMIC): New mode iterator.
2468         (load_locked<ATOMIC>): Rename from load_locked_<GPR>.
2469         (store_conditional<ATOMIC>): Rename from store_conditional_<GPR>.
2470         (sync_compare_and_swap<GPR>): Remove.
2471         (sync_compare_and_swaphi, sync_compare_and_swapqi): Remove.
2472         (sync_compare_and_swapqhi_internal): Remove.
2473         (sync_lock_test_and_set<GPR>): Remove.
2474         (sync_<FETCHOP><INT1>): Remove.
2475         (*sync_<FETCHOP>si_internal, *sync_<FETCHOP>di_internal): Remove.
2476         (sync_nand<INT1>, *sync_nand<GPR>_internal): Remove.
2477         (sync_old_<FETCHOP><GPR>): Remove.
2478         (*sync_old_<FETCHOP>si_internal): Remove.
2479         (*sync_old_<FETCHOP>di_internal): Remove.
2480         (sync_old_nand<INT1>): Remove.
2481         (*sync_old_nand<GPR>_internal): Remove.
2482         (sync_new_<FETCHOP><GPR>): Remove.
2483         (*sync_new_<FETCHOP>si_internal): Remove.
2484         (*sync_new_<FETCHOP>di_internal): Remove.
2485         (sync_new_nand<INT1>): Remove.
2486         (*sync_new_nand<GPR>_internal): Remove.
2487         (*atomic_andsi, *atomic_anddi): Remove.
2488         (*sync_addshort_internal, *sync_subshort_internal): Remove.
2489         (*sync_andsi_internal, *sync_boolsi_internal): Remove.
2490         (*sync_boolcshort_internal): Remove.
2491         (sync_lock_release<INT1>): Remove.
2492         (atomic_compare_and_swap<INT1>): New.
2493         (atomic_exchange<INT1>): New.
2494         (atomic_<FETCHOP><INT1>, atomic_nand<INT1>): New.
2495         (atomic_fetch_<FETCHOP><INT1>, atomic_fetch_nand<INT1>): New.
2496         (atomic_<FETCHOP>_fetch<INT1>, atomic_nand_fetch<INT1>): New.
2497
2498 2011-11-14  Uros Bizjak  <ubizjak@gmail.com>
2499
2500         * config/i386/sse.md (round<mode>2): Use register_operand for
2501         operand 1 predicate.
2502         (round<mode>2_sfix): Ditto.
2503         (round<mode>2_vec_pack_sfix): Ditto for operand 1 and operand 2.
2504
2505 2011-11-14  Nathan Sidwell  <nathan@acm.org>
2506
2507         * gcov.c (canonicalize_name): Protect use of S_ISLNK.
2508
2509 2011-11-14  Jan Hubicka  <jh@suse.cz>
2510
2511         PR target/51126
2512         * config/i386/i386.c (core cost model): Correct pasto.
2513
2514 2011-11-14  Uros Bizjak  <ubizjak@gmail.com>
2515
2516         * config/i386/sse.md (round<mode>2_sfix): New expander.
2517         (round<mode>2_vec_pack_sfix): Ditto.
2518         (<sse4_1>_round<ssemodesuffix>_sfix<avxsizesuffix>): Ditto.
2519         (<sse4_1>_round<ssemodesuffix>_vec_pack_sfix<avxsizesuffix>): Ditto.
2520         * config/i386/builtin-types.def (V4SI_FTYPE_V4SF_ROUND,
2521         V8SI_FTYPE_V8SF_ROUND, V4SI_FTYPE_V2DF_V2DF_ROUND,
2522         V8SI_FTYPE_V4DF_V4DF_ROUND): New builtin types.
2523         * config/i386/i386.c (ix86_builtins): Add
2524         IX86_BUILTIN_{FLOORPD,CEILPD,ROUNDPD_AZ}_VEC_PACK_SFIX{,256} and
2525         IX86_BUILTIN_{FLOORPS,CEILPS,ROUNDPS_AZ}_SFIX{,256} defines.
2526         (bdesc_args): Add __builtin_ia32_{floorpd,ceilpd}_vec_pack_sfix{,256},
2527         __builtin_ia32_roundpd_az_vec_pack_sfix{,256},
2528         __builtin_ia32_{floorps,ceilps}_sfix{,256}and
2529         __builtin_ia32_roundps_az_sfix{,256} descriptions.
2530         (ix86_expand_sse_round_vec_pack_sfix): New.
2531         (ix86_expand_args_builtin): Handle V4SI_FTYPE_V4SF_ROUND,
2532         V8SI_FTYPE_V8SF_ROUND, V4SI_FTYPE_V2DF_V2DF_ROUND and
2533         V8SI_FTYPE_V4DF_V4DF_ROUND types.  Check last argument of
2534         CODE_FOR_sse4_1_roundpd_vec_pack_sfix, CODE_FOR_sse4_1_roundps_sfix,
2535         CODE_FOR_avx_roundpd_vec_pack_sfix256 and CODE_FOR_avx_roundps_sfix256.
2536         (ix86_builtin_vectorized_function): Handle
2537         BUILT_IN_{I,L,LL}FLOOR{,F}, BUILT_IN_{I,L,LL}CEIL{,F} and
2538         BUILT_IN_{I,L,LL}ROUND{,F}
2539
2540 2011-11-14  Jan Hubicka  <jh@suse.cz>
2541
2542         PR middle-end/50598
2543         * cgraph.h (varpool_externally_visible_p): Declare.
2544         (varpool_add_new_variable): Declare.
2545         * tree-emultls.c (get_emutls_init_templ_addr,
2546         new_emutls_decl): Use varpool_add_new_variable.
2547         * ipa.c (varpool_externally_visible_p): Export.
2548         * varpool.c (varpool_add_new_variable): New function.
2549
2550 2011-11-14  Michael Zolotukhin  <michael.v.zolotukhin@gmail.com>
2551             Jan Hubicka  <jh@suse.cz>
2552
2553         * config/i386/i386.h (processor_costs): Add second dimension to
2554         stringop_algs array.
2555         * config/i386/i386.c (cost models): Initialize second dimension of
2556         stringop_algs arrays.
2557         (core_cost): New costs based on generic64 costs with updated stringop
2558         values.
2559         (promote_duplicated_reg): Add support for vector modes, add
2560         declaration.
2561         (promote_duplicated_reg_to_size): Likewise.
2562         (processor_target): Set core costs for core variants.
2563         (expand_set_or_movmem_via_loop_with_iter): New function.
2564         (expand_set_or_movmem_via_loop): Enable reuse of the same iters in
2565         different loops, produced by this function.
2566         (emit_strset): New function.
2567         (expand_movmem_epilogue): Add epilogue generation for bigger sizes,
2568         use SSE-moves where possible.
2569         (expand_setmem_epilogue): Likewise.
2570         (expand_movmem_prologue): Likewise for prologue.
2571         (expand_setmem_prologue): Likewise.
2572         (expand_constant_movmem_prologue): Likewise.
2573         (expand_constant_setmem_prologue): Likewise.
2574         (decide_alg): Add new argument align_unknown.  Fix algorithm of
2575         strategy selection if TARGET_INLINE_ALL_STRINGOPS is set; Skip sse_loop
2576         (decide_alignment): Update desired alignment according to chosen move
2577         mode.
2578         (ix86_expand_movmem): Change unrolled_loop strategy to use SSE-moves.
2579         (ix86_expand_setmem): Likewise.
2580         (ix86_slow_unaligned_access): Implementation of new hook
2581         slow_unaligned_access.
2582         * config/i386/i386.md (strset): Enable half-SSE moves.
2583         * config/i386/sse.md (vec_dupv4si): Add expand for vec_dupv4si.
2584         (vec_dupv2di): Add expand for vec_dupv2di.
2585
2586 2011-11-14  Dimitrios Apostolou  <jimis@gmx.net>
2587
2588         PR bootstrap/51094
2589         PR middle-end/51116
2590         * config/elfos.h (TARGET_ASM_INTERNAL_LABEL): Remove.
2591         * varasm.c (default_elf_internal_label): Remove.
2592
2593 2011-11-14  Kai Tietz  <ktietz@redhat.com>
2594
2595         * gcov.c (generate_results): Add missing semicolon and correct indent.
2596
2597 2011-11-14  Ira Rosen  <ira.rosen@linaro.org>
2598
2599         PR bootstrap/51112
2600         * tree-vect-stmts.c (vectorizable_condition): Initialize comp_vectype.
2601
2602 2011-11-14  Mingjie Xing  <mingjie.xing@gmail.com>
2603
2604         * doc/invoke.texi (Wunused-result): Change @pxref{Variable Attributes}
2605         to @pxref{Function Attributes}.
2606
2607 2011-11-13  Oleg Endo  <oleg.endo@t-online.de>
2608
2609         PR target/50694
2610         * config/sh/sh.h (IS_LITTLE_ENDIAN_OPTION, UNSUPPORTED_SH2A):
2611         New macros.
2612         (DRIVER_SELF_SPECS): Use new macros to filter out unsupported options
2613         taking the default configuration into account.
2614
2615 2011-11-13  Jonathan Wakely  <jwakely.gcc@gmail.com>
2616
2617         * doc/install.texi (Specific): Fix anchor for
2618         x86_64-*-solaris2.1[0-9]*.
2619
2620 2011-11-13  Nathan Sidwell  <nathan@acm.org>
2621
2622         * gcov.c (source_prefix, source_length): New globals.
2623         (flag_relative_only): Likewise.
2624         (print_usage, options, process_args): Update.
2625         (generate_results): Use coverage.name, check
2626         flag_relative_only. Adjust messages.
2627         (find_source): Check source_prefix.
2628         (output_lines): Use coverage.name, adjust messages.
2629         * doc/gcov.texi (Invoking Gcov): Document new options.
2630
2631 2011-11-12  Jason Merrill  <jason@redhat.com>
2632
2633         PR c++/51060
2634         * gimplify.c (gimplify_target_expr): Add a clobber to the cleanup.
2635         (gimplify_modify_expr): Don't try to simplify it.
2636
2637 2011-11-12  Dimitrios Apostolou  <jimis@gmx.net>
2638
2639         PR bootstrap/51094
2640         * config/elfos.h (STRING_ASM_OP): Define.
2641         * varasm.c (default_elf_asm_output_limited_string): Use it.
2642
2643         PR bootstrap/51094
2644         * gcc/configure.ac: Check for stpcpy declaration.
2645         * system.h: Declare it if not.
2646         * config.in, configure: Regenerate.
2647
2648 2011-11-12  Richard Henderson  <rth@redhat.com>
2649
2650         * config/rs6000/rs6000.md (fix_trunc<SFDF>si2_stfiwx): Use
2651         nonimmediate_operand for the destination.
2652         (fixuns_trunc<SFDF>si2_stfiwx): Likewise.
2653
2654         * builtins.c (expand_builtin_compare_and_swap): If target is const0,
2655         don't pass the target to expand_atomic_compare_and_swap.
2656         (expand_builtin_atomic_compare_exchange): Likewise.
2657
2658         * config/sh/linux.h (TARGET_INIT_LIBFUNCS): New.
2659         * config/sh/sh.c (sh_init_sync_libfuncs): New.
2660
2661         * config/pa/pa-linux.h (TARGET_SYNC_LIBCALL): New.
2662         * config/pa/pa.h (TARGET_SYNC_LIBCALL): New default.
2663         * config/pa/pa.c (pa_init_libfuncs): Use init_sync_libfuncs.
2664
2665 2011-11-12  Iain Sandoe  <iains@gcc.gnu.org>
2666
2667         PR target/45233
2668         * config/rs6000/rs6000.c (rs6000_legitimize_reload_address):
2669         Only expand a symbol ref. into an access when the entity is defined
2670         in the TU.
2671
2672 2011-11-12  Jan Hubicka  <jh@suse.cz>
2673
2674         PR bootstrap/50822
2675         * cgraphunit.c (output_weakrefs): Output really only weakrefs.
2676
2677 2011-11-12  Nathan Sidwell  <nathan@acm.org>
2678
2679         * gcov.c (struct name_map): New.
2680         (names, n_names, a_names): New global vars.
2681         (print_usage): Adjust usage.
2682         (generate_results): Canonicalize main file name.
2683         (release_structures): Adjust.
2684         (name_search, name_sort): New callbacks.
2685         (find_source): Look for and create a canonical name.
2686         (canonicalize_name): New.
2687         (make_gcov_file_name): Reimplement and fix mangling.
2688         (mangle_name): New.
2689         * doc/gcov.texi: Update documentation about path preservation.
2690
2691 2011-11-11  David S. Miller  <davem@davemloft.net>
2692
2693         * config/sparc/linux.h (ASM_GENERATE_INTERNAL_LABEL): Delete.
2694         * config/sparc/linux64.h (ASM_GENERATE_INTERNAL_LABEL): Delete.
2695
2696 2011-11-11  Jakub Jelinek  <jakub@redhat.com>
2697
2698         * config/i386/i386-protos.h (ix86_maybe_emit_epilogue_vzeroupper):
2699         New prototype.
2700         * config/i386/i386.c (ix86_maybe_emit_epilogue_vzeroupper): New
2701         function.
2702         (ix86_expand_epilogue): Use it.
2703         * config/i386/i386.md (return, simple_return): Call it in the
2704         expanders.
2705
2706         PR tree-optimization/51091
2707         * tree-stdarg.c (execute_optimize_stdarg): Ignore TREE_CLOBBER_P
2708         rhs also in the va_list_simple_ptr case.
2709
2710         PR tree-optimization/51058
2711         * tree-vect-slp.c (vect_remove_slp_scalar_calls): New function.
2712         (vect_schedule_slp): Call it.
2713         * tree-vect-stmts.c (vectorizable_call): If slp_node != NULL,
2714         don't replace scalar calls with setting of their lhs to zero here.
2715
2716         PR tree-optimization/51074
2717         * fold-const.c (vec_cst_ctor_to_array, fold_vec_perm): New functions.
2718         (fold_binary_loc): Handle VEC_EXTRACT_EVEN_EXPR,
2719         VEC_EXTRACT_ODD_EXPR, VEC_INTERLEAVE_HIGH_EXPR and
2720         VEC_INTERLEAVE_LOW_EXPR with VECTOR_CST or CONSTRUCTOR operands.
2721         (fold_ternary_loc): Handle VEC_PERM_EXPR with VECTOR_CST or
2722         CONSTRUCTOR operands.
2723         * tree-ssa-propagate.c (valid_gimple_rhs_p): Handle ternary
2724         expressions.
2725         * tree-vect-generic.c (lower_vec_perm): Mask sel_int elements
2726         to 0 .. 2 * elements - 1.
2727
2728 2011-11-11  Richard Henderson  <rth@redhat.com>
2729
2730         * gimple-pretty-print.c (dump_gimple_omp_atomic_load): Dump needed.
2731         (dump_gimple_omp_atomic_store): Likewise.
2732         * optabs.c (can_atomic_exchange_p): New.
2733         * optabs.h (can_atomic_exchange_p): Declare.
2734         * omp-low.c (expand_omp_atomic_load): Implement.
2735         (expand_omp_atomic_store): Likewise.
2736         (expand_omp_atomic): Update for new arguments to load/store.
2737
2738 2011-11-11  Eric Botcazou  <ebotcazou@adacore.com>
2739
2740         * cprop.c: Adjust outdated comments throughout.
2741         (hash_scan_set): Rename PAT parameter into SET.
2742         (cprop_pavloc): Rename into...
2743         (cprop_avloc): ...this.
2744         (cprop_absaltered): Rename into...
2745         (cprop_kill): ...this.
2746         (alloc_cprop_mem): Adjust for above renaming.
2747         (free_cprop_mem): Likewise.
2748         (compute_cprop_data): Likewise.
2749         (compute_local_properties): Rename TRANSP parameter into KILL and
2750         adjust throughout.  Rework comments.
2751         (try_replace_reg): Fix long line.
2752         (cprop_jump): Likewise.
2753         (constprop_register): Fix prototype and take INSN last.
2754         (cprop_insn): Adjust calls to above function.  Fix long lines.
2755         (bypass_block): Likewise.
2756         (one_cprop_pass): Likewise.
2757
2758 2011-11-11  Uros Bizjak  <ubizjak@gmail.com>
2759
2760         * config/alpha/elf.h (ELF_ASCII_ESCAPES): Rename from ESCAPES.
2761         (ELF_STRING_LIMIT): Rename from STRING_LIMIT.
2762
2763 2011-11-11  Jason Merrill  <jason@redhat.com>
2764
2765         * varasm.c (default_elf_asm_output_limited_string): #ifdef
2766         ELF_ASCII_ESCAPES.
2767         (default_elf_asm_output_ascii): Likewise.
2768
2769 2011-11-11  Uros Bizjak  <ubizjak@gmail.com>
2770
2771         PR target/50762
2772         * config/i386/constraints.md (j): New address constraint.
2773         * config/i386/predicates.md (lea_address_operand): Redefine as
2774         special predicate.
2775         * config/i386/i386.md (*lea_3_zext): Use "j" constraint for operand 1.
2776         (*lea_4_zext): Ditto.
2777
2778 2011-11-11  David S. Miller  <davem@davemloft.net>
2779
2780         Revert
2781         2011-11-05  David S. Miller  <davem@davemloft.net>
2782
2783         * config/sparc/sparc.md (UNSPEC_SHORT_LOAD): New unspec.
2784         (zero-extend_v8qi_vis, zero_extend_v4hi_vis): New expanders.
2785         (*zero_extend_v8qi_<P:mode>_insn,
2786         *zero_extend_v4hi_<P:mode>_insn): New insns.
2787         * config/sparc/sparc.c (vector_init_move_words,
2788         vector_init_prepare_elts, sparc_expand_vector_init_vis2,
2789         sparc_expand_vector_init_vis1): New functions.
2790         (vector_init_bshuffle): Rewrite to handle more cases and make use
2791         of locs[] array prepared by vector_init_prepare_elts.
2792         (vector_init_fpmerge, vector_init_faligndata): Delete.
2793         (sparc_expand_vector_init): Rewrite using new infrastructure.
2794
2795 2011-11-11  Jakub Jelinek  <jakub@redhat.com>
2796
2797         * opts-common.c (generate_canonical_option): Free opt_text
2798         it it has been allocated here and not stored anywhere.
2799
2800         * tree-vect-slp.c (vect_free_slp_tree): Also free SLP_TREE_CHILDREN
2801         vector.
2802         (vect_create_new_slp_node): Don't allocate node before checking stmt
2803         type.
2804         (vect_free_oprnd_info): Remove FREE_DEF_STMTS argument, always
2805         free def_stmts vectors and additionally free oprnd_info.
2806         (vect_build_slp_tree): Adjust callers.  Call it even if
2807         stop_recursion.  If vect_create_new_slp_node or
2808         vect_build_slp_tree fails, properly handle freeing memory.
2809         If it succeeded, clear def_stmts in oprnd_info.
2810
2811 2011-11-11  Dimitrios Apostolou  <jimis@gmx.net>
2812
2813         * defaults.h (ASM_OUTPUT_LABEL, ASM_OUTPUT_INTERNAL_LABEL): Expand on
2814         multiple lines for readability.
2815         * output.h (fprint_whex, fprint_w, fprint_ul, sprint_ul): Declare.
2816         (ASM_OUTPUT_LABELREF): Call fputs instead of asm_fprintf.
2817         * dwarf2asm.c (dw2_assemble_integer, dw2_asm_output_data,
2818         dw2_asm_data_uleb128, dw2_asm_delta_uleb128,
2819         dw2_asm_delta_sleb128): Convert fprintf calls to the new functions.
2820         * dwarf2out.c (dwarf2out_source_line): Call fprint_ul instead of
2821         fprintf.
2822         * final.c (fprint_whex, fprint_w, fprint_ul, sprint_ul): New functions
2823         serving as fast replacements for fprintf integer to string conversions.
2824         (sprint_ul_rev): Internal helper for the above.
2825         (output_addr_const) <CONST_INT>: Don't use fprintf.
2826         * varasm.c: Fix some whitespace inconsistencies.
2827         (default_elf_asm_output_limited_string): New.
2828         (default_elf_asm_output_ascii): Likewise.
2829         (default_elf_internal_label): Likewise.
2830         * config/elfos.h (ASM_GENERATE_INTERNAL_LABEL): Use sprint_ul and
2831         stpcpy instead of sprintf.
2832         (TARGET_ASM_INTERNAL_LABEL): Define as default_elf_internal_label.
2833         (ELF_ASCII_ESCAPES, ELF_STRING_LIMIT): Rename from old ESCAPES and
2834         STRING_LIMIT macros.
2835         (ASM_OUTPUT_LIMITED_STRING, ASM_OUTPUT_ASCII): Call functions that
2836         provide the same functionality.
2837         * config/i386/i386.c (print_reg): Call fprint_ul instead of fprintf.
2838
2839 2011-11-10  Andrew MacLeod  <amacleod@redhat.com>
2840
2841         * doc/extend.texi: Document __atomic_test_and_set and __atomic_clear.
2842
2843 2011-11-10  Andrew MacLeod  <amacleod@redhat.com>
2844
2845         PR middle-end/51038
2846         * builtins.c (expand_builtin_atomic_clear): New.  Expand atomic_clear.
2847         (expand_builtin_atomic_test_and_set): New.  Expand atomic test_and_set.
2848         (expand_builtin): Add cases for test_and_set and clear.
2849         * sync-builtins.def (BUILT_IN_ATOMIC_TEST_AND_SET): New.
2850         (BUILT_IN_ATOMIC_CLEAR): New.
2851
2852 2011-11-10  Roberto Agostino Vitillo  <ravitillo@lbl.gov>
2853
2854         PR debug/50983
2855         * dwarf2out.c (set_cur_line_info_table): Restore the last is_stmt
2856         value in the current line table.
2857
2858 2011-11-10  Nathan Sidwell  <nathan@acm.org>
2859
2860         * gcov.c (struct function_info): Make src an index, not a pointer.
2861         (struct source_info): Remove index and next source fields.
2862         (fn_end): New static var.
2863         (sources_index): Remove.
2864         (sources): Now a pointer to an array, not a list.
2865         (n_sources, a_sources): New.
2866         (process_file): Adjust for changes to read_graph_file. Insert
2867         functions into source lists and check line numbers here.
2868         (generate_results): Only allocate lines for sources with
2869         contents.  Adjust for source array.
2870         (release_structures): Likewise.
2871         (find_source): Return source index, adjust for source array.
2872         (read_graph_file): Return function list.  Don't insert into source
2873         lists here.
2874         (read_count_file): Take list of functions.
2875         (solve_flow_graph): Reverse the arc lists here.
2876         (add_line_counts): Adjust for source array.
2877
2878 2011-11-10  Jakub Jelinek  <jakub@redhat.com>
2879
2880         PR middle-end/51077
2881         * tree-object-size.c (addr_object_size): Check TREE_CODE of
2882         MEM_REF's operand rather than code of the MEM_REF itself.
2883
2884 2011-11-10  Andrew MacLeod  <amacleod@redhat.com>
2885
2886         PR rtl-optimization/51040
2887         * optabs.c (expand_atomic_fetch_op): Patchup code for NAND should
2888         be AND followed by NOT.
2889         * builtins.c (expand_builtin_atomic_fetch_op): Patchup code for NAND
2890         should be AND followed by NOT.
2891
2892 2011-11-10  Jakub Jelinek  <jakub@redhat.com>
2893
2894         * vec.h (VEC_BASE): If base is at offset 0 in the structure,
2895         use &(P)->base even if P is NULL.
2896
2897         PR rtl-optimization/51023
2898         * combine.c (simplify_comparison) <case SIGN_EXTEND>: Don't use
2899         val_signbit_known_clear_p for signed comparison narrowing
2900         optimization.  Don't check for non-VOIDmode, use
2901         HWI_COMPUTABLE_MODE_P macro.
2902         <case ZERO_EXTEND>: Don't check for non-VOIDmode.
2903         Optimize even when const_op is equal to GET_MODE_MASK (mode),
2904         don't optimize if const_op is negative.
2905
2906 2011-11-10  Richard Guenther  <rguenther@suse.de>
2907
2908         PR tree-optimization/51042
2909         * tree-ssa-pre.c (phi_translate_1): Avoid recursing on
2910         self-referential expressions.  Refactor code to avoid duplication.
2911
2912 2011-11-10  Richard Guenther  <rguenther@suse.de>
2913
2914         PR tree-optimization/51070
2915         * tree-loop-distribution.c (generate_builtin): Do not replace
2916         the loop with a builtin if the partition contains statements which
2917         results are used outside of the loop.
2918         (pass_loop_distribution): Verify and collect.
2919
2920 2011-11-10  Richard Guenther  <rguenther@suse.de>
2921
2922         PR tree-optimization/51030
2923         * tree-ssa-phiopt.c (jump_function_from_stmt): New function.
2924         (value_replacement): Use it to handle trivial non-empty
2925         intermediate blocks.
2926
2927 2011-11-10  Richard Guenther  <rguenther@suse.de>
2928
2929         PR middle-end/51071
2930         * gimple.c (gimple_has_side_effects): Remove checking code
2931         that doesn't belong here.
2932
2933 2011-11-10  Ira Rosen  <ira.rosen@linaro.org>
2934
2935         PR tree-optimization/51058
2936         * tree-vect-slp.c (vect_get_constant_vectors): Handle CALL_EXPR.
2937
2938 2011-11-10  Jakub Jelinek  <jakub@redhat.com>
2939
2940         PR tree-optimization/51000
2941         * tree-vect-patterns.c (vect_recog_bool_pattern): If adding
2942         a pattern stmt for a bool store, adjust DR_STMT too.
2943         Don't handle bool conversions to single bit precision lhs.
2944         * tree-vect-stmts.c (vect_remove_stores): If next is a pattern
2945         stmt, remove its related stmt and free its stmt_vinfo.
2946         (free_stmt_vec_info): Free also pattern stmt's vinfo and
2947         pattern def stmt's vinfo.
2948         * tree-vect-loop.c (destroy_loop_vec_info): Don't try to
2949         free pattern stmt's vinfo here.
2950         (vect_transform_loop): When calling vect_remove_stores,
2951         do gsi_next first and don't call gsi_remove.  If not strided
2952         store, free stmt vinfo for gsi_stmt (si) rather than stmt.
2953
2954 2011-11-09  Jakub Jelinek  <jakub@redhat.com>
2955
2956         PR target/50911
2957         * config/i386/i386.c (expand_vec_perm_interleave2): If d->vmode is
2958         V4SImode, !TARGET_SSE2 and punpck[lh]* is needed, change dremap.vmode
2959         to V4SFmode.
2960
2961         * function.h (requires_stack_frame_p): New prototype.
2962         * function.c (requires_stack_frame_p): No longer static.
2963         * config/i386/i386.c (ix86_finalize_stack_realign_flags): If
2964         stack_realign_fp was just a conservative guess for a function
2965         which doesn't use sp/fp/argp at all, clear frame_pointer_needed
2966         and stack realignment.
2967
2968 2011-11-09  Paolo Carlini  <paolo.carlini@oracle.com>
2969
2970         PR preprocessor/51061
2971         * incpath.c (merge_include_chains): Make sure to not pass null
2972         pointers to free_path.
2973
2974 2011-11-09  Paolo Carlini  <paolo.carlini@oracle.com>
2975
2976         * doc/invoke.texi ([Option Summary, C++ Language Options]):
2977         Add -Wzero-as-null-pointer-constant.
2978
2979 2011-11-07  Matthew Gretton-Dann  <matthew.gretton-dann@arm.com>
2980
2981         * config/arm/arm-cores.def: Add -mcpu=cortex-a7.
2982         * config/arm/arm-tables.opt: Regenerate.
2983         * config/arm/arm-tune.md: Likewise.
2984         * config/arm/bpabi.h (BE8_LINK_SPEC): Add Cortex A-7.
2985         * doc/invoke.texi: Document -mcpu=cortex-a7.
2986
2987 2011-11-09  Richard Guenther  <rguenther@suse.de>
2988
2989         Revert
2990         2011-11-09  Richard Guenther  <rguenther@suse.de>
2991
2992         * tree-cfg.c (verify_gimple_call): Verify that
2993         gimple_call_cannot_inline_p is returning a conservative
2994         correct result according to gimple_check_call_matching_types.
2995
2996 2011-11-09  Richard Guenther  <rguenther@suse.de>
2997
2998         PR tree-optimization/51039
2999         * tree-cfg.c (verify_gimple_call): Verify that
3000         gimple_call_cannot_inline_p is returning a conservative
3001         correct result according to gimple_check_call_matching_types.
3002         * ipa-inline-analysis.c (estimate_function_body_sizes): Remove
3003         code dealing with un-inlinablility.
3004         * gimple-streamer-in.c (input_gimple_stmt): Update the
3005         non-inlinable flag.
3006
3007 2011-11-09  Richard Guenther  <rguenther@suse.de>
3008
3009         PR tree-optimization/51039
3010         * tree-inline.c (setup_one_parameter): Always perform a
3011         valid gimple type change.
3012         (declare_return_variable): Likewise.
3013
3014 2011-11-09  Jakub Jelinek  <jakub@redhat.com>
3015
3016         * config/rs6000/vector.md (vcondv4sfv4si, vcondv4siv4sf,
3017         vconduv4sfv4si): New patterns.
3018         * config/rs6000/rs6000.c (rs6000_emit_vector_cond_expr): Handle
3019         different dest_mode from comparison mode.
3020
3021 2011-11-09  Richard Guenther  <rguenther@suse.de>
3022
3023         * gimple-fold.c (canonicalize_constructor_val): Mark
3024         address-taken variables addressable.
3025
3026 2011-11-09  Ira Rosen  <ira.rosen@linaro.org>
3027
3028         PR tree-optimization/51015
3029         * tree-vect-loop.c (vect_determine_vectorization_factor): Expect
3030         vectype to be set for pattern def stmts.
3031
3032 2011-11-09  Alan Modra  <amodra@gmail.com>
3033
3034         * function.c (bb_active_p): Delete.
3035         (dup_block_and_redirect, active_insn_between): New functions.
3036         (convert_jumps_to_returns, emit_return_for_exit): New functions,
3037         split out from..
3038         (thread_prologue_and_epilogue_insns): ..here.  Delete
3039         shadowing variables.  Don't do prologue register clobber tests
3040         when shrink wrapping already failed.  Delete all last_bb_active
3041         code.  Instead compute tail block candidates for duplicating
3042         exit path.  Remove these from antic set.  Duplicate tails when
3043         reached from both blocks needing a prologue/epilogue and
3044         blocks not needing such.
3045         * ifcvt.c (dead_or_predicable): Test both flag_shrink_wrap and
3046         HAVE_simple_return.
3047         * bb-reorder.c (get_uncond_jump_length): Make global.
3048         * bb-reorder.h (get_uncond_jump_length): Declare.
3049         * cfgrtl.c (rtl_create_basic_block): Comment typo fix.
3050         (rtl_split_edge): Likewise.  Warning fix.
3051         (rtl_duplicate_bb): New function.
3052         (rtl_cfg_hooks): Enable can_duplicate_block_p and duplicate_block.
3053         * Makefile.in (function.o): Update dependencies.
3054
3055 2011-11-08  Ulrich Weigand  <Ulrich.Weigand@de.ibm.com>
3056             Georg-Johann Lay  <avr@gjlay.de>
3057
3058         * doc/tm.texi.in (MODE_CODE_BASE_REG_CLASS): Add address space
3059         argument.
3060         (REGNO_MODE_CODE_OK_FOR_BASE_P): Likewise.
3061         * doc/tm.texi: Regenerate.
3062
3063         * config/cris/cris.h (MODE_CODE_BASE_REG_CLASS): Add address
3064         space argument.
3065         (REGNO_MODE_CODE_OK_FOR_BASE_P): Likewise.
3066         * config/bfin/bfin.h (MODE_CODE_BASE_REG_CLASS): Likewise.
3067         (REGNO_MODE_CODE_OK_FOR_BASE_P): Likewise.
3068         * config/avr/avr.h (MODE_CODE_BASE_REG_CLASS): Add address space
3069         argument.
3070         (REGNO_MODE_CODE_OK_FOR_BASE_P): Ditto.
3071         * config/avr/avr-protos.h (avr_mode_code_base_reg_class): Ditto.
3072         (avr_regno_mode_code_ok_for_base_p): Ditto.
3073         * config/avr/avr.c (avr_mode_code_base_reg_class): Ditto.
3074         (avr_regno_mode_code_ok_for_base_p): Ditto.
3075         (avr_reg_ok_for_addr_p): Pass AS down to
3076         avr_regno_mode_code_ok_for_base_p.
3077
3078         * addresses.h (base_reg_class): Add address space argument.
3079         Pass to MODE_CODE_BASE_REG_CLASS.
3080         (ok_for_base_p_1): Add address space argument.  Pass to
3081         REGNO_MODE_CODE_OK_FOR_BASE_P.
3082         (regno_ok_for_base_p): Add address space argument.  Pass to
3083         ok_for_base_p_1.
3084
3085         * regrename.c (scan_rtx_address): Add address space argument.
3086         Pass address space to regno_ok_for_base_p and base_reg_class.
3087         Update recursive calls.
3088         (scan_rtx): Pass address space to scan_rtx_address.
3089         (build_def_use): Likewise.
3090         * regcprop.c (replace_oldest_value_addr): Add address space
3091         argument.  Pass to regno_ok_for_base_p and base_reg_class.
3092         Update recursive calls.
3093         (replace_oldest_value_mem): Pass address space to
3094         replace_oldest_value_addr.
3095         (copyprop_hardreg_forward_1): Likewise.
3096
3097         * reload.c (find_reloads_address_1): Add address space argument.
3098         Pass address space to base_reg_class and regno_ok_for_base_p.
3099         Update recursive calls.
3100         (find_reloads_address): Pass address space to base_reg_class,
3101         regno_ok_for_base_p, and find_reloads_address_1.
3102         (find_reloads): Pass address space to base_reg_class.
3103         (find_reloads_subreg_address): Likewise.
3104
3105         * ira-costs.c (record_reg_classes): Update calls to base_reg_class.
3106         (ok_for_base_p_nonstrict): Add address space argument.  Pass to
3107         ok_for_base_p_1.
3108         (record_address_regs): Add address space argument.  Pass to
3109         base_reg_class and ok_for_base_p_nonstrict.  Update recursive calls.
3110         (record_operand_costs): Pass address space to record_address_regs.
3111         (scan_one_insn): Likewise.
3112
3113         * caller-save.c (init_caller_save): Update call to base_reg_class.
3114         * ira-conflicts.c (ira_build_conflicts): Likewise.
3115         * reload1.c (maybe_fix_stack_asms): Likewise.
3116
3117 2011-11-08  Michael Matz  <matz@suse.de>
3118
3119         * gengtype.c (write_field_root): Avoid out-of-scope access of newv.
3120
3121         * tree-stdarg.c (execute_optimize_stdarg): Accept clobbers.
3122
3123         * tree.h (TREE_CLOBBER_P): New macro.
3124         * gimple.h (gimple_clobber_p): New inline function.
3125         * gimplify.c (gimplify_bind_expr): Add clobbers for all variables
3126         that go out of scope and live in memory.
3127         * tree-ssa-operands.c (get_expr_operands): Transfer volatility also
3128         for constructors.
3129         * cfgexpand.c (decl_to_stack_part): New static variable.
3130         (add_stack_var): Allocate it, and remember mapping.
3131         (fini_vars_expansion): Deallocate it.
3132         (stack_var_conflict_p): Add early outs.
3133         (visit_op, visit_conflict, add_scope_conflicts_1,
3134         add_scope_conflicts): New static functions.
3135         (expand_used_vars_for_block): Don't call add_stack_var_conflict, tidy.
3136         (expand_used_vars): Add scope conflicts.
3137         (expand_gimple_stmt_1): Expand clobbers to nothing.
3138         (expand_debug_expr): Ditto.
3139
3140         * tree-pretty-print.c (dump_generic_node): Dump clobbers nicely.
3141         * tree-ssa-live.c (remove_unused_locals): Remove clobbers that
3142         refer to otherwise unused locals.
3143         * tree-sra.c (build_accesses_from_assign): Ignore clobbers.
3144         * tree-ssa-dce.c (mark_stmt_if_obviously_necessary): Clobbers of
3145         SSA names aren't necessary.
3146         (propagate_necessity): Accept and ignore constructors on the rhs, tidy.
3147         * gimple.c (walk_gimple_op): Accept constructors like mem_rhs.
3148         * tree-ssa-structalias.c (find_func_aliases): Clobbers don't store
3149         any known value.
3150         * tree-ssa-sccvn.c (vn_reference_lookup_3): Ditto, in particular they
3151         don't zero-initialize something.
3152         * tree-ssa-phiopt.c (cond_if_else_store_replacement_1): Ignore
3153         clobber RHS, we don't want PHI nodes with those.
3154
3155 2011-11-08  Jakub Jelinek  <jakub@redhat.com>
3156
3157         * config/i386/i386.c (ix86_preferred_simd_mode): Even for TARGET_AVX
3158         if not TARGET_PREFER_AVX128 return 32-byte integer vectors.
3159
3160 2011-11-08  Richard Guenther  <rguenther@suse.de>
3161
3162         PR tree-optimization/51012
3163         * ipa-prop.c (update_indirect_edges_after_inlining): Fixup
3164         non-inlinable state.
3165         * cgraph.c (cgraph_make_edge_direct): Likewise.
3166
3167 2011-11-08  Eric Botcazou  <ebotcazou@adacore.com>
3168
3169         PR rtl-optimization/47698
3170         * ifcvt.c (noce_operand_ok): Move around comment.
3171
3172 2011-11-08  Richard Guenther  <rguenther@suse.de>
3173
3174         PR lto/50999
3175         * lto-opts.c (append_to_collect_gcc_options): Split out from...
3176         (lto_write_options): ... here.  Prepend frontend specific flags.
3177
3178 2011-11-08  Jakub Jelinek  <jakub@redhat.com>
3179
3180         * config/i386/sse.md (*avx_vperm2f128<mode>3_nozero): Emit mask
3181         0x12 and 0x20 as vinsert[fi]128 instead of vperm2[fi]128.
3182
3183         * tree-vect-stmts.c (vectorizable_call): Add SLP_NODE argument.
3184         Handle vectorization of SLP calls.
3185         (vect_analyze_stmt): Adjust caller, add call to it for SLP too.
3186         (vect_transform_stmt): Adjust vectorizable_call caller, remove
3187         assertion.
3188         * tree-vect-slp.c (vect_get_and_check_slp_defs): For calls start
3189         with op_idx 3.
3190         (vect_build_slp_tree): Allow CALL_EXPR.
3191
3192 2011-11-08  Richard Guenther  <rguenther@suse.de>
3193
3194         * gimple-fold.c (canonicalize_constructor_val): Make sure
3195         we have referenced vars setup before adding to them.
3196
3197 2011-11-07  Richard Henderson  <rth@redhat.com>
3198             Aldy Hernandez  <aldyh@redhat.com>
3199             Andrew MacLeod  <amacleod@redhat.com>
3200             Torvald Riegel  <triegel@redhat.com>
3201
3202         Merged from transactional-memory.
3203
3204         * gtm-builtins.def: New file.
3205         * trans-mem.c: New file.
3206         * trans-mem.h: New file.
3207
3208         * opts.c (finish_options): Error out when using -flto and -fgnu-tm.
3209
3210         * config/i386/i386.c: Define TARGET_VECTORIZE* transactional variants.
3211         (ix86_handle_tm_regparm_attribute, struct bdesc_tm,
3212         ix86_builtin_tm_load, ix86_builtin_tm_store,
3213         ix86_init_tm_builtins): New.
3214         (ix86_init_builtins): Initialize TM builtins.
3215         (struct ix86_attribute_table): Add "*tm regparm".
3216         * config/i386/i386-builtin-types.def (PV2SI): Define.
3217         (PCV2SI): Define.
3218         Define V2SI_FTYPE_PCV2SI.
3219         Define V4SF_FTYPE_PCV4SF.
3220         Define V8SF_FTYPE_PCV8SF.
3221         Define VOID_PV2SI_V2SI.
3222
3223         * doc/invoke.texi (C Dialect Options): Document -fgnu-tm and
3224         tm-max-aggregate-size.
3225         * doc/tm.texi.in: Add TARGET_VECTORIZE_BUILTIN_TM_LOAD and
3226         TARGET_VECTORIZE_BUILTIN_TM_STORE hooks.
3227         * doc/tm.texi: Regenerate.
3228
3229         * attribs.c (apply_tm_attr): New.
3230         (init_attributes): Allow '*' prefix for overrides.
3231         (register_attribute): Likewise.
3232         * builtin-attrs.def (ATTR_TM_TMPURE, ATTR_TM_REGPARM): New.
3233         (ATTR_TM_NOTHROW_LIST, ATTR_TM_TMPURE_NOTHROW_LIST,
3234         ATTR_TM_PURE_TMPURE_NOTHROW_LIST, ATTR_TM_NORETURN_NOTHROW_LIST,
3235         ATTR_TM_CONST_NOTHROW_LIST, ATTR_TMPURE_MALLOC_NOTHROW_LIST,
3236         ATTR_TMPURE_NOTHROW_LIST): New.
3237         * builtin-types.def (BT_FN_I[1248]_VPTR, BT_FN_FLOAT_VPTR,
3238         BT_FN_DOUBLE_VPTR, BT_FN_LDOUBLE_VPTR, BT_FN_VOID_VPTR_I[1248],
3239         BT_FN_VOID_VPTR_FLOAT, BT_FN_VOID_VPTR_DOUBLE,
3240         BT_FN_VOID_VPTR_LDOUBLE, BT_FN_VOID_VPTR_SIZE): New.
3241         * builtins.def: Include gtm-builtins.def. Add comments regarding
3242         transactional memory synchronization.
3243         (DEF_TM_BUILTIN): New.
3244         * c-parser.c (struct c_parser): Add in_transaction.
3245         (c_parser_transaction, c_parser_transaction_expression,
3246         c_parser_transaction_cancel, c_parser_transaction_attributes): New.
3247         (c_parser_attribute_any_word): Split out from c_parser_attributes.
3248         (c_parser_statement_after_labels): Handle RID_TRANSACTION*.
3249         (c_parser_unary_expression): Same.
3250         * c-tree.h (c_finish_transaction): Declare.
3251         * c-typeck.c (c_finish_transaction): New.
3252         (build_function_call_vec): Call tm_malloc_replacement.
3253         * calls.c (is_tm_builtin): New.
3254         (flags_from_decl_or_type): Add ECF_TM_BUILTIN and ECF_TM_PURE.
3255         * cfgbuild.c (make_edges): Add edges for REG_TM notes.
3256         * cfgexpand.c (expand_call_stmt): Call
3257         mark_transaction_restart_calls.
3258         (gimple_expand_cfg): Free the tm_restart map.
3259         (mark_transaction_restart_calls): New.
3260         * cfgrtl.c (purge_dead_edges): Look for REG_TM notes.
3261         * cgraph.c (dump_cgraph_node): Handle tm_clone.
3262         * cgraph.h (struct cgraph_node): Add tm_clone field.
3263         (decl_is_tm_clone): New.
3264         (struct cgraph_local_info): Add tm_may_enter_irr.
3265         (cgraph_copy_node_for_versioning): Declare.
3266         * cgraphunit.c (cgraph_copy_node_for_versioning): Export;
3267         copy analyzed from old version.
3268         * combine.c (distribute_notes): Handle REG_TM notes.
3269         * common.opt: Add -fgnu-tm.
3270         * crtstuff.c (__TMC_LIST__, __TMC_END__): New.
3271         (__do_global_dtors_aux): Deregister clone table.
3272         (frame_dummy): Register clone table.
3273         * emit-rtl.c (try_split): Handle REG_TM. Early return if no function
3274         body.
3275         * gimple-low.c (lower_stmt): Handle GIMPLE_EH_ELSE and
3276         GIMPLE_TRANSACTION.
3277         (gimple_stmt_may_fallthru): Handle GIMPLE_EH_ELSE.
3278         * gimple-pretty-print.c: Include trans-mem.h.
3279         (dump_gimple_fmt): Add %x.
3280         (dump_gimple_call): Dump arguments for calls to _ITM_beginTransaction.
3281         (dump_gimple_eh_else, dump_gimple_transaction): New.
3282         (dump_gimple_stmt): Handle GIMPLE_EH_ELSE and GIMPLE_TRANSACTION.
3283         * gimple.c (gimple_build_eh_else, gimple_build_transaction): New.
3284         (walk_gimple_seq): Honor removed_stmt. Document usage of removed_stmt
3285         field.
3286         (walk_gimple_op): Handle GIMPLE_TRANSACTION.
3287         (walk_gimple_stmt): Initialize and honor removed_stmt.
3288         Handle GIMPLE_EH_ELSE and GIMPLE_TRANSACTION.
3289         (gimple_copy): Handle GIMPLE_EH_ELSE and GIMPLE_TRANSACTION.
3290         * gimple.def (GIMPLE_TRANSACTION, GIMPLE_EH_ELSE): New.
3291         * gimple.h (struct gimple_statement_eh_else,
3292         gimple_statement_transaction, GTMA_*): New.
3293         (gimple_statement_d): Add gimple_statement_eh_else and
3294         gimple_transaction.
3295         (gimple_build_eh_else, gimple_build_transaction,
3296         gimple_fold_call, diagnose_tm_safe_errors): Declare.
3297         (get_call_expr_in): Remove prototype.
3298         (gimple_has_substatements): Add GIMPLE_EH_ELSE and GIMPLE_TRANSACTION.
3299         (gimple_eh_else_n_body, gimple_eh_else_e_body,
3300         gimple_eh_else_set_n_body, gimple_eh_else_set_e_body,
3301         gimple_transaction_body, gimple_transaction_label,
3302         gimple_transaction_label_ptr, gimple_transaction_subcode,
3303         gimple_transaction_set_body, gimple_transaction_set_label,
3304         gimple_transaction_set_subcode): New.
3305         (struct walk_stmt_info): Use BOOL_BITFIELD; add removed_stmt.
3306         * gimplify.c (create_tmp_var_name): Use clean_symbol_name.
3307         (voidify_wrapper_expr): Handle TRANSACTION_EXPR.
3308         (gimplify_transaction): New.
3309         (gimplify_expr): Handle TRANSACTION_EXPR.
3310         * gsstruct.def (GSS_EH_ELSE, GSS_TRANSACTION): New.
3311         * ipa-inline.c (can_inline_edge_p): Do not inline TM safe calling
3312         TM pure functions.
3313         * Makefile.in: Add trans-mem.o and dependencies.
3314         (BUILTINS_DEF): Add gtm-builtins.def.
3315         (gimple-pretty-print.o): Depend on TRANS_MEM_H.
3316         (GTFILES): Add trans-mem.c.
3317         * omp-low.c (WALK_SUBSTMTS): Add GIMPLE_TRANSACTION.
3318         * output.h (record_tm_clone_pair, finish_tm_clone_pairs,
3319         get_tm_clone_pair): Declare.
3320         * params.def (PARAM_TM_MAX_AGGREGATE_SIZE): New.
3321         * passes.c (init_optimization_passes): Place transactional memory
3322         passes.
3323         * print-tree.c (print_node): Dump tm-clone.
3324         * recog.c (peep2_attempt): Handle REG_TM.
3325         * reg-notes.def (TM): New.
3326         * rtlanal.c (alloc_reg_note): Handle REG_TM.
3327         * target.def (builtin_tm_load, builtin_tm_store): New.
3328         * targhooks.c (default_builtin_tm_load_store): New.
3329         * targhooks.h (default_builtin_tm_load_store): Declare.
3330         * timevar.def (TV_TRANS_MEM): New.
3331         * toplev.c (compile_file): Call finish_tm_clone_pairs.
3332         * tree-cfg.c (make_edges): Handle GIMPLE_TRANSACTION.
3333         (cleanup_dead_labels): Handle GIMPLE_TRANSACTION. Avoid unnecessary
3334         writes into the statements to update labels.
3335         (is_ctrl_altering_stmt): Add TM ending statements. Handle
3336         GIMPLE_TRANSACTION.
3337         (verify_gimple_transaction): New.
3338         (verify_gimple_stmt): Handle GIMPLE_TRANSACTION.
3339         (verify_gimple_in_seq_2): Handle GIMPLE_EH_ELSE and GIMPLE_TRANSACTION.
3340         (gimple_redirect_edge_and_branch): Handle TM_TRANSACTION.
3341         (dump_function_to_file): Display [tm-clone] if applicable.
3342         * tree-eh.c (struct_ptr_eq): Make inline and move to tree.h.
3343         (struct_ptr_hash): Same.
3344         (collect_finally_tree): Handle GIMPLE_EH_ELSE.
3345         (replace_goto_queue_1): Likewise.
3346         (get_eh_else): New.
3347         (honor_protect_cleanup_actions): Handle GIMPLE_EH_ELSE.
3348         (lower_try_finally_nofallthru): Likewise.
3349         (lower_try_finally_onedest): Likewise.
3350         (lower_try_finally_copy): Likewise.
3351         (lower_try_finally_switch): Likewise.
3352         (lower_try_finally): Likewise.
3353         (decide_copy_try_finally): Likewise.
3354         (lower_eh_constructs_2): Likewise.
3355         (refactor_eh_r): Likewise.
3356         * tree-flow.h (struct gimple_df): Add tm_restart field.
3357         Define tm_restart_node.
3358         * tree-inline.c (remap_gimple_stmt): Handle GIMPLE_TRANSACTION.
3359         (estimate_num_insns): Likewise.
3360         (init_inline_once): Init tm_cost.
3361         * tree-inline.h (struct eni_weights_d): Add tm_cost.
3362         * tree-pass.h (pass_diagnose_tm_blocks, pass_lower_tm, pass_tm_init,
3363         pass_tm_mark, pass_tm_memopt, pass_tm_edges, pass_ipa_tm): Declare.
3364         * tree-pretty-print.c (dump_generic_node): Handle TRANSACTION_EXPR.
3365         * tree-ssa-alias.c (ref_maybe_used_by_call_p_1): Handle
3366         BUILT_IN_TM_MEMSET, BUILT_IN_TM_MEMCPY, BUILT_IN_TM_MEMMOVE.
3367         Add support for TM vector loads.  Add support for TM logging builtins.
3368         (call_may_clobber_ref_p_1): Add support for vector stores.
3369         * tree-ssa-structalias.c (find_func_aliases): Add support for TM
3370         vector stores and loads. Handle BUILT_IN_TM_MEMSET,
3371         BUILT_IN_TM_MEMCPY, BUILT_IN_TM_MEMMOVE.
3372         * tree.c (strip_invariant_refs): Moved from gimple.c to here.
3373         (local_define_builtin): Handle ECF_TM_PURE.
3374         (build_common_builtin_nodes): Set __builtin_eh_pointer to ECF_TM_PURE.
3375         * tree.def (TRANSACTION_EXPR): New.
3376         * tree.h (strip_invariant_refs): Moved from gimple.h to here.
3377         (TRANSACTION_EXPR_BODY, TRANSACTION_EXPR_CHECK,
3378         TRANSACTION_EXPR_OUTER, TRANSACTION_EXPR_RELAXED,
3379         BUILTIN_TM_LOAD_STORE_P, BUILTIN_TM_LOAD_P, BUILTIN_TM_STORE_P,
3380         CASE_BUILT_IN_TM_LOAD, CASE_BUILT_IN_TM_STORE): New.
3381         (ECF_TM_PURE, ECF_TM_BUILTIN): New.
3382         (struct tree_function_decl): Add tm_clone_flag.
3383         (struct_ptr_eq, struct_ptr_hash): New.
3384         (apply_tm_attr): Declare.
3385         (is_tm_safe_or_pure): New.
3386         (build_tm_abort_call, is_tm_safe, is_tm_pure,
3387         is_tm_may_cancel_outer, is_tm_ending_fndecl, record_tm_replacement,
3388         tm_malloc_replacement): Declare.
3389         * varasm.c (tm_clone_hash): New.
3390         (record_tm_clone_pair, finish_tm_clone_pairs, get_tm_clone_pair,
3391         dump_tm_clone_to_vec, dump_tm_clone_pairs, tm_alias_pair_cmp): New.
3392         (struct tm_alias_pair): New.  Declare VEC types for object.
3393
3394 2011-11-07  Richard Henderson  <rth@redhat.com>
3395
3396         * optabs.h (OTI_sync_compare_and_swap, OTI_sync_lock_test_and_set,
3397         OTI_sync_old_add, OTI_sync_old_sub, OTI_sync_old_ior,
3398         OTI_sync_old_and, OTI_sync_old_xor, OTI_sync_old_nand,
3399         OTI_sync_new_add, OTI_sync_new_sub, OTI_sync_new_ior,
3400         OTI_sync_new_and, OTI_sync_new_xor, OTI_sync_new_nand): Move and
3401         rename from the direct_optab_index enum.
3402         (sync_compare_and_swap_optab, sync_lock_test_and_set_optab,
3403         sync_old_add_optab, sync_old_sub_optab, sync_old_ior_optab,
3404         sync_old_and_optab, sync_old_xor_optab, sync_old_nand_optab,
3405         sync_new_add_optab, sync_new_sub_optab, sync_new_ior_optab,
3406         sync_new_and_optab, sync_new_xor_optab, sync_new_nand_optab): Read
3407         from the optab_table, not the direct_optab_table.
3408         (init_sync_libfuncs): Declare.
3409         (can_compare_and_swap_p): Update parameters.
3410         * optabs.c (init_sync_libfuncs_1, init_sync_libfuncs): New.
3411         (can_compare_and_swap_p): Add allow_libcall parameter; if true,
3412         test for the legacy compare-and-swap libcall.
3413         (expand_atomic_exchange): Use the legacy test-and-set libcall.
3414         (expand_atomic_compare_and_swap): Use the legacy CAS libcall.
3415         (struct atomic_op_functions): Update for optab type changes.
3416         (maybe_emit_op): Likewise.
3417         (expand_atomic_fetch_op): Use the legacy fetch-op libcalls.
3418         * builtins.c (fold_builtin_atomic_always_lock_free): Update call
3419         to can_compare_and_swap_p.
3420         * omp-low.c (expand_omp_atomic_fetch_op): Likewise.
3421         (expand_omp_atomic_pipeline): Likewise.
3422         * genopinit.c (optabs): Make sync_old_*_optab, sync_new_*_optab,
3423         sync_compare_and_swap_optab, sync_lock_test_and_set_optab regular
3424         optabs.
3425         *&nbs