This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

c/4596: GCC 3.0.1 optimization causes segmentation violation in executable



>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:


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]