re PR target/61092 (wide-int merge broke alpha bootstrap)
authorUros Bizjak <uros@gcc.gnu.org>
Thu, 8 May 2014 19:02:28 +0000 (21:02 +0200)
committerUros Bizjak <uros@gcc.gnu.org>
Thu, 8 May 2014 19:02:28 +0000 (21:02 +0200)
PR target/61092
* config/alpha/alpha.c: Include gimple-iterator.h.
(alpha_gimple_fold_builtin): New function.  Move
ALPHA_BUILTIN_UMULH folding from ...
(alpha_fold_builtin): ... here.
(TARGET_GIMPLE_FOLD_BUILTIN): New define.

From-SVN: r210233

gcc/ChangeLog
gcc/config/alpha/alpha.c

index 38c03f5..1ec6cf4 100644 (file)
@@ -1,12 +1,19 @@
+2014-05-08  Uros Bizjak  <ubizjak@gmail.com>
+
+       PR target/61092
+       * config/alpha/alpha.c: Include gimple-iterator.h.
+       (alpha_gimple_fold_builtin): New function.  Move
+       ALPHA_BUILTIN_UMULH folding from ...
+       (alpha_fold_builtin): ... here.
+       (TARGET_GIMPLE_FOLD_BUILTIN): New define.
+
 2014-05-08  Wei Mi  <wmi@google.com>
 
        PR target/58066
-       * config/i386/i386.c (ix86_compute_frame_layout):
-       Update preferred_stack_boundary for call, expanded from
-       tls descriptor.
-       * config/i386/i386.md:
-       (*tls_global_dynamic_32_gnu): Update RTX to depend on
-       SP register.
+       * config/i386/i386.c (ix86_compute_frame_layout): Update
+       preferred_stack_boundary for call, expanded from tls descriptor.
+       * config/i386/i386.md (*tls_global_dynamic_32_gnu): Update RTX
+       to depend on SP register.
        (*tls_local_dynamic_base_32_gnu): Ditto.
        (*tls_local_dynamic_32_once): Ditto.
        (tls_global_dynamic_64_<mode>): Set
 2014-05-08  Ramana Radhakrishnan  <ramana.radhakrishnan@arm.com>
 
        * wide-int.cc (UTItype): Define.
-       (UDWtype): Define for appropriate W_TYPE_SIZE.
+       (UDWtype): Define for appropriate W_TYPE_SIZE.
 
 2014-05-08  Marc Glisse  <marc.glisse@inria.fr>
 
        (maybe_skip_until): Use translate to take into account
        lattices when trying to do disambiguations.
        (get_continuation_for_phi_1): Likewise.
-       (get_continuation_for_phi): Adjust for added translate
-       arguments.
+       (get_continuation_for_phi): Adjust for added translate arguments.
        (walk_non_aliased_vuses): Likewise.
-       * tree-ssa-alias.h (get_continuation_for_phi): Adjust
-       prototype.
+       * tree-ssa-alias.h (get_continuation_for_phi): Adjust prototype.
        (walk_non_aliased_vuses): Likewise.
        (call_may_clobber_ref_p_1): Declare.
-       * tree-ssa-sccvn.c (vn_reference_lookup_3): Also
-       disambiguate against calls.  Stop early if we are
-       only supposed to disambiguate.
+       * tree-ssa-sccvn.c (vn_reference_lookup_3): Also disambiguate against
+       calls.  Stop early if we are only supposed to disambiguate.
        * tree-ssa-pre.c (translate_vuse_through_block): Adjust.
 
 2014-05-07  Joern Rennecke  <joern.rennecke@embecosm.com>
        * ipa-devirt.c (get_class_context): Allow POD to change to non-POD.
 
 2014-05-05  Radovan Obradovic  <robradovic@mips.com>
-            Tom de Vries  <tom@codesourcery.com>
+           Tom de Vries  <tom@codesourcery.com>
 
