aboutsummaryrefslogtreecommitdiff
path: root/gcc/ChangeLog.tcb
blob: 20201b9b84b8bddf792dbe1ef4541b02d07f8908 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
2005-03-18  Diego Novillo  <dnovillo@redhat.com>

	* Makefile.in (tree-into-ssa.o): Remove dependency on pointer-set.h.
	(tree-cfg.o): Add dependency on vec.h.
	* lambda-code.c (perfect_nestify): Mark for SSA updating any
	virtual operands in the moved statement.
	* tree-flow.h (rewrite_to_new_ssa_names_bb,
	rewrite_to_new_ssa_names, allocate_ssa_names,
	rewrite_ssa_into_ssa): Remove.
	(update_ssa, register_new_name_mapping, create_new_def_for,
	need_ssa_update_p, name_registered_for_update_p,
	dump_repl_tbl, debug_repl_tbl, dump_names_replaced_by,
	debug_names_replaced_by): Declare.
	(loop_depth_of_name): Declare.
	* tree-into-ssa.c: Don't include pointer-set.h.
	(old_ssa_names, new_ssa_names): Convert to sbitmap.
	(NAME_SETS_GROWTH_FACTOR): Declare.
	(struct new_to_old_d): Remove.  Update all users.
	(new_to_old): Remove.  Update all users.
	(struct repl_map_d): Declare.
	(repl_tbl): Declare.
	(need_to_initialize_update_ssa_p): Declare.
	(need_to_update_vops_p): Declare.
	(REGISTER_DEFS_IN_THIS_STMT): Use tree_common.unsigned_flag
	instead of TREE_ADDRESSABLE.
	(set_def_block): Remove argument 'is_update'.  Update all
	callers.
	(symbol_marked_for_renaming): New function.
	(repl_map_hash): Rename from new_to_old_hash.
	(repl_map_eq): Rename from new_to_old_eq.
	(repl_map_free): New function.
	(names_replaced_by): New function.
	(mark_sym_for_renaming): New function.
	(add_to_repl_tbl): New function.
	(name_replaced_by): Remove.
	(add_new_name_mapping): Resize OLD_SSA_NAMES and NEW_SSA_NAMES
	if needed.
	If NEW is a virtual variable, call mark_sym_for_renaming.
	Call add_to_repl_tbl.
	(prepare_def_operand_for_rename): Only accept _DECL nodes.
	(mark_def_sites): Fix call to prepare_def_operand_for_rename.
	Do not rewrite def operands.
	(find_idf): Ignore NULL blocks pulled from the work list.
	(get_default_def_for): New function.
	(get_reaching_def): Call it.
	(insert_phi_nodes_for): Check that find_def_blocks_for returns
	non-NULL.
	Fix assignment to SYM.
	Only call add_new_name_mapping and add arguments if UPDATE_P
	is true.
	Mark PHI for renaming.
	(register_new_update_single): Rename from register_new_update.
	(register_new_update_set): New function.
	(rewrite_update_init_block): Update comments.  Add support for
	renaming virtual operands.
	(rewrite_update_stmt): Likewise.
	(rewrite_update_phi_arguments): Likewise.
	(rewrite_def_def_chains): Do not call calculate_dominance_info.
	(mark_def_interesting): New function.
	(mark_use_interesting): New function.
	(prepare_phi_args_for_update):
	(prepare_block_for_update): Add support for virtual operands.
	Call mark_def_interesting, mark_use_interesting and
	prepare_phi_args_for_update.
	(remove_name_from_mappings): New function.
	(prepare_def_site_for): New function.
	(prepare_def_sites): New function.
	(dump_names_replaced_by): New function.
	(debug_names_replaced_by): New function.
	(dump_repl_tbl): New function.
	(debug_repl_tbl): New function.
	(remove_non_dominated): Remove.
	(init_update_ssa): New function.
	(delete_update_ssa): New function.
	(create_new_def_for): New function.
	(register_new_name_mapping): New function.
	(need_ssa_update_p): New function.
	(name_registered_for_update_p): New function.
	(insert_updated_phi_nodes_for): New function.
	(update_ssa): Update documentation.
	Do nothing if there is no need to update the SSA web.
	Call prepare_def_sites.
	Call prepare_block_for_update with the nearest common
	dominator of all new and old definition sites and on all the
	blocks in the dominance frontier of that block.
	Call insert_updated_phi_nodes_for with old SSA names and
	symbols marked for renaming.
	* tree-loop-linear.c (linear_transform_loops): Remove
	call to rewrite_into_ssa.
	* tree-ssa-ccp.c (get_default_value): Set VAL.MEM_REF to
	SYM when getting DECL_INITIAL from a const global
	variable.
	* tree-ssa-copy.c (may_propagate_copy): Do not allow
	propagations that pull a copy out of a deeper nested
	loop.
	* tree-ssa-dom.c (loop_depth_of_name): Declare extern.
	* tree-ssa-loop-im.c (move_computations): Clear
	VARS_TO_RENAME before calling rewrite_into_loop_closed_ssa.
	* tree-ssa-operands.c (copy_virtual_operands): Remove.
	* tree-ssa-operands.h (copy_virtual_operands): Remove.
	* tree-vectorizer.c (allocate_new_names, rename_use_op,
	rename_def_op, rename_variables_in_bb, free_new_names,
	rename_variables_in_loop): Remove.
	(slpeel_update_phis_for_duplicate_loop): Remove variables
	new_name_ptr, new_ssa_name and new_loop_exit_e.
	Do not try to update PHIs for duplicate loop.
	(slpeel_update_phi_nodes_for_guard): Do nothing if
	UPDATE_BB is the same as ORIG_BB.
	(slpeel_can_duplicate_loop_p): Call need_ssa_update_p
	instead of any_marked_for_rewrite_p.
	(slpeel_tree_peel_loop_to_edge): Call update_ssa.
	* tree.h:
	* testsuite/gcc.c-torture/execute/20030216-1.x:

