The following java code should print PASS but instead it prints FAIL at -O1 and above: class t { public static void test() { int i =0; int j = 1; int k = j/i;
} public static void main(String a1[]) { try { test(); }catch (ArithmeticException e) { System.out.println("Pass"); return; } System.out.println("Fail"); } } -- Summary: [4.0/4.1 Regression] misscompiling of the following java code Product: gcc Version: 4.0.0 Status: UNCONFIRMED Keywords: wrong-code Severity: normal Priority: P2 Component: middle-end AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: pinskia at gcc dot gnu dot org CC: gcc-bugs at gcc dot gnu dot org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21847