This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/23518] some gcc optimizations do not take overflow into account with -fwrapv
- From: "pinskia at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 22 Aug 2005 19:52:42 -0000
- Subject: [Bug middle-end/23518] some gcc optimizations do not take overflow into account with -fwrapv
- References: <20050822193430.23518.pterjan@gmail.com>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From pinskia at gcc dot gnu dot org 2005-08-22 19:52 -------
Here is a java program (since -fwrapv is turned on by default for java front-end unlike the C front-end
since it is undefined in C and defined in java):
class t
{
public static void main(String as[])
{
int a;
a = Integer.MAX_VALUE;
if ((a < 0) || (a + 1 < 0)) {
System.out.println("Hello");
}
}
}
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23518