This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Unspecified behaviour in java/gjavah.c
- From: Andrew Haley <aph at redhat dot com>
- To: Diego Novillo <dnovillo at redhat dot com>
- Cc: gcc at gcc dot gnu dot org, java at gcc dot gnu dot org
- Date: Mon, 25 Nov 2002 14:08:37 +0000 (GMT)
- Subject: Unspecified behaviour in java/gjavah.c
- References: <20021125003031.GD30408@tornado.toronto.redhat.com>
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.