Thread View: gnu.gcc.bug
1 messages
1 total messages
Started by Bob Smith
Sun, 27 Sep 1992 02:21
cc1 dies with signal 11
Author: Bob Smith
Date: Sun, 27 Sep 1992 02:21
Date: Sun, 27 Sep 1992 02:21
55 lines
1599 bytes
1599 bytes
Hello,
I ran into a problem building xview3 with gcc-1.41 that I've finally
isolated to the following condition.
When using -fpcc-struct-return, and compiling a piece of code that calls
a function via a pointer that returns a structure, cc1 dies with a signal
11 (SEGV).
Here's a sample piece of code:
----- cut here -----
#include <stdio.h>
struct buffer {
int a;
int b;
} _buffer;
struct buffer set_buf();
main()
{
foo(set_buf);
}
foo(f)
struct buffer (*f)();
{
struct buffer d;
d = f(); /* <- cc1 dies with a SEGV here */
printf("%d %d\n", d.a, d.b);
}
struct buffer
set_buf()
{
struct buffer d;
d.a = 1;
d.b = 2;
return d;
}
----- cut here -----
Not using -fpcc-struct-return in this example will let it compile
normally. But if you know of another work-around, that'd be great...
Thanks, and have a good day! AND THANKS for such a nice compiler!
--
\ Bob Smith \ mx: bob@snuffy.dracut.ma.us
\ 1215 Pawtucket Blvd. #4 \ uucp: ...{ulowell|wang|wybbs}!snuffy!bob
\ Lowell, MA. 01854 \ office && voice mail: +1 508 670-6712
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads