Thread View: gnu.gcc.bug
1 messages
1 total messages
Started by Bob Smith
Mon, 28 Sep 1992 22:23
cc1 dies with signal 11
Author: Bob Smith
Date: Mon, 28 Sep 1992 22:23
Date: Mon, 28 Sep 1992 22:23
58 lines
1765 bytes
1765 bytes
Hello,
(This is a resubmission because I failed to tell you what machine it
was running on in the first attempt...)
I ran into a problem building xview3 with gcc-1.41 on a Sun 3/60 running
SunOS 3.5 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 an example 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