🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.gcc.bug
Article #1221

cc1 dies with signal 11

#1221
From: Bob Smith
Date: Sun, 27 Sep 1992 02:21
55 lines
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
Technical Details
Message-ID: <9209270221.AA22922@snuffy.dracut.ma.us>
Path: arc1-ca.pugleaf.net!sparky!uunet!usc!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!snuffy.dracut.ma.US!bob

Show Full Headers
Complete Article Headers
Newsgroups: gnu.gcc.bug
Path: arc1-ca.pugleaf.net!sparky!uunet!usc!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: <9209270221.AA22922@snuffy.dracut.ma.us>
Sender: gnulists@ai.mit.edu
Organization: GNUs Not Usenet
Distribution: gnu
Date: Sun, 27 Sep 1992 02:21:13 GMT
Approved: bug-gcc@prep.ai.mit.edu
Lines: 56