-       * target.def (call_fusage_contains_non_callee_clobbers): New DEFHOOKPOD.
+       * target.def (call_fusage_contains_non_callee_clobbers): New
+       DEFHOOKPOD.
        * doc/tm.texi.in (@node Stack and Calling): Add Miscellaneous Register
        Hooks to @menu.
        (@node Miscellaneous Register Hooks): New node.
 2014-05-05  Richard Biener  <rguenther@suse.de>
 
        PR middle-end/61010
-       * fold-const.c (fold_binary_loc): Consistently avoid
-       canonicalizing X & CST away from a CST that is the mask
-       of a mode.
+       * fold-const.c (fold_binary_loc): Consistently avoid canonicalizing
+       X & CST away from a CST that is the mask of a mode.
 
 2014-05-05  Jan-Benedict Glaw  <jbglaw@lug-owl.de>
 
 
        * doc/invoke.texi: Fix typo.
        * tree-vrp.c: Fix typos.
-       * gimple.c (infer_nonnull_range): Reorder operands of an &&
-       condition.
+       * gimple.c (infer_nonnull_range): Reorder operands of an && condition.
 
 2014-04-29  Zhenqiang Chen  <zhenqiang.chen@linaro.org>
 
 2014-04-28  Richard Biener  <rguenther@suse.de>
 
        * tree-pass.h (execute_pass_list): Adjust prototype.
-       * passes.c (pass_manager::execute_early_local_passes):
-       Adjust.
+       * passes.c (pass_manager::execute_early_local_passes): Adjust.
        (do_per_function): Change callback signature, push all actual
        work to the callbals.
        (do_per_function_toporder): Likewise.
 
 2014-04-25  Cary Coutant  <ccoutant@google.com>
 
-        PR debug/60929
+       PR debug/60929
        * dwarf2out.c (should_move_die_to_comdat): A type definition
-        can contain a subprogram definition, but don't move it to a
-        comdat unit.
+       can contain a subprogram definition, but don't move it to a
+       comdat unit.
        (clone_as_declaration): Copy DW_AT_abstract_origin attribute.
-        (generate_skeleton_bottom_up): Remove DW_AT_object_pointer attribute
-        from original DIE.
+       (generate_skeleton_bottom_up): Remove DW_AT_object_pointer attribute
+       from original DIE.
        (clone_tree_hash): Rename to...
        (clone_tree_partial): ...this; change callers.  Copy
-        DW_TAG_subprogram DIEs as declarations.
+       DW_TAG_subprogram DIEs as declarations.
        (copy_decls_walk): Don't copy children of a declaration into a
-        type unit.
+       type unit.
 
 2014-04-25  H.J. Lu  <hongjiu.lu@intel.com>
 
 
 2014-04-25  Kyrylo Tkachov  <kyrylo.tkachov@arm.com>
 
-       * config/arm/arm.c (arm_cortex_a8_tune): Initialise
-       T16-related fields.
+       * config/arm/arm.c (arm_cortex_a8_tune): Initialise T16-related fields.
 
 2014-04-25  Bill Schmidt  <wschmidt@linux.vnet.ibm.com>
 
        clobbers.
 
 2014-04-25  Radovan Obradovic  <robradovic@mips.com>
-            Tom de Vries  <tom@codesourcery.com>
+           Tom de Vries  <tom@codesourcery.com>
 
        * rtlanal.c (find_all_hard_reg_sets): Add bool implicit parameter and
        handle.
 2014-04-24  Michael Meissner  <meissner@linux.vnet.ibm.com>
 
        * doc/extend.texi (PowerPC Built-in Functions): Document new
-       powerpc extended divide, bcd, pack/unpack 128-bit, builtin
-       functions.
+       powerpc extended divide, bcd, pack/unpack 128-bit, builtin functions.
        (PowerPC AltiVec/VSX Built-in Functions): Likewise.
 
        * config/rs6000/predicates.md (const_0_to_3_operand): New
        support for decimal floating point builtin functions.
        (rs6000_expand_ternop_builtin): Add checks for the new builtin
        functions that take constant arguments.
