Mercurial > hg > CbC > CbC_gcc
comparison gcc/tree-complex.c @ 67:f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
author | nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Tue, 22 Mar 2011 17:18:12 +0900 |
parents | b7f97abdc517 |
children | 04ced10e8804 |
comparison
equal
deleted
inserted
replaced
65:65488c3d617d | 67:f6334be47118 |
---|---|
27 #include "tree-flow.h" | 27 #include "tree-flow.h" |
28 #include "gimple.h" | 28 #include "gimple.h" |
29 #include "tree-iterator.h" | 29 #include "tree-iterator.h" |
30 #include "tree-pass.h" | 30 #include "tree-pass.h" |
31 #include "tree-ssa-propagate.h" | 31 #include "tree-ssa-propagate.h" |
32 #include "diagnostic.h" | |
33 | 32 |
34 | 33 |
35 /* For each complex ssa name, a lattice value. We're interested in finding | 34 /* For each complex ssa name, a lattice value. We're interested in finding |
36 out whether a complex number is degenerate in some way, having only real | 35 out whether a complex number is degenerate in some way, having only real |
37 or only complex parts. */ | 36 or only complex parts. */ |
173 static void | 172 static void |
174 init_parameter_lattice_values (void) | 173 init_parameter_lattice_values (void) |
175 { | 174 { |
176 tree parm, ssa_name; | 175 tree parm, ssa_name; |
177 | 176 |
178 for (parm = DECL_ARGUMENTS (cfun->decl); parm ; parm = TREE_CHAIN (parm)) | 177 for (parm = DECL_ARGUMENTS (cfun->decl); parm ; parm = DECL_CHAIN (parm)) |
179 if (is_complex_reg (parm) | 178 if (is_complex_reg (parm) |
180 && var_ann (parm) != NULL | 179 && var_ann (parm) != NULL |
181 && (ssa_name = gimple_default_def (cfun, parm)) != NULL_TREE) | 180 && (ssa_name = gimple_default_def (cfun, parm)) != NULL_TREE) |
182 VEC_replace (complex_lattice_t, complex_lattice_values, | 181 VEC_replace (complex_lattice_t, complex_lattice_values, |
183 SSA_NAME_VERSION (ssa_name), VARYING); | 182 SSA_NAME_VERSION (ssa_name), VARYING); |
595 gcc_unreachable (); | 594 gcc_unreachable (); |
596 | 595 |
597 case VAR_DECL: | 596 case VAR_DECL: |
598 case RESULT_DECL: | 597 case RESULT_DECL: |
599 case PARM_DECL: | 598 case PARM_DECL: |
600 case INDIRECT_REF: | |
601 case COMPONENT_REF: | 599 case COMPONENT_REF: |
602 case ARRAY_REF: | 600 case ARRAY_REF: |
603 case VIEW_CONVERT_EXPR: | 601 case VIEW_CONVERT_EXPR: |
602 case MEM_REF: | |
604 { | 603 { |
605 tree inner_type = TREE_TYPE (TREE_TYPE (t)); | 604 tree inner_type = TREE_TYPE (TREE_TYPE (t)); |
606 | 605 |
607 t = build1 ((imagpart_p ? IMAGPART_EXPR : REALPART_EXPR), | 606 t = build1 ((imagpart_p ? IMAGPART_EXPR : REALPART_EXPR), |
608 inner_type, unshare_expr (t)); | 607 inner_type, unshare_expr (t)); |
661 | 660 |
662 static void | 661 static void |
663 update_complex_assignment (gimple_stmt_iterator *gsi, tree r, tree i) | 662 update_complex_assignment (gimple_stmt_iterator *gsi, tree r, tree i) |
664 { | 663 { |
665 gimple_stmt_iterator orig_si = *gsi; | 664 gimple_stmt_iterator orig_si = *gsi; |
665 gimple stmt; | |
666 | 666 |
667 if (gimple_in_ssa_p (cfun)) | 667 if (gimple_in_ssa_p (cfun)) |
668 update_complex_components (gsi, gsi_stmt (*gsi), r, i); | 668 update_complex_components (gsi, gsi_stmt (*gsi), r, i); |
669 | 669 |
670 gimple_assign_set_rhs_with_ops (&orig_si, COMPLEX_EXPR, r, i); | 670 gimple_assign_set_rhs_with_ops (&orig_si, COMPLEX_EXPR, r, i); |
671 update_stmt (gsi_stmt (orig_si)); | 671 stmt = gsi_stmt (orig_si); |
672 update_stmt (stmt); | |
673 if (maybe_clean_eh_stmt (stmt)) | |
674 gimple_purge_dead_eh_edges (gimple_bb (stmt)); | |
672 } | 675 } |
673 | 676 |
674 | 677 |
675 /* Generate code at the entry point of the function to initialize the | 678 /* Generate code at the entry point of the function to initialize the |
676 component variables for a complex parameter. */ | 679 component variables for a complex parameter. */ |
679 update_parameter_components (void) | 682 update_parameter_components (void) |
680 { | 683 { |
681 edge entry_edge = single_succ_edge (ENTRY_BLOCK_PTR); | 684 edge entry_edge = single_succ_edge (ENTRY_BLOCK_PTR); |
682 tree parm; | 685 tree parm; |
683 | 686 |
684 for (parm = DECL_ARGUMENTS (cfun->decl); parm ; parm = TREE_CHAIN (parm)) | 687 for (parm = DECL_ARGUMENTS (cfun->decl); parm ; parm = DECL_CHAIN (parm)) |
685 { | 688 { |
686 tree type = TREE_TYPE (parm); | 689 tree type = TREE_TYPE (parm); |
687 tree ssa_name, r, i; | 690 tree ssa_name, r, i; |
688 | 691 |
689 if (TREE_CODE (type) != COMPLEX_TYPE || !is_gimple_reg (parm)) | 692 if (TREE_CODE (type) != COMPLEX_TYPE || !is_gimple_reg (parm)) |
777 | 780 |
778 if (TREE_CODE (lhs) == SSA_NAME) | 781 if (TREE_CODE (lhs) == SSA_NAME) |
779 { | 782 { |
780 if (is_ctrl_altering_stmt (stmt)) | 783 if (is_ctrl_altering_stmt (stmt)) |
781 { | 784 { |
782 edge_iterator ei; | |
783 edge e; | 785 edge e; |
784 | 786 |
785 /* The value is not assigned on the exception edges, so we need not | 787 /* The value is not assigned on the exception edges, so we need not |
786 concern ourselves there. We do need to update on the fallthru | 788 concern ourselves there. We do need to update on the fallthru |
787 edge. Find it. */ | 789 edge. Find it. */ |
788 FOR_EACH_EDGE (e, ei, gsi_bb (*gsi)->succs) | 790 e = find_fallthru_edge (gsi_bb (*gsi)->succs); |
789 if (e->flags & EDGE_FALLTHRU) | 791 if (!e) |
790 goto found_fallthru; | 792 gcc_unreachable (); |
791 gcc_unreachable (); | |
792 found_fallthru: | |
793 | 793 |
794 r = build1 (REALPART_EXPR, inner_type, lhs); | 794 r = build1 (REALPART_EXPR, inner_type, lhs); |
795 i = build1 (IMAGPART_EXPR, inner_type, lhs); | 795 i = build1 (IMAGPART_EXPR, inner_type, lhs); |
796 update_complex_components_on_edge (e, lhs, r, i); | 796 update_complex_components_on_edge (e, lhs, r, i); |
797 } | 797 } |