Comment 15 for bug 637797

Author: prathamesh3492
Date: Fri Oct 28 19:05:12 2016
New Revision: 241660

URL: https://gcc.gnu.org/viewcvs?rev=241660&root=gcc&view=rev
Log:
2016-10-28 Prathamesh Kulkarni <email address hidden>
     Kugan Vivekanandarajah <email address hidden>
     Jim Wilson <email address hidden>

 PR tree-optimization/43721
 * target.def: New hook expand_divmod_libfunc.
 * doc/tm.texi.in: Add hook for TARGET_EXPAND_DIVMOD_LIBFUNC
 * doc/tm.texi: Regenerate.
 * internal-fn.def: Add new entry for DIVMOD ifn.
 * internal-fn.c (expand_DIVMOD): New.
 * tree-ssa-math-opts.c: Include optabs-libfuncs.h, tree-eh.h,
 targhooks.h.
 (widen_mul_stats): Add new field divmod_calls_inserted.
 (target_supports_divmod_p): New.
 (divmod_candidate_p): Likewise.
 (convert_to_divmod): Likewise.
 (pass_optimize_widening_mul::execute): Call
 calculate_dominance_info(), renumber_gimple_stmt_uids() at
 beginning of function. Call convert_to_divmod()
 and record stats for divmod.
 * config/arm/arm.c (arm_expand_divmod_libfunc): Override hook
 TARGET_EXPAND_DIVMOD_LIBFUNC.
 * doc/sourcebuild.texi: Add items for arm_divmod_simode, divmod,
 divmod_simode.

testsuite/
 * lib/target-supports.exp (check_effective_target_divmod): New.
 (check_effective_target_divmod_simode): Likewise.
 (check_effective_target_arm_divmod_simode): Likewise.
 * gcc.dg/divmod-1-simode.c: New test.
 * gcc.dg/divmod-1.c: Likewise.
 * gcc.dg/divmod-2-simode.c: Likewise.
 * gcc.dg/divmod-2.c: Likewise.
 * gcc.dg/divmod-3-simode.c: Likewise.
 * gcc.dg/divmod-3.c: Likewise.
 * gcc.dg/divmod-4-simode.c: Likewise.
 * gcc.dg/divmod-4.c: Likewise.
 * gcc.dg/divmod-5.c: Likewise.
 * gcc.dg/divmod-6-simode.c: Likewise.
 * gcc.dg/divmod-6.c: Likewise.
 * gcc.dg/divmod-7.c: Likewise.

Added:
    trunk/gcc/testsuite/gcc.dg/divmod-1-simode.c
    trunk/gcc/testsuite/gcc.dg/divmod-1.c
    trunk/gcc/testsuite/gcc.dg/divmod-2-simode.c
    trunk/gcc/testsuite/gcc.dg/divmod-2.c
    trunk/gcc/testsuite/gcc.dg/divmod-3-simode.c
    trunk/gcc/testsuite/gcc.dg/divmod-3.c
    trunk/gcc/testsuite/gcc.dg/divmod-4-simode.c
    trunk/gcc/testsuite/gcc.dg/divmod-4.c
    trunk/gcc/testsuite/gcc.dg/divmod-5.c
    trunk/gcc/testsuite/gcc.dg/divmod-6-simode.c
    trunk/gcc/testsuite/gcc.dg/divmod-6.c
    trunk/gcc/testsuite/gcc.dg/divmod-7.c
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/config/arm/arm.c
    trunk/gcc/doc/sourcebuild.texi
    trunk/gcc/doc/tm.texi
    trunk/gcc/doc/tm.texi.in
    trunk/gcc/internal-fn.c
    trunk/gcc/internal-fn.def
    trunk/gcc/target.def
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/testsuite/lib/target-supports.exp
    trunk/gcc/tree-ssa-math-opts.c