2005-03-18  Zdenek Dvorak  <dvorakz@suse.cz>
	    Diego Novillo  <dnovillo@redhat.com>

	* Makefile.in: (tree-cfg.o): Add dependency on vec.h.
	* tree-cfg.c: Include vec.h.
	(tree_duplicate_bb): Call create_new_def_for for newly
	created PHI nodes.
	Remove call to copy_virtual_operands.
	Mark any newly exposed virtual symbol for renaming.
	(struct ssa_name_map_entry): Remove.
	(ssa_name_map_entry_hash): Remove.
	(ssa_name_map_entry_eq): Remove.
	(allocate_ssa_names): Remove.
	(rewrite_to_new_ssa_names_def): Remove.
	(rewrite_to_new_ssa_names_use): Remove.
	(rewrite_to_new_ssa_names_bb): Remove.
	(rewrite_to_new_ssa_names): Remove.
	(tree_duplicate_sese_region): Remove variables ver,
	definitions, phi, ssa_name_map and bi.
	Call need_ssa_update_p instead of any_marked_for_rewrite_p.
	Call update_ssa.
	* tree-ssa-dom.c (tree_ssa_dominator_optimize): Call
	update_ssa instead of rewrite_ssa_into_ssa.
	* tree-ssa-loop-manip.c (add_exit_phis_edge): Call
	create_new_def_for.
	(find_uses_to_rename_use): Add argument 'need_phis'.
	(find_uses_to_rename_stmt): Do not scan virtual operands.
	(find_uses_to_rename): Only scan PHI nodes for
	non-virtual names.
	(rewrite_into_loop_closed_ssa): Call update_ssa.
	(check_loop_closed_ssa_use): Ignore virtual operands.
	(check_loop_closed_ssa_stmt): Likewise.
	(verify_loop_closed_ssa): Do nothing if CURRENT_LOOPS is
	NULL.
	(rename_variables, set_phi_def_stmts): Remove.
	(tree_duplicate_loop_to_header_edge): Reformat comment.
	Remove variables bb, i and definitions.
	Call need_ssa_update_p.
	Call update_ssa.
	(lv_adjust_loop_header_phi): Reformat comment.
	* tree-ssanames.c (ssa_names_to_rewrite): Remove.
	(marked_for_rewrite_p, any_marked_for_rewrite_p,
	mark_for_rewrite, unmark_all_for_rewrite,
	marked_ssa_names): Remove.  Update all users.
	(release_ssa_name): If VAR has been registered for SSA
	updating, do nothing.
	* tree-vrp.c (new_ssa_names, old_ssa_names): Remove.
	(build_assert_expr_for): Call register_new_name_mapping.
	(insert_range_assertions): Update call to update_ssa.
	* tree.h (mark_for_rewrite, unmark_all_for_rewrite,
	marked_for_rewrite_p, any_marked_for_rewrite_p,
	marked_ssa_names): Remove.

2005-02-27  Diego Novillo  <dnovillo@redhat.com>

	Merge from mainline

		PR tree-optimization/20204
		* tree-into-ssa.c (insert_phi_nodes_for): Do not use
		REWRITE_THIS_STMT markers on PHI nodes.
		(rewrite_initialize_block): Likewise.

2005-02-23  Diego Novillo  <dnovillo@redhat.com>

	Merge from mainline (tree-cleanup-merge-20050223).

	* tree-vect-trasform.c (vect_create_data_ref_ptr): Call
	add_type_alias, if necessary.

2005-02-22  Diego Novillo  <dnovillo@redhat.com>

	* domwalk.c (walk_dominator_tree): If block BB is not in the
	set of interesting blocks, do not traverse its statements.
	* domwalk.h (struct dom_walk_data): Add field INTERESTING_BLOCKS.
	* tree-flow.h (update_ssa): Add new bool argument.
	* tree-into-ssa.c (struct mark_def_sites_global_data): Fix comment.
	Add field interesting_blocks.
	(compute_global_livein): Use last_basic_block to initialize
	work lists.
	(find_idf): Likewise.
	(mark_def_sites): If the statement is going to be rewritten,
	add the block to GD->INTERESTING_BLOCKS.
	(rewrite_blocks): Add argument BLOCKS.  Initialize
	WALK_DATA.INTERESTING_BLOCKS with it.
	Update all callers.
	Move debug dumping code from rewrite_into_ssa.
	Only delete DEF_BLOCKS if it had been allocated.
	(mark_def_site_blocks): Add argument INTERESTING_BLOCKS.
	Initialize MARK_DEF_SITES_GLOBAL_DATA.INTERESTING_BLOCKS with
	it.
	Update all callers.
	(prepare_block_for_update): Add arguments INSERT_PHI_P and
	INTERESTING_BLOCKS.
	Only call set_def_block/set_livein_block if INSERT_PHI_P is true.
	Update all callers.
	If the block contains at least one interesting statement, add
	the block to INTERESTING_BLOCKS.
	(update_ssa): Add argument INSERT_PHI_P.  Only add new PHI
	nodes if INSERT_PHI_P is true.
	Update all callers.
	Initialize INTERESTING_BLOCKS.
	* tree-ssa-dom.c (tree_ssa_dominator_optimize): Initialize
	WALK_DATA.INTERESTING_BLOCKS to NULL.
	* tree-ssa-dse.c (tree_ssa_dse): Likewise.

