Article View: gnu.gcc.bug
Article #1227cc1 dies with signal 11
From: 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
Technical Details
Message-ID:
<9209282223.AA03345@snuffy.dracut.ma.us>Path:
arc1-ca.pugleaf.net!sparky!uunet!convex!darwin.sura.net!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!snuffy.dracut.ma.US!bobShow Full Headers
Complete Article Headers
Newsgroups: gnu.gcc.bug Path: arc1-ca.pugleaf.net!sparky!uunet!convex!darwin.sura.net!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!snuffy.dracut.ma.US!bob From: bob@snuffy.dracut.ma.US (Bob Smith) Subject: cc1 dies with signal 11 Message-ID: <9209282223.AA03345@snuffy.dracut.ma.us> Sender: gnulists@ai.mit.edu Organization: GNUs Not Usenet Distribution: gnu Date: Mon, 28 Sep 1992 22:23:52 GMT Approved: bug-gcc@prep.ai.mit.edu Lines: 59