This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Patch to set_mem_attributes
- To: gcc-patches at gcc dot gnu dot org
- Subject: Re: Patch to set_mem_attributes
- From: Richard Henderson <rth at cygnus dot com>
- Date: Tue, 6 Jun 2000 14:00:27 -0700
> ... it broke all the libstdc++ tests and some
> C testcases that rth will check in soon.
The second of these by rights should have failed, since the
unchanging bit was in fact set on the mem. However, loop
wasn't doing a good enough job to actually break the test.
r~
struct F { int i; };
void f1(struct F *x, struct F *y)
{
int timeout = 0;
for (; ((const struct F*)x)->i < y->i ; x->i++)
if (++timeout > 5)
abort ();
}
main()
{
struct F x, y;
x.i = 0;
y.i = 1;
f1 (&x, &y);
exit (0);
}
struct F { int x; int y; };
int main()
{
int timeout = 0;
int x = 0;
while (1)
{
const struct F i = { x++, };
if (i.x > 0)
break;
if (++timeout > 5)
goto die;
}
return 0;
die:
abort ();
}