2005-02-18  Diego Novillo  <dnovillo@redhat.com>

	PR tree-optimization/18178
	* Makefile.in (tree-vrp.o): Depend on CFGLOOP_H,
	tree-scalar-evolution.h and tree-chrec.h.
	* tree-into-ssa.c (prepare_block_for_update): Also rewrite
	operands of statements that define new names.
	* tree-vrp.c: Include cfgloop.h, tree-scalar-evolution.h and
	tree-chrec.h.
	(cfg_loops): New local variable.
	(compare_values): Forward declare.
	(copy_value_range): Remove.
	(set_value_range): Add range integrity checks.
	Decay to VR_VARYING ranges that take all possible values in
	the type domain.
	(compare_values): Do some symbolic comparisons.
	(value_inside_range): Move earlier in the file.
	(value_ranges_intersect_p): Likewise.
	(extract_range_from_assert): If the ASSERT_EXPR conditional
	and the variable have intersecting ranges, use the
	intersection to derive a narrower range.
	(extract_range_from_ssa_name): New function.
	(extract_range_from_binary_expr): Re-arrange to always call
	set_value_range to set the newly computed range.
	(extract_range_from_unary_expr): Likewise.
	Do not special case ABS_EXPR.
	If a type cast operation changes to a type of different size,
	set the resulting range to VR_VARYING.
	If the new range has the limits swapped around, set the result
	to VR_VARYING.
	(extract_range_from_expr): Call extract_range_from_ssa_name.
	(compare_ranges): Allow symbolic ranges.
	Fix calls to compare_values to always check for specific
	return values.
	(compare_range_with_value): Likewise.
	(adjust_range_with_scev): New function.
	(vrp_visit_assignment): Call it if the statement is inside a
	loop.
	(vrp_meet): Always call set_value_range to set the newly
	computed range.
	(vrp_visit_phi_node): Remove FIXME regarding derivation.
	(execute_vrp): Call loop_optimizer_init, scev_initialize,
	scev_finalize and loop_optimizer_finalize.

2005-02-16  Diego Novillo  <dnovillo@redhat.com>

	Merge from mainline (tree-cleanup-merge-20050216).
	
2005-02-14  Diego Novillo  <dnovillo@redhat.com>

	* tree-into-ssa.c (REGISTER_DEFS_IN_STMT): Define.
	(insert_phi_nodes_for): Mark with REGISTER_DEFS_IN_STMT.
	(rewrite_update_init_block): Only register the LHS of PHI
	nodes marked with REGISTER_DEFS_IN_STMT.
	(rewrite_update_stmt): Likewise.
	Do not update use operands of statements that are not marked
	with REWRITE_THIS_STMT.
	(prepare_block_for_update): Mark with REGISTER_DEFS_IN_STMT
	statements that define new names.
	Only mark statements with REWRITE_THIS_STMT if they reference
	old names and do not define new names.
	* tree-ssa-copy.c (get_last_copy_of): Limit the amount of
	copy-of traversal.
	(copy_prop_visit_assignment): Get the copy-of value from the
	RHS to avoid creating long copy-of chains.
	(copy_prop_visit_phi_node): Do the opposite.  Use the
	arguments themselves as the initial link in the copy-of chain.
	(fini_copy_prop): Fix comment.
	* tree-ssa-dom.c (tree_ssa_dominator_optimize): Add getenv
	hackery to allow disabling DOM at compile time.
	(propagate_to_outgoing_edges): Likewise.
	(simplify_cond_and_lookup_avail_expr): Guard for NULL low and
	high.
	* tree-ssa-pre.c (phi_translate): Handle tcc_comparison.
	(valid_in_set): Likewise.
	(find_or_generate_expression): Likewise.
	(create_expression_by_pieces): Likewise.
	(insert_into_preds_of_block): Likewise.
	(insert_aux): Likewise.
	(create_value_expr_from): Likewise.
	(compute_avail): Likewise.
	Handle TREE_INVARIANT values.  Re-order checks to check for
	expressions first.
	(execute_pre): Change formatting of stats messages.
	* tree-vn.c (set_value_handle): Handle TREE_INVARIANT.
	(get_value_handle): Likewise.
	* tree-vrp.c (expr_computes_nonnull): Recognize address of
	references.
	(extract_range_from_assert): Don't build unnecessary
	constants.
	(extract_range_from_binary_expr): Pointer arithmetic may
	include operations other than + or -.
	(extract_range_from_unary_expr): Set cast operations of
	anti-ranges to VARYING.
	(build_assert_expr_for): Fix comments.
	(maybe_add_assert_expr): When a predicate involves more than
	one name, only add assertions for the first one.
	(vrp_finalize): Support TDF_STATS.

