From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22745 invoked by alias); 23 Aug 2005 19:58:32 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 22615 invoked by uid 48); 23 Aug 2005 19:58:28 -0000 Date: Tue, 23 Aug 2005 20:48:00 -0000 Message-ID: <20050823195828.22614.qmail@sourceware.org> From: "tromey at gcc dot gnu dot org" To: gcc-bugs@gcc.gnu.org In-Reply-To: <20050801155040.23182.hannes@helma.at> References: <20050801155040.23182.hannes@helma.at> Reply-To: gcc-bugzilla@gcc.gnu.org Subject: [Bug libgcj/23182] instanceof sometimes fails if compiled with -findirect-dispatch X-Bugzilla-Reason: CC X-SW-Source: 2005-08/txt/msg02730.txt.bz2 List-Id: ------- Additional Comments From tromey at gcc dot gnu dot org 2005-08-23 19:58 ------- Reduced test case. Compile to .class, then compile with -findirect-dispatch. Interpreting works fine. public class pr23182 { static class Wrapper { Object w; Object get() { return w; } Wrapper(Object x) { w = x; } } static Wrapper instance = new Wrapper(null); public static String toString(Object val) { for (;;) { if (val == null) return "null"; if (val instanceof Wrapper) { val = ((Wrapper) val).get(); if (val != instance && val instanceof Wrapper) throw new RuntimeException("bob"); continue; } return val.toString(); } } public static void main(String[] args) { System.out.println(toString(null)); System.out.println(toString("maude")); System.out.println(toString(new Wrapper("liver"))); } } -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23182