This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
gcc.c-torture/execute/980223.c aborts with -O -p on alpha-osf4
- To: egcs-bugs at egcs dot cygnus dot com
- Subject: gcc.c-torture/execute/980223.c aborts with -O -p on alpha-osf4
- From: "Kaveh R. Ghazi" <ghazi at caip dot rutgers dot edu>
- Date: Wed, 29 Sep 1999 10:04:15 -0400 (EDT)
- Cc: rth at cygnus dot com
When I compile gcc.c-torture/execute/980223.c with -O -p
(really any opt level) on alphaev5-dec-osf4.0b the resulting
executable gets an abort.
> %gcc -v
> Reading specs from /var/tmp/gcc-testing/build/gcc/specs
> gcc version 2.96 19990928 (experimental)
> %gcc -g -O -p 980223.c
> %./a.out
> IOT trap (core dumped)
This does not occur if I use -pg instead of -p.
--Kaveh
Here's the gcc -E output from 980223.c:
------------------------------------------------------------------------
# 1 "980223.c"
typedef struct { long addr; long type; } object;
object bar (object blah)
{
abort();
}
object foo (object x, object y)
{
object z = *(object*)(x.addr);
if (z.type & 64)
{
y = *(object*)(z.addr+sizeof(object));
z = *(object*)(z.addr);
if (z.type & 64)
y = bar(y);
}
return y;
}
int nil;
object cons1[2] = { {(long) &nil, 0}, {(long) &nil, 0} };
object cons2[2] = { {(long) &cons1, 64}, {(long) &nil, 0} };
main()
{
object x = {(long) &cons2, 64};
object y = {(long) &nil, 0};
object three = foo(x,y);
return 0;
}