2005-02-02  Diego Novillo  <dnovillo@redhat.com>

	Value Range Propagation

	* Makefile.in (tree-vrp.o): Depend on
	tree-ssa-propagate.h, $(FLAGS_H) and $(TREE_DUMP_H).
	* common.opt (ftree-vrp): Define.
	* opts.c (decode_options): Set flag_tree_vrp at -O2.
	* timevar.def (TV_TREE_INSERT_ASSERT): Remove.
	(TV_TREE_VRP): Define.
	* tree-flow.h (enum value_range_type): Define.
	(struct value_range_def): Define.
	(count_uses_and_derefs): Declare.
	(get_value_range): Declare.
	(dump_value_range): Declare.
	(debug_value_range): Declare.
	(dump_all_value_ranges): Declare.
	(debug_all_value_ranges): Declare.
	* tree-optimize.c (init_tree_optimization_passes): Remove
	pass_insert_range_assertions and pass_remove_range_assertions.
	Add pass_vrp.
	* tree-pass.h (pass_insert_range_assertions): Remove.
	(pass_remove_range_assertions): Remove.
	(pass_vrp): Define.
	* tree-ssa-alias.c (count_ptr_derefs): Make extern.
	* tree.h (SSA_NAME_VALUE_RANGE): Define.
	(struct value_range_def): Forward declare.
	(struct tree_ssa_name): Add field value_range.
	* tree-vrp.c: Include flags.h, tree-dump.h and
	tree-ssa-propagate.h.
	(new_ssa_names): Declare.
	(old_ssa_names): Declare.
	(found): Declare.
	(get_opposite_operand): New.
	(opposite_comparison): New.
	(copy_value_range): New.
	(set_value_range): New.
	(update_value_range): New.
	(get_value_range): New.
	(symbolic_range_p): New.
	(expr_computes_nonnull): New.
	(range_is_nonnull): New.
	(range_is_null): New.
	(set_value_range_to_nonnull): New.
	(set_value_range_to_null): New.
	(compare_values): New.
	(extract_range_from_assert): New.
	(extract_range_from_binary_expr): New.
	(extract_range_from_unary_expr): New.
	(extract_range_from_expr): New.
	(compare_ranges): New.
	(compare_range_with_value): New.
	(value_inside_range): New.
	(value_ranges_intersect_p): New.
	(dump_value_range): New.
	(debug_value_range): New.
	(dump_all_value_ranges): New.
	(debug_all_value_ranges): New.

	(build_assert_expr_for): Create a new SSA name for every
	assertion.
	If the conditional is an equality, create a regular
	assignment.
	Push the new name into NEW_SSA_NAMES.  Push the operand into
	OLD_SSA_NAMES.
	(infer_value_range): New.
	(has_assert_expr): New.
	(maybe_add_assert_expr): Add ASSERT_EXPR after pointer
	dereferences.
	Handle cases that require inserting after the last statement
	of a block.
	Call has_assert_expr and infer_value_range.
	(insert_range_assertions): Rename from
	execute_insert_range_assertions.
	Initialize new_ssa_names and old_ssa_names.
	Do not use BB_VISITED to mark visited blocks.
	(pass_insert_range_assertions): Remove.
	(remove_range_assertions): Rename from
	execute_remove_range_assertions.
	(pass_remove_range_assertions): Remove.

	(stmt_interesting_for_vrp): New.
	(need_imm_uses_for): New.
	(vrp_initialize): New.
	(vrp_visit_assignment): New.
	(vrp_evaluate_conditional): New.
	(vrp_visit_cond_stmt): New.
	(vrp_visit_stmt): New.
	(vrp_meet): New.
	(vrp_visit_phi_node): New.
	(vrp_finalize): New.
	(execute_vrp): New.
	(gate_vrp): New.
	(pass_vrp): Declare.

2005-02-02  Diego Novillo  <dnovillo@redhat.com>

	* Makefile.in (tree-into-ssa.o): Depend on pointer-set.h
	* timevar.def (TV_TREE_SSA_INCREMENTAL): Define.
	* tree-flow.h (update_ssa): Declare.
	* tree-into-ssa.c: Include pointer-set.h.
	(old_ssa_names): Declare.
	(new_ssa_names): Declare.
	(struct new_to_old_d): Declare.
	(new_to_old): Declare.
	(enum rewrite_mode): Declare.
	(new_to_old_hash): New.
	(new_to_old_eq): New.
	(add_new_name_mapping): New.
	(name_replaced_by): New.
	(insert_phi_nodes_for): Add argument 'update_p'.
	If update_p is true, add a new mapping from the LHS of the PHI
	node to the name given in 'var'.
	(insert_phi_nodes_1): Update call to insert_phi_nodes_for.
	(register_new_update): New.
	(rewrite_update_init_block): New.
	(rewrite_update_fini_block): New.
	(rewrite_update_stmt): New.
	(rewrite_update_phi_arguments): New.
	(rewrite_blocks): Remove argument 'fix_virtual_phis'.  Add
	arguments 'entry' and 'what'.
	Use 'what' to register the call-backs used for REWRITE_UPDATE,
	REWRITE_ALL and REWRITE_DEF_DEF_CHAINS.
	Start re-writing at block 'entry'.
	(rewrite_into_ssa): Call rewrite_blocks with ENTRY_BLOCK_PTR
	and REWRITE_ALL.
	(rewrite_def_def_chains): Call rewrite_blocks with
	ENTRY_BLOCK_PTR and REWRITE_FIX_DEF_DEF_CHAINS.
	(prepare_block_for_update): New.
	(remove_non_dominated): New.
	(update_ssa): New.

2005-02-02  Diego Novillo  <dnovillo@redhat.com>

	* basic-block.h (nearest_common_dominator): Declare.
	* dominance.c (nearest_common_dominator): New.

2005-02-02  Diego Novillo  <dnovillo@redhat.com>

	* tree.h (ASSERT_EXPR_VAR): Define.
	(ASSERT_EXPR_COND): Define.
	* tree-cfg.c (verify_expr): Use
	* tree-pretty-print.c (dump_generic_node): Use.
	* tree-scalar-evolution.c (follow_ssa_edge_in_rhs): Use.
	(interpret_rhs_modify_expr): Use.

2005-02-02  Diego Novillo  <dnovillo@redhat.com>

	* tree-into-ssa.c: Reorganize internal functions.
	(find_idf): Extract from ...
	(insert_phi_nodes): ... here.
	(insert_phi_nodes_1): Call find_idf.
	* tree-phinodes.c (ideal_phi_node_len): Fix comment.
	* tree-ssa.c (verify_use): Fix error message.

2005-02-01  Diego Novillo  <dnovillo@redhat.com>

	Merge from mainline (tree-cleanup-merge-20050201).

2005-01-06  Diego Novillo  <dnovillo@redhat.com>

	* Makefile.in (collect2.o-warn): Remove.
	* tree-optimize.c (init_tree_optimization_passes): Schedule
	pass_insert_range_assertions after pass_referenced_vars.
	* tree-vrp.c (opposite_comparison): Remove.
	(build_assert_exprs): Remove.
	(negate_assert_exprs): Remove.
	(build_assert_expr_for): New function.
	(maybe_add_assert_expr_on_edges): New function.
	(execute_insert_range_assertions): Change linear traversal of
	basic blocks to a recursive call maybe_add_assert_expr_on_edges 
	for the edges going out of ENTRY_BLOCK_PTR.

2004-12-14  Diego Novillo  <dnovillo@redhat.com>

	Add expression assertions to GIMPLE.

	* tree-vrp.c: New file.
	* tree.def (ASSERT_EXPR): Define.
	* Makefile.in (collect2.o): Compile with -Wno-error.
	(tree-vrp.o): New rule.
	(OBJS-common): Add tree-vrp.o.
	* timevar.def (TV_TREE_INSERT_ASSERT): Define.
	* fold-const.c (fold): Handle ASSERT_EXPR.
	* tree-cfg.c (verify_expr): Likewise.
	* tree-gimple.c (is_gimple_formal_tmp_rhs): Likewise.
	* tree-inline.c (estimate_num_insns_): Likewise.
	* tree-pretty-print.c (dump_generic_node): Likewise.
	* tree-scalar-evolution.c (follow_ssa_edge_in_rhs): Likewise.
	(interpret_rhs_modify_expr): Likewise.
	* tree-ssa-dom.c (record_equivalences_from_stmt): Likewise.
	* tree-ssa-operands.c (get_expr_operands): Likewise.
	* tree-ssa-ccp.c (likely_value): Likewise.
	(pass_ccp): Add TODO_cleanup_cfg to todo_flags_finish.
	* tree-optimize.c (init_tree_optimization_passes): Schedule
	pass_insert_range_assertions and pass_remove_range_assertions.
	* tree-pass.h (pass_insert_range_assertions): Declare.
	(pass_remove_range_assertions): Declare.
	* tree-ssa-copy.c (stmt_may_generate_copy): Remove unnecessary
	checks for aliased loads and aliased stores.

2004-12-10  Diego Novillo  <dnovillo@redhat.com>

	* tree-flow-inline.h (clear_call_clobbered): New function.
	* tree-ssa-alias.c (init_alias_info): Call it.

2004-12-09  Diego Novillo  <dnovillo@redhat.com>

	* tree-into-ssa.c (REWRITE_THIS_STMT): Define.
	(mark_def_sites): Clear REWRITE_THIS_STMT for statements that
	don't need any operands rewritten.
	(rewrite_stmt): Ignore statements that don't need to be
	rewritten.
	(rewrite_operand): Validate that an existing SSA_NAME is
	identical to the current reaching definition of the operand.

2004-12-09  Diego Novillo  <dnovillo@redhat.com>

	* tree-sra.c (mark_all_v_defs): Also mark VUSEs for renaming.
	* tree-vectorizer.c (vectorizable_load): Mark call-clobbered
	variables for renaming if we just introduced a CALL_EXPR.

2004-12-07  Devang Patel  <dpatel@apple.com>

	* tree-if-conv.c (find_phi_replacement_condition): New parameter, loop.
	While selecting replacement condition pay attention to loop header.

2004-12-05  Diego Novillo  <dnovillo@redhat.com>

	* tree-ssa-phiopt.c (conditional_replacement): Release newly
	created SSA name if we can't use it.

