Consider int foo (int a) { if (a == 0) if (a == 0) return 1; return 0; } Note that the second "if" statement is redundant.
Created attachment 8462 [details] Patch
Confirmed.
Patch posted: http://gcc.gnu.org/ml/gcc-patches/2005-04/msg01577.html
Just checked in a patch.
Subject: Bug 20657 CVSROOT: /cvs/gcc Module name: gcc Changes by: kazu@gcc.gnu.org 2005-04-14 13:34:59 Modified files: gcc : ChangeLog tree-vrp.c gcc/testsuite : ChangeLog Added files: gcc/testsuite/gcc.dg/tree-ssa: pr20657.c Log message: gcc/ PR tree-optimization/20657 * tree-vrp.c (extract_range_from_expr): Notice INTEGER_CST to create an appropriate range from it. testsuite/ PR tree-optimization/20657 * gcc.dg/tree-ssa/pr20657.c: New. Patches: http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&r1=2.8286&r2=2.8287 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/tree-vrp.c.diff?cvsroot=gcc&r1=2.6&r2=2.7 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&r1=1.5346&r2=1.5347 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gcc.dg/tree-ssa/pr20657.c.diff?cvsroot=gcc&r1=NONE&r2=1.1