[tree-ssa] Fix gimplification of function calls
James Morrison
ja2morri@csclub.uwaterloo.ca
Thu Apr 8 03:12:00 GMT 2004
Diego Novillo <dnovillo@redhat.com> writes:
> +void
> +boz (void)
> +{
> +}
> +
> +void
> +baz (void)
> +{
> + if (*F != boz)
> + abort ();
> +}
> +
> +fnptr B[2] = { baz, boz };
> +
> main ()
> {
> int b, c;
>
> - /* The gimplifier was emitting A++ after the call. */
> + /* The gimplifier was emitting A++ after the call to foo. */
> A = 5;
> foo (A++);
>
> @@ -31,6 +51,12 @@ main ()
> b = 4;
> c = 2;
> bar (b++, ++c);
> +
> + /* This call via function pointer *F should go to baz, but F should
> + be incremented before the actual call (i.e., right before the
> + call F should be pointing to boz). */
> + F = &B[0];
> + (*F++) ();
Should you put an abort in boz? That way you can ensure that boz is not
called incorrectly.
Jim
More information about the Gcc-patches
mailing list