Article View: gnu.gcc.bug
Article #1612Re: gcc-2.3.3 - bug on SUN for (char *) within a struct
From: Simon Leinen
Date: Fri, 08 Jan 1993 12:23
Date: Fri, 08 Jan 1993 12:23
22 lines
1567 bytes
1567 bytes
In article <9301071447.AA12676@uk0x06.ggr.co.uk> gml4410@ggr.co.UK
(Lack Mr G M) writes:
I wish to report a bug in gcc-2.3.3 on a SUN.
I have built gcc-2.3.3 on a Sun Sparcstation at SunOS4.1.1. The
configure option was "sparc-sun-sunos4.1" and I used CFLAGS=-O during
the makeing, which completed with no errors.
The following simple program dies with a segmentation fault. It
runs correctly with gcc-2.3.3 on an SG Indigo, with Suns own cc compiler
(and with other c compilers on other platforms).
If there's a bug, then it's that the GCC-compiled binary on the SGI
doesn't get the segmentation fault. Your strcpy()'s are overwriting
string constants, which are usually allocated in read-only space by
GCC (as you can see by the ".text" directives preceding the ".ascii"
directives for your string constants). This is a deliberate design
decision which improves VM performance. If you want to turn this
behaviour off, you can pass the "-fwritable-strings" option to GCC.
--
Simon.
Technical Details
Message-ID:
<SIMON.93Jan8132348@liasg2.epfl.ch>Path:
arc1-ca.pugleaf.net!sparky!uunet!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!lia.di.epfl.CH!simonReferences:
<9301071447.AA12676@uk0x06.ggr.co.uk>Show Full Headers
Complete Article Headers
Newsgroups: gnu.gcc.bug Path: arc1-ca.pugleaf.net!sparky!uunet!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!lia.di.epfl.CH!simon From: simon@lia.di.epfl.CH (Simon Leinen) Subject: Re: gcc-2.3.3 - bug on SUN for (char *) within a struct Message-ID: <SIMON.93Jan8132348@liasg2.epfl.ch> Sender: gnulists@ai.mit.edu Organization: Ecole Polytechnique Federale de Lausanne References: <9301071447.AA12676@uk0x06.ggr.co.uk> Distribution: gnu Date: Fri, 8 Jan 1993 12:23:48 GMT Approved: bug-gcc@prep.ai.mit.edu Lines: 23