2004-12-05  Diego Novillo  <dnovillo@redhat.com>

	* tree-ssa-copy.c (copy_prop_visit_assignment): Return
	SSA_PROP_VARYING when the RHS cannot be propagated into the
	LHS.
	(pass_store_copy_prop): Add TODO_cleanup_cfg to
	todo_flags_finish.

2004-12-04  Diego Novillo  <dnovillo@redhat.com>

	* tree-ssa-alias.c (setup_pointers_and_addressables): If VAR
	already had a type tag, mark the tag for renaming before
	replacing it with a new one.
	* tree-ssa.c (verify_ssa_name): Add argument 'mark_visited'.
	If 'mark_visited' is true, set TREE_VISITED on the given SSA name.
	Update all callers.

2004-12-04  Diego Novillo  <dnovillo@redhat.com>

	* tree-cfg.c (cleanup_tree_cfg_loop): Call
	calculate_dominance_info before fixing loop structures.

2004-12-03  Diego Novillo  <dnovillo@redhat.com>

	* tree-flow.h (add_type_alias): Declare.
	* tree-pass.h (TODO_verify_loops): Define.
	* tree-loop-linear.c (linear_transform_loops): Don't call
	verify_loop_closed_ssa.
	* tree-optimize.c (execute_todo): Call verify_loop_closed_ssa
	if TODO_verify_loops is set.
	* tree-ssa-loop-ivopts.c (rewrite_address_base): Fix to call
	add_type_alias if VAR didn't have one already.
	Mark variables in the original statement for renaming.
	(tree_ssa_iv_optimize): Do not called verify_loop_closed_ssa
	nor verify_stmts before returning.
	* tree-ssa-alias.c (add_type_alias): New function.
	* tree-ssa-loop.c (pass_linear_transform): Add
	TODO_verify_loops to todo_flags_finish.
	(tree_ssa_loop_ivopts): Mark all statements modified before
	returning.
	(pass_iv_optimize): Add TODO_rename_vars, TODO_cleanup_cfg,
	TODO_verify_ssa and TODO_verify_loops to todo_flags_finish.
	* tree-vectorizer.c (vect_create_data_ref_ptr): Call
	add_type_alias, if necessary.
	(struct _stmt_vec_info): Fix documentation for field MEMTAG.

2004-10-19  Diego Novillo  <dnovillo@redhat.com>

	* tree-ssa-copy.c (copy_prop_visit_phi_node): Always
	start with a nil copy-of value.

2004-10-19  Diego Novillo  <dnovillo@redhat.com>

	* tree-ssa-ccp.c (replace_vuses_in): Revert inadvertent
	early return.

2004-10-19  Diego Novillo  <dnovillo@redhat.com>

	* common.opt (-ftree-store-copy-prop): New flag.
	* opts.c (decode_options): Enable STORE-COPY-PROP at O2.
	* timevar.def (TV_TREE_STORE_COPY_PROP): Define.
	* tree-flow.h (execute_copy_prop): Add boolean argument.
	* tree-optimize.c (init_tree_optimization_passes): Schedule
	STORE-COPY-PROP after SRA.
	* tree-pass.h (pass_store_copy_prop): Declare.
	* tree-ssa-ccp.c (set_lattice_value): Fix typo in comment.
	(replace_uses_in): Call may_propagate_copy before doing the
	final propagation.
	(replace_vuses_in): Call get_value_loaded_by.
	(ccp_lattice_meet): Do not test for memory reference equality
	if DO_STORE_CCP is false.
	(ccp_fold): Call get_value_loaded_by.
	(visit_assignment): Likewise.
	Set all the virtual definitions in the statement to the newly
	computed value.
	(ccp_visit_stmt): Reformat dump output.
	(do_ssa_store_ccp): If STORE-CCP is not enabled, run standard
	CCP.
	(gate_store_ccp): Return true if either CCP or STORE-CCP are
	enabled.
	(pass_store_ccp): Rename dump suffix.
	* tree-ssa-copy.c (cached_last_copy_of): Declare.
	(stmt_may_generate_copy): Return false if the name occurs in
	an abnormal PHI.
	(copy_chains): Remove.  Update all functions to use COPY_OF
	instead.
	(get_copy_of_val): Rename from get_first_copy.  Return a
	pointer to the COPY_OF slot for VAR.
	(set_copy_of_val): Rename from set_first_copy_of.
	Used CACHED_LAST_COPY_OF to determine whether the copy-of
	chain has changed.
	(copy_prop_visit_assignment): Do not call may_propagate_copy.
	In the case of STORE-COPY-PROP set the copy-of value for all
	the virtual definitions.
	(copy_prop_visit_stmt): Reformat dump output.
	(copy_prop_visit_phi_node): Support STORE-COPY-PROP by
	checking memory references for each argument.
	Do not allow copies to flow through abnormal edges.
	(init_copy_prop): Allocate cached_last_copy_of.
	(fini_copy_prop): Free cached_last_copy_of
	(execute_copy_prop): Add new boolean argument to determine
	whether to enable STORE-COPY-PROP.
	(do_copy_prop): New function.
	(pass_copy_prop): Call do_copy_prop.
	(gate_store_copy_prop): New function.
	(store_copy_prop): New function.
	(pass_store_copy_prop): Define.
	* tree-ssa-propagate.c (first_vuse): Remove.
	(get_value_loaded_by): New function.
	* tree-ssa-propagate.h (first_vuse): Remove.
	(get_value_loaded_by): Declare.
	* doc/invoke.texi (-ftree-store-copy-prop): Document.
	(-fdump-tree-store_copyprop): Document.

