This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: java/3096: GCJ does not increment
- To: aneesha at hpl dot hp dot com
- Subject: Re: java/3096: GCJ does not increment
- From: Alexandre Petit-Bianco <apbianco at cygnus dot com>
- Date: Wed, 18 Jul 2001 17:26:14 -0700 (PDT)
- Cc: gcc-gnats at gcc dot gnu dot org, gcc-bugs at gcc dot gnu dot org
- References: <20010608234908.28055.qmail@sourceware.cygnus.com>
- Reply-To: apbianco at cygnus dot com
aneesha@hpl.hp.com writes:
> GCJ does not increment the value of an entry in an array when
> the increment operator "++" is used in front. It, however,
> works when the operator is appended at the end.
The bug manifests itself only when compiling to native, regardless of
-f{no-}bounds-check. The index has to be a non numeric value.
When I put a breakpoint in expand_expr, I see that in the case of `++a[i]'
`(reg:SI 72)' is being returned. When `a[i]++' is presented, then
(queued:SI (mem:SI (reg:SI 70) 0)
(nil)
(nil)
(parallel[
(set (mem:SI (reg:SI 70) 0)
(plus:SI (mem:SI (reg:SI 70) 0)
(const_int 1 [0x1])))
(clobber (reg:CC 17 flags))
] )
(nil))
is returned. -S shows that no code is generated for `++a[i].'
./A
class T
{
public static void main(String [] args) {
int a[] = new int[1];
int i = 0;
++a[i];
System.out.println (a[i]);
}
}