This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/30911] VRP fails to eliminate range checks in Ada code
- From: "rguenth at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 23 Feb 2007 12:41:47 -0000
- Subject: [Bug tree-optimization/30911] VRP fails to eliminate range checks in Ada code
- References: <bug-30911-13647@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #19 from rguenth at gcc dot gnu dot org 2007-02-23 12:41 -------
Yeah, the fold-const.c chunk misses
+ /* We can compare x OP cst based on the value range of the type of
+ x. */
+ if (TREE_CODE (arg1) == INTEGER_CST
+ && TREE_CODE (arg0) != INTEGER_CST
+ && !POINTER_TYPE_P (TREE_TYPE (arg0))
^^^^ this line
+ && TYPE_MIN_VALUE (TREE_TYPE (arg0))
I don't think I'm folding pointer types, if arg1 is an integer constant
arg0 is of integer type as well.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30911