2004-10-15  Diego Novillo  <dnovillo@redhat.com>

	* tree-ssa-ccp.c: Document SSA-CCP and STORE-CCP.

2004-10-14  Diego Novillo  <dnovillo@redhat.com>

	* tree-optimize.c (execute_one_pass): Stop timer right after
	executing the pass.

2004-10-14  Diego Novillo  <dnovillo@redhat.com>

	* tree-outof-ssa.c (check_replaceable): Return false for
	calls with side-effects.

2004-10-14  Diego Novillo  <dnovillo@redhat.com>

	* tree-flow.h (unmodifiable_var_p): Declare.
	* tree-flow-inline.h (unmodifiable_var_p): New function.
	* tree-ssa-alias.c (compute_flow_insensitive_aliasing): If the
	variable is read-only but the tag isn't, or vice versa, they
	cannot alias each other.
	(maybe_create_global_var): Do not create .GLOBAL_VAR if there
	are no call-clobbered variables.
	* tree-ssa-operands.c (get_call_expr_operands): Fix comment.
	(add_stmt_operand): If the variable is read-only and the
	operand is a V_MAY_DEF or V_MUST_DEF, change it to a VUSE.
	Likewise when adding V_MAY_DEF for members of may-alias sets.
	(add_call_clobber_ops): Call unmodifiable_var_p.

2004-10-14  Diego Novillo  <dnovillo@redhat.com>

	* tree-ssa-pre.c (valid_in_set): Return false for
	tcc_declaration.
	(create_value_expr_from): Return NULL if one of the operands
	in the expression is an overflowed constant.
	(compute_avail): Only insert new expression if
	create_value_expr_from returns non-NULL.

2004-10-14  Diego Novillo  <dnovillo@redhat.com>

	Constant propagation of stores and loads.

	* common.opt (ftree-store-ccp): New flag.
	* opts.c (decode_options): Enable STORE-CCP at -O2.
	* timevar.def (TV_TREE_STORE_CCP): New timer.
	* tree-flow.h (struct prop_value_d): Declare.
	(unmodifiable_var_p): Declare.
	* tree-optimize.c (init_tree_optimization_passes): Re-arrange
	CCP, FRE and copy-prop passes.
	Add call to pass_store_ccp.
	* tree-pass.h (pass_store_ccp): Declare.
	* tree-ssa-ccp.c (value): Remove.  Update all users.
	(const_val): Declare.
	(value_vector): Remove.  Update all users.
	(ccp_lattice_t): Rename from latticevalue.  Update all users.
	(do_store_ccp): Declare.
	(debug_lattice_value): New function.
	(get_default_value): Re-write.
	(set_lattice_value): Do not allow lattice transitions to lower
	lattice values (with the exception of CONSTANT->UNKNOWN_VAL).
	Return false on UNINITIALIZED->UNDEFINED transitions.
	(def_to_varying): Remove.
	(likely_value): Re-write.
	(need_imm_uses_for): Call likely_value if VAR is defined by an
	assignment.
	(ccp_initialize): Remove variable 'is_may_def'.
	(struct prop_stats_d): Declare.
	(prop_stats): Declare.
	(replace_uses_in): Count number of constants and copies
	propagated.
	(replace_vuse_in): Likewise.
	(replace_phi_args_in): Factor out from ...
	(substitute_and_fold): ... here.
	Initialize prop_stats.
	Always remove EH edges if the statement no longer has EH
	information.
	(ccp_lattice_meet): Re-write.  Add documentation for
	UNKNOWN_VAL.
	(ccp_visit_phi_node): Do not handle UNKNOWN_VAL if
	do_store_ccp is false.
	(ccp_fold): Do not handle loads if do_store_ccp is false.
	(visit_assignment): Re-write.
	(ccp_visit_stmt): Visit all assignments.
	(execute_ssa_ccp): Add argument 'store_ccp'.
	(do_ssa_ccp): New function.
	(do_ssa_store_ccp): New function.
	(gate_store_ccp): Declare.
	* tree-ssa-copy.c (copy_of): Declare.
	(do_store_copy_prop): Declare.
	(stmt_may_generate_copy): New function.
	(need_imm_uses_for): Call it.
	(get_first_copy_of): Use copy_of instead of SSA_NAME_VALUE.
	(get_last_copy_of): Likewise.
	(set_first_copy_of): Likewise.
	(dump_copy_of): Likewise.
	(copy_prop_visit_assignment): Likewise.
	(copy_prop_visit_cond_stmt): Likewise.
	(copy_prop_visit_stmt): Likewise.
	(init_copy_prop): Likewise.
	(fini_copy_prop): Likewise.
	* tree-ssa-dom.c (struct opt_stats_d): Add fields
	num_const_prop and num_copy_prop.
	(tree_ssa_dominator_optimize): Do not execute more than once.
	(dump_dominator_optimization_stats): Show constants and copies
	propagated.
	(cprop_into_successor_phis): Do not replace if NEW == ORIG.
	(cprop_operand):  Do not replace if OP == VAL.
	Do not call get_virtual_var when VAL is a GIMPLE register.
	Keep statistics on propagated copies and constants.
	* tree-ssa-propagate.c (first_vuse): New function.
	(first_vdef): New function.
	(stmt_makes_single_load): New function.
	(stmt_makes_single_store): New function.
	* tree-ssa-propagate.h (first_vuse): Declare.
	(first_vdef): Declare.
	(stmt_makes_single_load): Declare.
	(stmt_makes_single_store): Declare.
	* tree-ssa.c (verify_ssa): Call verify_stmts.
	* doc/invoke.texi (-fdump-tree-storeccp): Document.
	(-ftree-store-ccp): Document.

