This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug tree-optimization/23109] [4.1 Regression] compiler generates wrong code leading to spurious division by zero with -funsafe-math-optimizations (instead of -ftrapping-math)



------- Comment #16 from bonzini at gnu dot org  2006-01-11 14:29 -------
Subject: Bug 23109

Author: bonzini
Date: Wed Jan 11 14:29:29 2006
New Revision: 109586

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=109586
Log:
gcc:
2006-01-11  Paolo Bonzini  <bonzini@gnu.org>

        PR tree-optimization/23109
        PR tree-optimization/23948
        PR tree-optimization/24123

        * Makefile.in (tree-ssa-math-opts.o): Adjust dependencies.
        * tree-cfg.c (single_noncomplex_succ): New.
        * tree-flow.h (single_noncomplex_succ): Declare it.
        * tree-ssa-math-opts.c (enum place_reciprocal): Remove.
        * tree-ssa-math-opts.c (enum place_reciprocal): Remove.
        (struct occurrence, occ_head, occ_pool, is_divide_by, compute_merit,
        insert_bb, register_division_in, insert_reciprocals,
        replace_reciprocal, free_bb): New.
        (execute_cse_reciprocals_1): Rewritten.
        (execute_cse_reciprocals): Adjust calls to execute_cse_reciprocals_1.
        Do not commit any edge insertion.  Always compute dominators and
        create the allocation pool.
        * target-def.h (TARGET_MIN_DIVISIONS_FOR_RECIP_MUL): New.
        * target.h (struct gcc_target): Add min_divistions_for_recip_mul.
        * targhooks.c (default_min_divistions_for_recip_mul): New.
        * targhooks.h (default_min_divistions_for_recip_mul): New prototype.
        * passes.c (init_optimization_passes): Run recip after tree loop
        optimizations.
        * doc/tm.texi (Misc): Document TARGET_MIN_DIVISIONS_FOR_RECIP_MUL.

gcc/testsuite:
2006-01-11  Paolo Bonzini  <bonzini@gnu.org>

        PR tree-optimization/23109
        PR tree-optimization/23948
        PR tree-optimization/24123

        * gcc.dg/tree-ssa/recip-3.c, gcc.dg/tree-ssa/recip-4.c,
        gcc.dg/tree-ssa/recip-5.c, gcc.dg/tree-ssa/recip-6.c,
        gcc.dg/tree-ssa/recip-7.c, gcc.dg/tree-ssa/pr23109.c,
        g++.dg/tree-ssa/pr23948.C: New testcases.
        * gcc.dg/tree-ssa/recip-2.c, gcc.dg/tree-ssa/pr23234.c: Provide
        three divisions in order to do the optimization.


Added:
    branches/gcc-4_1-branch/gcc/testsuite/g++.dg/tree-ssa/pr23948.C
      - copied unchanged from r109578,
trunk/gcc/testsuite/g++.dg/tree-ssa/pr23948.C
    branches/gcc-4_1-branch/gcc/testsuite/gcc.dg/tree-ssa/pr23109.c
      - copied unchanged from r109578,
trunk/gcc/testsuite/gcc.dg/tree-ssa/pr23109.c
    branches/gcc-4_1-branch/gcc/testsuite/gcc.dg/tree-ssa/recip-3.c
      - copied unchanged from r109578,
trunk/gcc/testsuite/gcc.dg/tree-ssa/recip-3.c
    branches/gcc-4_1-branch/gcc/testsuite/gcc.dg/tree-ssa/recip-4.c
      - copied unchanged from r109578,
trunk/gcc/testsuite/gcc.dg/tree-ssa/recip-4.c
    branches/gcc-4_1-branch/gcc/testsuite/gcc.dg/tree-ssa/recip-5.c
      - copied unchanged from r109578,
trunk/gcc/testsuite/gcc.dg/tree-ssa/recip-5.c
    branches/gcc-4_1-branch/gcc/testsuite/gcc.dg/tree-ssa/recip-6.c
      - copied unchanged from r109578,
trunk/gcc/testsuite/gcc.dg/tree-ssa/recip-6.c
    branches/gcc-4_1-branch/gcc/testsuite/gcc.dg/tree-ssa/recip-7.c
      - copied unchanged from r109578,
trunk/gcc/testsuite/gcc.dg/tree-ssa/recip-7.c
Modified:
    branches/gcc-4_1-branch/gcc/ChangeLog
    branches/gcc-4_1-branch/gcc/Makefile.in
    branches/gcc-4_1-branch/gcc/doc/tm.texi
    branches/gcc-4_1-branch/gcc/passes.c
    branches/gcc-4_1-branch/gcc/target-def.h
    branches/gcc-4_1-branch/gcc/target.h
    branches/gcc-4_1-branch/gcc/targhooks.c
    branches/gcc-4_1-branch/gcc/targhooks.h
    branches/gcc-4_1-branch/gcc/testsuite/ChangeLog
    branches/gcc-4_1-branch/gcc/testsuite/gcc.dg/tree-ssa/pr23234.c
    branches/gcc-4_1-branch/gcc/testsuite/gcc.dg/tree-ssa/recip-2.c
    branches/gcc-4_1-branch/gcc/tree-cfg.c
    branches/gcc-4_1-branch/gcc/tree-flow.h
    branches/gcc-4_1-branch/gcc/tree-ssa-math-opts.c


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23109



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]