-       (rs6000_invalid_builtin): Add decimal floating point builtin
-       support.
+       (rs6000_invalid_builtin): Add decimal floating point builtin support.
        (rs6000_init_builtins): Setup long double, _Decimal64, and
        _Decimal128 types for new builtin functions.
        (builtin_function_type): Set the unsigned flags appropriately for
        builtin functions.
        (UNSPEC_CDTBCD): Likewise.
        (UNSPEC_CBCDTD): Likewise.
-       (UNSPEC_DIVE): Add support for new extended divide builtin
-       functions.
+       (UNSPEC_DIVE): Add support for new extended divide builtin functions.
        (UNSPEC_DIVEO): Likewise.
        (UNSPEC_DIVEU): Likewise.
        (UNSPEC_DIVEUO): Likewise.
        (addg6s): Add new BCD builtin functions.
        (cdtbcd): Likewise.
        (cbcdtd): Likewise.
-       (UNSPEC_DIV_EXTEND): Add support for new extended divide
-       instructions.
+       (UNSPEC_DIV_EXTEND): Add support for new extended divide instructions.
        (div_extend): Likewise.
        (div<div_extend>_<mode>"): Likewise.
        (FP128_64): Add support for new builtin functions to pack/unpack
        * config/aarch64/aarch64.c (aarch64_evpc_tbl): Enable for bigendian.
 
 2014-04-24  Radovan Obradovic  <robradovic@mips.com>
-            Tom de Vries  <tom@codesourcery.com>
+           Tom de Vries  <tom@codesourcery.com>
 
        * reg-notes.def (REG_NOTE (CALL_DECL)): New reg-note REG_CALL_DECL.
        * calls.c (expand_call, emit_library_call_value_1): Add REG_CALL_DECL
        * emit-rtl.c (try_split): Same.
 
 2014-04-24  Radovan Obradovic  <robradovic@mips.com>
-            Tom de Vries  <tom@codesourcery.com>
+           Tom de Vries  <tom@codesourcery.com>
 
        * common.opt (fuse-caller-save): New option.
 
 2014-04-24  Tejas Belagod  <tejas.belagod@arm.com>
 
-       * config/aarch64/aarch64.c (aarch64_evpc_tbl): Reverse order of elements
-       for big-endian.
+       * config/aarch64/aarch64.c (aarch64_evpc_tbl): Reverse order of
+       elements for big-endian.
 
 2014-04-24  Richard Biener  <rguenther@suse.de>
 
        (is_a_helper <const gimple_statement_catch *>::test): ...this.
        (is_a_helper <const gimple_statement_resx>::test): Convert to...
        (is_a_helper <const gimple_statement_resx *>::test): ...this.
-       (is_a_helper <const gimple_statement_eh_dispatch>::test):
-       Convert to...
-       (is_a_helper <const gimple_statement_eh_dispatch *>::test):
-       ...this.
-       (is_a_helper <const gimple_statement_eh_filter>::test): Convert
-       to...
+       (is_a_helper <const gimple_statement_eh_dispatch>::test): Convert to...
+       (is_a_helper <const gimple_statement_eh_dispatch *>::test): ...this.
+       (is_a_helper <const gimple_statement_eh_filter>::test): Convert to...
        (is_a_helper <const gimple_statement_eh_filter *>::test): ...this.
        (is_a_helper <const gimple_statement_omp_atomic_load>::test):
        Convert to...
        Convert to...
        (is_a_helper <const gimple_statement_omp_atomic_store *>::test):
        ...this.
-       (is_a_helper <const gimple_statement_omp_return>::test): Convert
-       to...
+       (is_a_helper <const gimple_statement_omp_return>::test): Convert to...
        (is_a_helper <const gimple_statement_omp_return *>::test): ...this.
        (is_a_helper <const gimple_statement_omp_continue>::test): Convert
        to...
        (is_a_helper <const gimple_statement_omp_critical *>::test): ...this.
        (is_a_helper <const gimple_statement_omp_for>::test): Convert to...
        (is_a_helper <const gimple_statement_omp_for *>::test): ...this.
-       (is_a_helper <const gimple_statement_omp_taskreg>::test): Convert
-       to...
+       (is_a_helper <const gimple_statement_omp_taskreg>::test): Convert to...
        (is_a_helper <const gimple_statement_omp_taskreg *>::test): ...this.
        (is_a_helper <const gimple_statement_omp_parallel>::test): Convert
        to...
        (is_a_helper <const gimple_statement_omp_parallel *>::test): ...this.
-       (is_a_helper <const gimple_statement_omp_target>::test): Convert
-       to...
+       (is_a_helper <const gimple_statement_omp_target>::test): Convert to...
        (is_a_helper <const gimple_statement_omp_target *>::test): ...this.
        (is_a_helper <const gimple_statement_omp_sections>::test): Convert
        to...
        (is_a_helper <const gimple_statement_omp_sections *>::test): ...this.
-       (is_a_helper <const gimple_statement_omp_single>::test): Convert
-       to...
+       (is_a_helper <const gimple_statement_omp_single>::test): Convert to...
        (is_a_helper <const gimple_statement_omp_single *>::test): ...this.
-       (is_a_helper <const gimple_statement_omp_teams>::test): Convert
-       to...
+       (is_a_helper <const gimple_statement_omp_teams>::test): Convert to...
        (is_a_helper <const gimple_statement_omp_teams *>::test): ...this.
-       (is_a_helper <const gimple_statement_omp_task>::test): Convert
-       to...
+       (is_a_helper <const gimple_statement_omp_task>::test): Convert to...
        (is_a_helper <const gimple_statement_omp_task *>::test): ...this.
        (is_a_helper <const gimple_statement_phi>::test): Convert to...
        (is_a_helper <const gimple_statement_phi *>::test): ...this.
-       (is_a_helper <const gimple_statement_transaction>::test): Convert
-       to...
+       (is_a_helper <const gimple_statement_transaction>::test): Convert to...
        (is_a_helper <const gimple_statement_transaction *>::test): ...this.
-       (is_a_helper <const gimple_statement_with_ops>::test): Convert
-       to...
+       (is_a_helper <const gimple_statement_with_ops>::test): Convert to...
        (is_a_helper <const gimple_statement_with_ops *>::test): ...this.
        (is_a_helper <gimple_statement_with_ops>::test): Convert to...
        (is_a_helper <gimple_statement_with_ops *>::test): ...this.
-       (is_a_helper <const gimple_statement_with_memory_ops>::test):
-       Convert to...
+       (is_a_helper <const gimple_statement_with_memory_ops>::test): Convert
+       to...
        (is_a_helper <const gimple_statement_with_memory_ops *>::test):
        ...this.
-       (is_a_helper <gimple_statement_with_memory_ops>::test): Convert
-       to...
+       (is_a_helper <gimple_statement_with_memory_ops>::test): Convert to...
        (is_a_helper <gimple_statement_with_memory_ops *>::test): ...this.
 
        (gimple_use_ops): Update for removal of implicit pointer from the
        invalidate outputs from statements that do not produce useful
        outputs for threading.
 
-2014-04-23 Venkataramanan Kumar  <venkataramanan.kumar@linaro.org>
+2014-04-23  Venkataramanan Kumar  <venkataramanan.kumar@linaro.org>
 
        * config/aarch64/aarch64.md (stack_protect_set, stack_protect_test)
        (stack_protect_set_<mode>, stack_protect_test_<mode>): Add
 
 2014-04-23  Kyrylo Tkachov  <kyrylo.tkachov@arm.com>
 
-       * config/aarch64/aarch64.md (rev16<mode>2): New pattern.
-       (rev16<mode>2_alt): Likewise.
-       * config/aarch64/aarch64.c (aarch64_rtx_costs): Handle rev16 case.
-       * config/arm/aarch-common.c (aarch_rev16_shright_mask_imm_p): New.
-       (aarch_rev16_shleft_mask_imm_p): Likewise.
-       (aarch_rev16_p_1): Likewise.
-       (aarch_rev16_p): Likewise.
-       * config/arm/aarch-common-protos.h (aarch_rev16_p): Declare extern.
-       (aarch_rev16_shright_mask_imm_p): Likewise.
-       (aarch_rev16_shleft_mask_imm_p): Likewise.
+       * config/aarch64/aarch64.md (rev16<mode>2): New pattern.
+       (rev16<mode>2_alt): Likewise.
+       * config/aarch64/aarch64.c (aarch64_rtx_costs): Handle rev16 case.
+       * config/arm/aarch-common.c (aarch_rev16_shright_mask_imm_p): New.
+       (aarch_rev16_shleft_mask_imm_p): Likewise.
+       (aarch_rev16_p_1): Likewise.
+       (aarch_rev16_p): Likewise.
+       * config/arm/aarch-common-protos.h (aarch_rev16_p): Declare extern.
+       (aarch_rev16_shright_mask_imm_p): Likewise.
+       (aarch_rev16_shleft_mask_imm_p): Likewise.
 
 2014-04-23  Kyrylo Tkachov  <kyrylo.tkachov@arm.com>
 
-       * config/arm/aarch-common-protos.h (alu_cost_table): Add rev field.
-       * config/arm/aarch-cost-tables.h (generic_extra_costs): Specify
-       rev cost.
-       (cortex_a53_extra_costs): Likewise.
-       (cortex_a57_extra_costs): Likewise.
-       * config/arm/arm.c (cortexa9_extra_costs): Likewise.
-       (cortexa7_extra_costs): Likewise.
-       (cortexa8_extra_costs): Likewise.
-       (cortexa12_extra_costs): Likewise.
-       (cortexa15_extra_costs): Likewise.
-       (v7m_extra_costs): Likewise.
-       (arm_new_rtx_costs): Handle BSWAP.
+       * config/arm/aarch-common-protos.h (alu_cost_table): Add rev field.
+       * config/arm/aarch-cost-tables.h (generic_extra_costs): Specify
+       rev cost.
+       (cortex_a53_extra_costs): Likewise.
+       (cortex_a57_extra_costs): Likewise.
+       * config/arm/arm.c (cortexa9_extra_costs): Likewise.
+       (cortexa7_extra_costs): Likewise.
+       (cortexa8_extra_costs): Likewise.
+       (cortexa12_extra_costs): Likewise.
+       (cortexa15_extra_costs): Likewise.
+       (v7m_extra_costs): Likewise.
+       (arm_new_rtx_costs): Handle BSWAP.
 
 2013-04-23  Kyrylo Tkachov  <kyrylo.tkachov@arm.com>
 
-       * config/arm/arm.c (cortexa8_extra_costs): New table.
-       (arm_cortex_a8_tune): New tuning struct.
-       * config/arm/arm-cores.def (cortex-a8): Use cortex_a8 tuning struct.
+       * config/arm/arm.c (cortexa8_extra_costs): New table.
+       (arm_cortex_a8_tune): New tuning struct.
+       * config/arm/arm-cores.def (cortex-a8): Use cortex_a8 tuning struct.
 
 2014-04-23  Kyrylo Tkachov  <kyrylo.tkachov@arm.com>
 
-       * config/arm/arm.c (arm_new_rtx_costs): Handle FMA.
+       * config/arm/arm.c (arm_new_rtx_costs): Handle FMA.
 
 2014-04-23  Richard Biener  <rguenther@suse.de>
 
        (has_32bit_hwmult): Rename to use_32bit_hwmult.  Add support for
        -mhwmult command line option.
        (msp430_hwmult_enabled): Delete.
-       (msp43o_output_labelref): Add support for -mhwmult command line
-       option.
+       (msp43o_output_labelref): Add support for -mhwmult command line option.
        * config/msp430/msp430.md (mulhisi3, umulhisi3, mulsidi3)
        (umulsidi3): Likewise.
        * config/msp430/msp430.opt (mmcu): Add Report attribute.
 
        * gcc/config/aarch64/aarch64-simd.md (aarch64_s<optab><mode>):
        Pattern extended.
-       * config/aarch64/aarch64-simd-builtins.def (sqneg): Iterator
-       extended.
+       * config/aarch64/aarch64-simd-builtins.def (sqneg): Iterator extended.
        (sqabs): Likewise.
        * config/aarch64/arm_neon.h (vqneg_s64): New intrinsic.
        (vqnegd_s64): Likewise.
 
 2014-04-22  Alex Velenko  <Alex.Velenko@arm.com>
 
-       * config/aarch64/aarch64-builtins.c (BUILTIN_VDQF_DF): Macro
-       added.
-       * config/aarch64/aarch64-simd-builtins.def (frintn): Use added
-       macro.
-       * config/aarch64/aarch64-simd.md (<frint_pattern>): Comment
-       corrected.
+       * config/aarch64/aarch64-builtins.c (BUILTIN_VDQF_DF): Macro added.
+       * config/aarch64/aarch64-simd-builtins.def (frintn): Use added macro.
+       * config/aarch64/aarch64-simd.md (<frint_pattern>): Comment corrected.
        * config/aarch64/aarch64.md (<frint_pattern>): Likewise.
        * config/aarch64/arm_neon.h (vrnd_f64): Added.
        (vrnda_f64): Likewise.
index df4cc1b..dc07a02 100644 (file)
@@ -62,6 +62,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "gimple-expr.h"
 #include "is-a.h"
 #include "gimple.h"
+#include "gimple-iterator.h"
 #include "gimplify.h"
 #include "gimple-ssa.h"
 #include "stringpool.h"
@@ -7042,9 +7043,6 @@ alpha_fold_builtin (tree fndecl, int n_args, tree *op,
     case ALPHA_BUILTIN_MSKQH:
       return alpha_fold_builtin_mskxx (op, opint, op_const, 0xff, true);
 
-    case ALPHA_BUILTIN_UMULH:
-      return fold_build2 (MULT_HIGHPART_EXPR, alpha_dimode_u, op[0], op[1]);
-
     case ALPHA_BUILTIN_ZAP:
       opint[1] ^= 0xff;
       /* FALLTHRU */
@@ -7094,6 +7092,49 @@ alpha_fold_builtin (tree fndecl, int n_args, tree *op,
       return NULL;
     }
 }
+
+bool
+alpha_gimple_fold_builtin (gimple_stmt_iterator *gsi)
+{
+  bool changed = false;
+  gimple stmt = gsi_stmt (*gsi);
+  tree call = gimple_call_fn (stmt);
+  gimple new_stmt = NULL;
+
+  if (call)
+    {
+      tree fndecl = gimple_call_fndecl (stmt);
+
+      if (fndecl)
+       {
+         tree arg0, arg1;
+
+         switch (DECL_FUNCTION_CODE (fndecl))
+           {
+           case ALPHA_BUILTIN_UMULH:
+             arg0 = gimple_call_arg (stmt, 0);
+             arg1 = gimple_call_arg (stmt, 1);
+
+             new_stmt
+               = gimple_build_assign_with_ops (MULT_HIGHPART_EXPR,
+                                               gimple_call_lhs (stmt),
+                                               arg0,
+                                               arg1);
+             break;
+           default:
+             break;
+           }
+       }
+    }
+
+  if (new_stmt)
+    {
+      gsi_replace (gsi, new_stmt, true);
+      changed = true;
+    }
+
+  return changed;
+}
 \f
 /* This page contains routines that are used to determine what the function
    prologue and epilogue code will do and write them out.  */
@@ -9790,6 +9831,8 @@ alpha_canonicalize_comparison (int *code, rtx *op0, rtx *op1,
 #define TARGET_EXPAND_BUILTIN alpha_expand_builtin
 #undef  TARGET_FOLD_BUILTIN
 #define TARGET_FOLD_BUILTIN alpha_fold_builtin
+#undef  TARGET_GIMPLE_FOLD_BUILTIN
+#define TARGET_GIMPLE_FOLD_BUILTIN alpha_gimple_fold_builtin
 
 #undef TARGET_FUNCTION_OK_FOR_SIBCALL
 #define TARGET_FUNCTION_OK_FOR_SIBCALL alpha_function_ok_for_sibcall