This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
c/4596: GCC 3.0.1 optimization causes segmentation violation in executable
- To: gcc-gnats at gcc dot gnu dot org
- Subject: c/4596: GCC 3.0.1 optimization causes segmentation violation in executable
- From: Matt dot Rhodes at synergex dot com
- Date: 17 Oct 2001 20:46:41 -0000
- Reply-To: Matt dot Rhodes at synergex dot com
>Number: 4596
>Category: c
>Synopsis: GCC 3.0.1 optimization causes segmentation violation in executable
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: unassigned
>State: open
>Class: wrong-code
>Submitter-Id: net
>Arrival-Date: Wed Oct 17 13:56:00 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator: Matt Rhodes
>Release: gcc version 3.0.1
>Organization:
>Environment:
Red Hat Linux 7.1 running on a Pentium 120.
>Description:
When the lcmdln.c module is compiled with -O3 optimization, the executable (dblibr) fails with a segmentation violation when it is run. However, when lcmdln.c is compiled with
-O3 in addition to -fschedule-insns explicitly specified, the excutable runs without the segmentation violation. Also, it executes without error if lcmdln.c is only compiled with -O1 optimization.
>How-To-Repeat:
$ gcc -O3 -finline-functions -funroll-loops
-fomit-frame-pointer -fexpensive-optimizations
-fschedule-insns2 -fstrength-reduce -fno-strict-aliasing
-trigraphs -march=pentium -fPIC -o lcmdln.o -c lcmdln.c
$ gcc -o dblibr calloc.o lcreat.o lmain.o lmisc.o lcmdln.o lerrint.o nordisam.a duisam.a dutil.a stblib.a -lbsd -lm
$ dblibr -c bldut.olb bldut1.dbo
>Fix:
Add -fschedule-insns to compiler options when building lcmdln.c module OR change -O3 compiler option to -O1.
>Release-Note:
>Audit-Trail:
>Unformatted: