From 72ea2555d7e28eacb2248e803d6a5bd96b523215 Mon Sep 17 00:00:00 2001 From: Uros Bizjak Date: Fri, 18 Jul 2008 23:01:59 +0200 Subject: [PATCH] re PR target/36786 (ICE in extract_insn, at recog.c:1990) PR target/36786 * config/i386/i386.md (x86_64_shift_adj_1): Rename from x86_64_shift_adj. (x86_64_shift_adj_2): New expander. (x86_64_shift_adj_3): Ditto. * config/i386/i386.c (ix86_split_ashr): Use gen_x86_64_shift_adj_3 to split TImode operands. (ix86_split_ashl): Use gen_x86_64_shift_adj_2 to split TImode operands. (ix86_split_lshr): Ditto. testsuite/ChangeLog: PR target/36786 * gcc.target/i386/pr36786.c: New test. From-SVN: r137967 --- gcc/ChangeLog | 82 ++++++++++++------------- gcc/config/i386/i386.c | 23 ++++--- gcc/config/i386/i386.md | 60 +++++++++++++++++- gcc/testsuite/ChangeLog | 5 ++ gcc/testsuite/gcc.target/i386/pr36786.c | 13 ++++ 5 files changed, 130 insertions(+), 53 deletions(-) create mode 100644 gcc/testsuite/gcc.target/i386/pr36786.c diff --git a/gcc/ChangeLog b/gcc/ChangeLog index e074ef6c6cf..6c719b0b1bd 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,15 @@ +2008-07-18 Uros Bizjak + + PR target/36786 + * config/i386/i386.md (x86_64_shift_adj_1): Rename from + x86_64_shift_adj. + (x86_64_shift_adj_2): New expander. + (x86_64_shift_adj_3): Ditto. + * config/i386/i386.c (ix86_split_ashr): Use gen_x86_64_shift_adj_3 + to split TImode operands. + (ix86_split_ashl): Use gen_x86_64_shift_adj_2 to split TImode operands. + (ix86_split_lshr): Ditto. + 2008-07-18 Kris Van Hees * c-common.c (c_stddef_cpp_builtins): Define __CHAR16_TYPE__ @@ -107,8 +119,7 @@ * cfg.c (dump_reg_info): Avoid C++ keywords. * dwarf2asm.c (dw2_force_const_mem, dw2_asm_output_encoded_addr_rtx): Likewise. - * except.c (gen_eh_region, add_action_record, output_ttype): - Likewise. + * except.c (gen_eh_region, add_action_record, output_ttype): Likewise. * expmed.c (expand_shift): Likewise. * global.c (find_reg): Likewise. * graph.c (draw_edge): Likewise. @@ -209,11 +220,9 @@ * caller-save.c (insert_restore, insert_save, insert_one_insn): Likewise. * combine.c (subst, simplify_set, make_extraction, - make_compound_operation, known_cond, simplify_shift_const_1): - Likewise. + make_compound_operation, known_cond, simplify_shift_const_1): Likewise. * cse.c (make_regs_eqv, merge_equiv_classes, validate_canon_reg, - fold_rtx, equiv_constant, cse_insn, cse_process_notes_1): - Likewise. + fold_rtx, equiv_constant, cse_insn, cse_process_notes_1): Likewise. 2008-07-15 Richard Guenther @@ -317,8 +326,7 @@ * tree-ssa-sccvn.c (pre_info): Remove. (switch_to_PRE_table): Likewise. - (free_scc_vn): Do not clear SSA_NAME_VALUE. - Do not free pre_info. + (free_scc_vn): Do not clear SSA_NAME_VALUE. Do not free pre_info. (set_hashtable_value_ids): Do not create value-ids for the optimistic tables. (run_scc_vn): Remove double test. Remove bogus special-case @@ -340,8 +348,7 @@ 2008-07-14 Richard Guenther - * tree-ssa-pre.c (insert_into_preds_of_block): Do not call - convert. + * tree-ssa-pre.c (insert_into_preds_of_block): Do not call convert. 2008-07-14 Andreas Krebbel @@ -371,8 +378,7 @@ 2008-07-13 Daniel Berlin - * tree-ssa-pre.c (fully_constant_expression): Add fold_convert - calls. + * tree-ssa-pre.c (fully_constant_expression): Add fold_convert calls. (create_expression_by_pieces): Fix typo. (do_regular_insertion): Use debug counter here too. @@ -503,8 +509,7 @@ 2008-07-10 Daniel Berlin - * tree-ssa-pre.c (create_expression_by_pieces): Add fold_convert - calls. + * tree-ssa-pre.c (create_expression_by_pieces): Add fold_convert calls. (eliminate): Ditto. (execute_pre): Call loop_optimizer_finalize in early exit. @@ -684,8 +689,7 @@ 2008-07-08 Jakub Jelinek - * tree-sra.c (sra_build_assignment): Handle CONVERT_EXPR_P - dst. + * tree-sra.c (sra_build_assignment): Handle CONVERT_EXPR_P dst. 2008-07-05 Daniel Berlin @@ -693,7 +697,7 @@ Fix PR tree-optimization/35286 Fix PR tree-optimization/35287 * Makefile.in (OBJS-common): Remove tree-vn.o. - tree-vn.o: Remove. + (tree-vn.o): Remove. * dbgcnt.def: Add treepre_insert debug counter. * gcc/tree-flow.h (add_to_value): Updated for other changes. (debug_value_expressions): Ditto. @@ -731,23 +735,19 @@ (value_id_constant_p): Ditto. (vn_reference_compute_hash): De-staticify. (copy_reference_ops_from_ref): Don't use get_callee_fndecl. - Disable some code with a FIXME. - Remove VALUE_HANDLE use. - (valueize_refs): Update opcode if it changes from ssa name to - constant. + Disable some code with a FIXME. Remove VALUE_HANDLE use. + (valueize_refs): Update opcode if it changes from ssa name to constant. (vn_reference_lookup_1): Add new argument. (vn_reference_lookup): Ditto. (vn_reference_lookup_pieces): New function. - (vn_reference_insert): Add return type. Modify to deal with value - ids. + (vn_reference_insert): Add return type. Modify to deal with value ids. (vn_reference_insert_pieces): New function. (vn_nary_op_compute_hash): De-staticify. (vn_nary_op_eq): Ditto. (vn_nary_op_lookup_pieces): New function. (vn_nary_op_lookup): Add new argument. (vn_nary_op_insert_pieces): New function. - (vn_nary_op_insert): Add return type. Modify to deal with value - ids. + (vn_nary_op_insert): Add return type. Modify to deal with value ids. (vn_phi_insert): Ditto. (visit_unary_op): Update for callee changes. (visit_binary_op): Ditto. @@ -827,17 +827,16 @@ 2008-07-07 Fernando Pereira - * tree-ssa-structalias.c (compute_points_to_sets): Add call to - dump_constraint_graph. - (dump_constraint_edge): New function. - (dump_constraint_graph): New function. - (debug_constraint_graph): New function. - (dump_constraint): Removed useless comparison. - * tree-ssa-structalias.h (dump_constraint_edge): Declare. - (dump_constraint_graph): Declare. - (debug_constraint_graph): Declare. - * tree-dump.c (struct dump_option_value_info): Declare - TDF_GRAPH. + * tree-ssa-structalias.c (compute_points_to_sets): Add call to + dump_constraint_graph. + (dump_constraint_edge): New function. + (dump_constraint_graph): New function. + (debug_constraint_graph): New function. + (dump_constraint): Removed useless comparison. + * tree-ssa-structalias.h (dump_constraint_edge): Declare. + (dump_constraint_graph): Declare. + (debug_constraint_graph): Declare. + * tree-dump.c (struct dump_option_value_info): Declare TDF_GRAPH. 2008-07-07 Kai Tietz @@ -902,8 +901,7 @@ 2008-07-07 Daniel Jacobowitz - * function.c (assign_parm_remove_parallels): Check mode of - entry_parm. + * function.c (assign_parm_remove_parallels): Check mode of entry_parm. (assign_parm_setup_block_p): Also check mode of entry_parm. 2008-07-07 Richard Guenther @@ -1073,14 +1071,13 @@ 2008-07-04 Roger Sayle - * config/rs6000/host-darwin.c (darwin_rs6000_extra_siganls): Cast + * config/rs6000/host-darwin.c (darwin_rs6000_extra_signals): Cast the "void*" result of xmalloc to "char*" to fix bootstrap breakage. 2008-07-04 Kaz Kojima PR target/36684 - * config/sh/sh.h (OVERRIDE_OPTIONS): Disable -fschedule-insns - for PIC. + * config/sh/sh.h (OVERRIDE_OPTIONS): Disable -fschedule-insns for PIC. 2008-07-04 Jakub Jelinek @@ -1125,8 +1122,7 @@ Likewise. * ggc-common.c (hash_descriptor, eq_descriptor, hash_ptr, eq_ptr, loc_descriptor, ggc_prune_ptr, ggc_free_overhead, - final_cmp_statistic, cmp_statistic, dump_ggc_loc_statistics): - Likewise. + final_cmp_statistic, cmp_statistic, dump_ggc_loc_statistics): Likewise. * varray.c (hash_descriptor, eq_descriptor, varray_descriptor): Likewise. diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index d910bd24250..e68f35a24c6 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -14723,10 +14723,13 @@ ix86_split_ashl (rtx *operands, rtx scratch, enum machine_mode mode) ix86_expand_clear (scratch); emit_insn ((mode == DImode ? gen_x86_shift_adj_1 - : gen_x86_64_shift_adj) (high[0], low[0], operands[2], scratch)); + : gen_x86_64_shift_adj_1) (high[0], low[0], operands[2], + scratch)); } else - emit_insn (gen_x86_shift_adj_2 (high[0], low[0], operands[2])); + emit_insn ((mode == DImode + ? gen_x86_shift_adj_2 + : gen_x86_64_shift_adj_2) (high[0], low[0], operands[2])); } void @@ -14800,11 +14803,13 @@ ix86_split_ashr (rtx *operands, rtx scratch, enum machine_mode mode) GEN_INT (single_width - 1))); emit_insn ((mode == DImode ? gen_x86_shift_adj_1 - : gen_x86_64_shift_adj) (low[0], high[0], operands[2], - scratch)); + : gen_x86_64_shift_adj_1) (low[0], high[0], operands[2], + scratch)); } else - emit_insn (gen_x86_shift_adj_3 (low[0], high[0], operands[2])); + emit_insn ((mode == DImode + ? gen_x86_shift_adj_3 + : gen_x86_64_shift_adj_3) (low[0], high[0], operands[2])); } } @@ -14863,11 +14868,13 @@ ix86_split_lshr (rtx *operands, rtx scratch, enum machine_mode mode) ix86_expand_clear (scratch); emit_insn ((mode == DImode ? gen_x86_shift_adj_1 - : gen_x86_64_shift_adj) (low[0], high[0], operands[2], - scratch)); + : gen_x86_64_shift_adj_1) (low[0], high[0], operands[2], + scratch)); } else - emit_insn (gen_x86_shift_adj_2 (low[0], high[0], operands[2])); + emit_insn ((mode == DImode + ? gen_x86_shift_adj_2 + : gen_x86_64_shift_adj_2) (low[0], high[0], operands[2])); } } diff --git a/gcc/config/i386/i386.md b/gcc/config/i386/i386.md index 45e5595fab2..e7a9827c5b9 100644 --- a/gcc/config/i386/i386.md +++ b/gcc/config/i386/i386.md @@ -10917,7 +10917,7 @@ (set_attr "athlon_decode" "vector") (set_attr "amdfam10_decode" "vector")]) -(define_expand "x86_64_shift_adj" +(define_expand "x86_64_shift_adj_1" [(set (reg:CCZ FLAGS_REG) (compare:CCZ (and:QI (match_operand:QI 2 "register_operand" "") (const_int 64)) @@ -10933,6 +10933,34 @@ "TARGET_64BIT" "") +(define_expand "x86_64_shift_adj_2" + [(use (match_operand:DI 0 "register_operand" "")) + (use (match_operand:DI 1 "register_operand" "")) + (use (match_operand:QI 2 "register_operand" ""))] + "TARGET_64BIT" +{ + rtx label = gen_label_rtx (); + rtx tmp; + + emit_insn (gen_testqi_ccz_1 (operands[2], GEN_INT (64))); + + tmp = gen_rtx_REG (CCZmode, FLAGS_REG); + tmp = gen_rtx_EQ (VOIDmode, tmp, const0_rtx); + tmp = gen_rtx_IF_THEN_ELSE (VOIDmode, tmp, + gen_rtx_LABEL_REF (VOIDmode, label), + pc_rtx); + tmp = emit_jump_insn (gen_rtx_SET (VOIDmode, pc_rtx, tmp)); + JUMP_LABEL (tmp) = label; + + emit_move_insn (operands[0], operands[1]); + ix86_expand_clear (operands[1]); + + emit_label (label); + LABEL_NUSES (label) = 1; + + DONE; +}) + (define_expand "ashldi3" [(set (match_operand:DI 0 "shiftdi_operand" "") (ashift:DI (match_operand:DI 1 "ashldi_input_operand" "") @@ -11880,7 +11908,35 @@ "" "ix86_expand_binary_operator (ASHIFTRT, DImode, operands); DONE;") -(define_insn "*ashrdi3_63_rex64" +(define_expand "x86_64_shift_adj_3" + [(use (match_operand:DI 0 "register_operand" "")) + (use (match_operand:DI 1 "register_operand" "")) + (use (match_operand:QI 2 "register_operand" ""))] + "" +{ + rtx label = gen_label_rtx (); + rtx tmp; + + emit_insn (gen_testqi_ccz_1 (operands[2], GEN_INT (64))); + + tmp = gen_rtx_REG (CCZmode, FLAGS_REG); + tmp = gen_rtx_EQ (VOIDmode, tmp, const0_rtx); + tmp = gen_rtx_IF_THEN_ELSE (VOIDmode, tmp, + gen_rtx_LABEL_REF (VOIDmode, label), + pc_rtx); + tmp = emit_jump_insn (gen_rtx_SET (VOIDmode, pc_rtx, tmp)); + JUMP_LABEL (tmp) = label; + + emit_move_insn (operands[0], operands[1]); + emit_insn (gen_ashrdi3_63_rex64 (operands[1], operands[1], GEN_INT (63))); + + emit_label (label); + LABEL_NUSES (label) = 1; + + DONE; +}) + +(define_insn "ashrdi3_63_rex64" [(set (match_operand:DI 0 "nonimmediate_operand" "=*d,rm") (ashiftrt:DI (match_operand:DI 1 "nonimmediate_operand" "*a,0") (match_operand:DI 2 "const_int_operand" "i,i"))) diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 38e498c5759..464e0574339 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2008-07-18 Uros Bizjak + + PR target/36786 + * gcc.target/i386/pr36786.c: New test. + 2008-07-18 Dodji Seketeli PR c++/36407 diff --git a/gcc/testsuite/gcc.target/i386/pr36786.c b/gcc/testsuite/gcc.target/i386/pr36786.c new file mode 100644 index 00000000000..692518e1bd1 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/pr36786.c @@ -0,0 +1,13 @@ +/* { dg-do compile } */ +/* { dg-require-effective-target lp64 } */ + +typedef int DItype __attribute__ ((mode (DI))); +typedef unsigned int UDItype __attribute__ ((mode (DI))); +typedef int TItype __attribute__ ((mode (TI))); + +__floattisf (TItype u) +{ + DItype hi = u >> (8 * 8); + UDItype count, shift; + hi = u >> shift; +} -- 2.30.2