Rudi Streif wrote:
> 
> Raj,
> 
> Basically it says that your code doesn't make sense because the result of
> sum is invariant to the loop. I can't tell you why it fails under Blackdown
> JDK1.2 for Linux (it does on my machine too) but works under Sun JDK1.2 for
> Windows.

The failure is in the Sun JIT -- having some trouble performing an
optimization for loop invariance. It doesn't fail with tya or with no
JIT.

Nathan


> If you changed your code to something like this
>      sum + = (a*a*a*b) + (a*a*a*b)+ (a*a*a*b)+ (a*a*a*b);
> it works because then the loop makes sense.
> 
> Rudy
> 
> -----Original Message-----
> From: Rajkishore Barik <[EMAIL PROTECTED]>
> To: [EMAIL PROTECTED] <[EMAIL PROTECTED]>
> Date: Thursday, July 22, 1999 11:47 AM
> Subject: Help needed
> 
> >Hi,
> > Here is a piece of code, i am trying to execute in
> > JDK1.2pre-release. But it does not seem to be running.
> > The code :
> >*******************************************************************
> >class test {
> >    public static void main(String Str[]) {
> > int sum=0;
> > int a=7;
> > int b=7;
> >
> > for (int i=0;i<10;i++)
> >     sum=(a*a*a*b) + (a*a*a*b)+ (a*a*a*b)+ (a*a*a*b);
> >    }
> >}
> >*******************************************************************
> > ERROR:
> >java: ../../../../src/share/java/bcopt/Loop.C:374: boolean
> Loop::is_node_invariant(class Node *) const: Assertion
> `_invariant_nodes_list[node->GetBlock()->GetBlockNumber()].contains(node) ==
> ret_val' failed.
> >SIGABRT   6*   abort (generated by abort(3) routine)
> > stackpointer=0xbffff47c
> >
> >Full thread dump Classic VM (Linux_JDK_1.2_pre-release-v2, native threads):
> >    "Finalizer" (TID:0x404bf320, sys_thread_t:0x80cc558, state:CW, native
> ID:0xc04) prio=8
> > at java.lang.Object.wait(Native Method)
> > at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:112)
> > at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:127)
> > at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:174)
> >    "Reference Handler" (TID:0x404bf3b0, sys_thread_t:0x80c7da0, state:CW,
> native ID:0x803) prio=10
> > at java.lang.Object.wait(Native Method)
> > at java.lang.Object.wait(Object.java:424)
> > at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:114)
> >    "SIGQUIT handler" (TID:0x404bf3e0, sys_thread_t:0x80c0838, state:R,
> native ID:0x402) prio=5
> >    "main" (TID:0x404bf1e0, sys_thread_t:0x804bf40, state:R, native
> ID:0x400) prio=5
> >Monitor Cache Dump:
> >    <unknown key> (0x404c6b49): owner "main" (0x804bf40) 1 entry
> >    java.lang.ref.ReferenceQueue$Lock@404BF338/404F5028: <unowned>
> > Waiting to be notified:
> >     "Finalizer" (0x80cc558)
> >    java.lang.ref.Reference$Lock@404BF3C0/404F4B20: <unowned>
> > Waiting to be notified:
> >     "Reference Handler" (0x80c7da0)
> >Registered Monitor Dump:
> >    PCMap lock: <unowned>
> >    utf8 hash table: <unowned>
> >    JNI pinning lock: <unowned>
> >    JNI global reference lock: <unowned>
> >    BinClass lock: <unowned>
> >    Class linking lock: <unowned>
> >    System class loader lock: <unowned>
> >    Code rewrite lock: <unowned>
> >    Heap lock: <unowned>
> >    Monitor cache lock: owner "main" (0x804bf40) 1 entry
> >    Thread queue lock: owner "main" (0x804bf40) 1 entry
> >    Monitor registry: owner "main" (0x804bf40) 1 entry
> >*******************************************************************
> >
> >Can somebody help me out...
> >Thanx  a lot..
> >regards,
> >Raj
> >
> >
> >
> >
> >
> >----------------------------------------------------------------------
> >To UNSUBSCRIBE, email to [EMAIL PROTECTED]
> >with a subject of "unsubscribe". Trouble? Contact
> [EMAIL PROTECTED]
> >
> >
> 
> ----------------------------------------------------------------------
> To UNSUBSCRIBE, email to [EMAIL PROTECTED]
> with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]


----------------------------------------------------------------------
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to