2004-10-07  Andrew Pinski  <pinskia@physics.uc.edu>

	PR tree-opt/17671
	* tree-ssa-phiopt.c (tree_ssa_phiopt): Rewrite so we base the
	bbs on the COND_EXPR instead of the PHI_NODEs.
	(candidate_bb_for_phi_optimization): Remove.
	(replace_phi_with_stmt): Rename to ...
	(replace_phi_edge_with_variable): this and change so that we
	replace the phi argument instead of removing the PHI.
	(conditional_replacement): Change so we deal with PHI with more
	than two arguments.
	(value_replacement): Likewise.
	(abs_replacement): Likewise.

2004-10-06  Andrew MacLeod  <amacleod@redhat.com>

	PR tree-optimization/16447
	* tree-cfg.c (bsi_commit_one_edge_insert): Rename from 
	bsi_commit_edge_inserts_1, and make funtion external.  Return new block.
	(bsi_commit_edge_inserts): Use renamed bsi_commit_one_edge_insert.
	* tree-optimize.c (pass_cleanup_cfg_post_optimizing): Enable listing.
	* tree-flow.h (bsi_commit_one_edge_insert): Extern decl.
	* tree-outof-ssa.c (rewrite_trees): Don't commit edges here.
	(same_stmt_list_p): New.  Return TRUE if edge is to be forwarded.
	(identical_copies_p): New.  Return true is two copies are the same.
	(identical_stmt_lists_p): New.  Return true if stmt lists are the same.
	(analyze_edges_for_bb): New.  Determine how best to insert edge stmts 
	for a basic block.
	(perform_edge_inserts): New.  Determine what to do with all stmts that
	have been inserted on edges.
	(remove_ssa_form):  Analyze and commit edges from here.

2004-09-30  Diego Novillo  <dnovillo@redhat.com>

	* tree-ssa-ccp.c (replace_uses_in, replace_vuse_in,
	substitute_and_fold): Bring from tree-ssa-propagate.c

2004-09-21  Diego Novillo  <dnovillo@redhat.com>

	* Makefile.in (tree-ssa-copy.o): Add dependency on
	tree-ssa-propagate.h.
	* common.opt (ftree-copy-prop): New switch.
	* opts.c (decode_options): Set flag_tree_copy_prop at -O1 and
	higher.
	* timevar.def (TV_TREE_COPY_PROP): Define.
	* tree-cfg.c (tree_can_merge_blocks_p): Update comment.
	(find_taken_edge): Call fold if VAL is a comparison operator.
	* tree-flow.h (get_ptr_info): Declare.
	(kill_redundant_phi_nodes): Remove.
	(execute_ssa_ccp): Declare.
	(execute_copy_prop): Declare.
	* tree-optimize.c (init_tree_optimization_passes): Add
	pass_copy_prop and pass_fre.  Add more instances of pass_ccp.
	* tree-pass.h (pass_copy_prop): Declare.
	* tree-ssa-alias.c (get_ptr_info): Remove static declaration.
	* tree-ssa-ccp.c (get_default_value): Add parameter
	may_use_default_p.
	Update all callers.
	(set_lattice_value): Set SSA_NAME_VALUE.
	(need_imm_uses_for): Return true on PHI nodes and assignments
	that have no V_MAY_DEFs.
	(ccp_initialize): Do not initialize to VARYING DEFs and
	V_MUST_DEFs whose default value is VARYING.
	(execute_ssa_ccp): Make extern.
	* tree-ssa-copy.c: Update header documentation.
	(may_propagate_copy): Do not abort if ORIG is a GIMPLE reg.
	(merge_alias_info): Synchronize flow sensitive alias
	information.
	(need_imm_uses_for, get_first_copy_of, get_last_copy_of,
	set_first_copy_of, dump_copy_of, copy_prop_visit_assignment,
	copy_prop_visit_cond_stmt, copy_prop_visit_stmt,
	copy_prop_visit_phi_node, init_copy_prop, fini_copy_prop,
	execute_copy_prop): New local functions.
	* tree-ssa-pre.c (compute_avail): Also process DECLs.
	(execute_fre): Make extern.
	* tree-ssa-propagate.c: Update copyright years.
	(ssa_prop_init): Clear SSA_NAME_VALUE for every name.
	(replace_uses_in, replace_vuse_in, substitute_and_fold): Move
	from tree-ssa-ccp.c.
	* tree-ssa-propagate.h: Update copyright years.
	(replace_uses_in, substitute_and_fold): Declare.
	* tree-ssa.c (propagate_into_addr, replace_immediate_uses,
	get_eq_name, check_phi_redundancy, kill_redundant_phi_nodes,
	pass_redundant_phi): Remove.
	* tree.h (struct tree_ssa_name): Update comment for field
	value_handle.
	* doc/invoke.texi: Document -ftree-copy-prop.