Summary: | [4.5 Regression] ICE in is_overflow_infinity (tree-vrp.c:184) with gfortran -fcheck=bounds -O2 | ||
---|---|---|---|
Product: | gcc | Reporter: | Mat Cross <mathewc> |
Component: | middle-end | Assignee: | Richard Biener <rguenth> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | burnus, gcc-bugs |
Priority: | P3 | Keywords: | ice-on-valid-code |
Version: | 4.5.0 | ||
Target Milestone: | 4.5.1 | ||
Host: | Target: | i386-unknown-linux-gnu | |
Build: | Known to work: | 4.4.4 4.6.0 | |
Known to fail: | 4.5.0 | Last reconfirmed: | 2010-04-19 12:26:31 |
Description
Mat Cross
2010-04-19 10:11:20 UTC
Confirmed on trunk with '-O[23] -m32 -fcheck=bounds' (compiles with '-O[01s]'). Works for me with 4.5 revision 157991 and 4.4.2 (with '-fbounds-check' instead of '-fcheck=bounds'), hence at least a 4.6 regression. Confirm. It fails with 4.5 and 4.6 using the option -fbounds-check (== -fcheck-bounds), but only with -O2 and higher and for some reasons only with -m32 and not with -m64 on x86_64-unknown-linux-gnu. It works with GCC 4.1/4.2/4.3/4.4. Valgrind shows: ==2634== Invalid read of size 2 ==2634== at 0x9643CA: is_overflow_infinity (tree-vrp.c:184) ==2634== by 0x96447D: usable_range_p (tree-vrp.c:797) ==2634== by 0x96A3DD: compare_ranges (tree-vrp.c:3388) ==2634== by 0x96B083: vrp_evaluate_conditional_warnv_with_ops (tree-vrp.c:5669) ==2634== by 0x96B91F: vrp_evaluate_conditional (tree-vrp.c:5710) ==2634== by 0x9309DE: thread_across_edge (tree-ssa-threadedge.c:537) ==2634== by 0x9765ED: execute_vrp (tree-vrp.c:7214) ==2634== by 0x785B9A: execute_one_pass (passes.c:1569) ==2634== by 0x785E24: execute_pass_list (passes.c:1624) ==2634== by 0x785E36: execute_pass_list (passes.c:1625) ==2634== by 0x87AB34: tree_rest_of_compilation (tree-optimize.c:413) ==2634== by 0x9FCA60: cgraph_expand_function (cgraphunit.c:1548) ==2634== Address 0x0 is not stack'd, malloc'd or (recently) free'd ==2634== test.f90: In function 'f06fkfn': test.f90:1:0: internal compiler error: Segmentation fault Please submit a full bug report, Program received signal SIGSEGV, Segmentation fault. 0x0000000000bdb380 in needs_overflow_infinity (type=0x0) at /space/rguenther/src/svn/gcc-4_5-branch/gcc/tree-vrp.c:184 184 return INTEGRAL_TYPE_P (type) && !TYPE_OVERFLOW_WRAPS (type); (gdb) up #1 0x0000000000bdb434 in is_overflow_infinity (val=0x7ffff5adfe70) at /space/rguenther/src/svn/gcc-4_5-branch/gcc/tree-vrp.c:269 269 return (needs_overflow_infinity (TREE_TYPE (val)) (gdb) call debug_tree (val) <ssa_name 0x7ffff5adfe70 nothrow var <var_decl 0x7ffff7fbf0a0 i>def_stmt version 56 in-free-list> Confirmed. We free the SSA name in substitute_and_fold () but it is still used in symbolical ranges which we end up using by jump threading. If we do so we shouldn't DCE stmts in substitute_and_fold (). There's also a missed-optimization which if fixed fixes this PR as well. Subject: Bug 43796 Author: rguenth Date: Mon Apr 19 15:17:26 2010 New Revision: 158520 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=158520 Log: 2010-04-19 Richard Guenther <rguenther@suse.de> PR tree-optimization/43796 * tree-vrp.c (adjust_range_with_scev): Lookup init and step from SCEV in the lattice. (vrp_visit_phi_node): Dump change. * gfortran.dg/pr43796.f90: New testcase. Added: trunk/gcc/testsuite/gfortran.dg/pr43796.f90 Modified: trunk/gcc/ChangeLog trunk/gcc/testsuite/ChangeLog trunk/gcc/tree-vrp.c Subject: Bug 43796 Author: rguenth Date: Tue Apr 20 09:04:05 2010 New Revision: 158548 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=158548 Log: 2010-04-20 Richard Guenther <rguenther@suse.de> PR tree-optimization/43796 * tree-vrp.c (adjust_range_with_scev): Lookup init and step from SCEV in the lattice. (vrp_visit_phi_node): Dump change. * gfortran.dg/pr43796.f90: New testcase. Added: branches/gcc-4_5-branch/gcc/testsuite/gfortran.dg/pr43796.f90 Modified: branches/gcc-4_5-branch/gcc/ChangeLog branches/gcc-4_5-branch/gcc/testsuite/ChangeLog branches/gcc-4_5-branch/gcc/tree-vrp.c Fixed. |