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]
Other format: [Raw text]

c/7733: Segmentation Fault with -ftest-coverage


>Number:         7733
>Category:       c
>Synopsis:       Segmentation Fault with -ftest-coverage
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Aug 27 05:16:00 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator:     sdouglass@arm.com
>Release:        gcc 3.1
>Organization:
>Environment:
SunOS 5.6

../src-solaris_2_6-sparc/configure --prefix=/arm/sdt/tools/GNU/gcc/3_1 --exec-prefix=/arm/sdt/tools/GNU/gcc/3_1/solaris_2_6-sparc --program-suffix=-3_1 -v --with-dwarf2 --enable-version-specific-runtime-libs --with-gnu-as --with-as=/arm/sdt/tools/GNU/binutils/2_12/solaris_2_6-sparc/bin/as-2_12 --with-gnu-ld --with-ld=/arm/sdt/tools/GNU/binutils/2_12/solaris_2_6-sparc/bin/ld-2_12
>Description:
Compiling this with '-ftest-coverage -c' on SunOS/Solaris 5.6 causes:

longjmp.c:5: internal error: Segmentation Fault

#include <setjmp.h>

static jmp_buf buf;

void f(int i) { longjmp(buf, i); }
>How-To-Repeat:
gcc -ftest-coverage -c longjmp.c

Here's the .i file (after preprocessing):
# 1 "longjmp.c"
# 1 "<built-in>"
# 1 "<command line>"
# 1 "longjmp.c"
# 1 "/usr/include/setjmp.h" 1 3 4
# 17 "/usr/include/setjmp.h" 3 4
#pragma ident "@(#)setjmp.h	1.26	96/12/18 SMI" 

# 1 "/usr/include/sys/feature_tests.h" 1 3 4
# 11 "/usr/include/sys/feature_tests.h" 3 4
#pragma ident "@(#)feature_tests.h	1.13	97/06/26 SMI"
# 20 "/usr/include/setjmp.h" 2 3 4
# 53 "/usr/include/setjmp.h" 3 4
typedef int jmp_buf[12];





extern int setjmp(jmp_buf);
#pragma unknown_control_flow(setjmp)
extern int _setjmp(jmp_buf);
#pragma unknown_control_flow(_setjmp)
extern void longjmp(jmp_buf, int);
extern void _longjmp(jmp_buf, int);





typedef int sigjmp_buf[19];

extern int sigsetjmp(sigjmp_buf, int);
#pragma unknown_control_flow(sigsetjmp)
extern void siglongjmp(sigjmp_buf, int);
# 2 "longjmp.c" 2

static jmp_buf buf;

void f(int i) { longjmp(buf, i); }
>Fix:

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