Unspecified behaviour in java/gjavah.c
Andrew Haley
aph@redhat.com
Mon Nov 25 06:16:00 GMT 2002
Diego Novillo writes:
> After the latest merge from basic-improvements to tree-ssa, I
> started getting failures building libjava:
>
>
> Below is a minimal test case that exhibits the same problem:
>
> -----------------------------------------------------------------------------
> struct JCF {
> char *read_ptr;
> } *jcf;
>
> foo()
> {
> jcf->read_ptr += (jcf->read_ptr += 4, 5);
> }
> -----------------------------------------------------------------------------
Ah. Nasty.
This is such a common problem when programming in C that I wonder if
we could include code in gcc to detect it.
When we gimplify, could we easily detect the same lvalue being updated
more than once between sequence points?
> * java/jcf-reader.c: Don't expand JCF_readu4 inside the
> expansion of JCF_SKIP.
OK.
Thanks for finding this.
Andrew.
More information about the Java
mailing list