This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
c/1648: ice: i686-pc-linux-gnu with -march=i686 but not with -march=i586
- To: gcc-gnats at gcc dot gnu dot org
- Subject: c/1648: ice: i686-pc-linux-gnu with -march=i686 but not with -march=i586
- From: schmid at snake dot iap dot physik dot tu-darmstadt dot de
- Date: Sun, 14 Jan 2001 16:06:02 +0100
>Number: 1648
>Category: c
>Synopsis: ice: i686-pc-linux-gnu with -march=i686 but not with -march=i586
>Confidential: no
>Severity: serious
>Priority: high
>Responsible: unassigned
>State: open
>Class: ice-on-legal-code
>Submitter-Id: net
>Arrival-Date: Sun Jan 14 07:16:00 PST 2001
>Closed-Date:
>Last-Modified:
>Originator: Peter Schmid
>Release: 2.97 20010111 (experimental)
>Organization:
TU Darmstadt
>Environment:
System: Linux kiste 2.4.0-test12 #22 Sun Dec 17 17:24:36 CET 2000 i686 unknown
Architecture: i686
glibc 2.1.3
GNU assembler version 2.10.91 (i686-pc-linux-gnu) using BFD version 2.10.1.0.4
Suse 6.4
host: i686-pc-linux-gnu
build: i686-pc-linux-gnu
target: i686-pc-linux-gnu
configured with: ../gcc/configure --enable-shared --disable-nls
>Description:
The following file ts.c, a stripped-down version of the file kernel/sys.c
from the linux-2.4.0-test12 kernel sources, generates an "Internal
error: Segmentation fault" when compiled with "-O -march=i686" as
command line options. When the -march option is dropped or replaced
with -march=i586, the source file is compiled without a problem.
>How-To-Repeat:
Source code ts.c:
struct task_struct {
long nice;
struct task_struct *next_task, *prev_task;
};
union task_union {
struct task_struct task;
};
extern union task_union init_task_union;
#define init_task (init_task_union.task)
#define for_each_task(p) \
for (p = &init_task ; (p = p->next_task) != &init_task ; )
static int proc_sel(struct task_struct *p, int which, int who)
{
return 0;
}
#define for_each_task(p) \
for (p = &init_task ; (p = p->next_task) != &init_task ; )
long sys_setpriority(int which, int who, int niceval)
{
struct task_struct *p;
int error;
error = 10;
if (niceval < -20)
niceval = -20;
if (niceval > 19)
niceval = 19;
for_each_task(p) {
p->nice = niceval;
}
return error;
}
Preprocessor source ts.i:
# 1 "ts.c"
struct task_struct {
long nice;
struct task_struct *next_task, *prev_task;
};
union task_union {
struct task_struct task;
};
extern union task_union init_task_union;
# 20 "ts.c"
static int proc_sel(struct task_struct *p, int which, int who)
{
return 0;
}
long sys_setpriority(int which, int who, int niceval)
{
struct task_struct *p;
int error;
error = 10;
if (niceval < -20)
niceval = -20;
if (niceval > 19)
niceval = 19;
for (p = &(init_task_union.task) ; (p = p->next_task) != &(init_task_union.task) ; ) {
p->nice = niceval;
}
return error;
}
Compilation of the source code ts.c with varying command line options
gcc -Q -v -O -march=i686 -c ts.c -save-temps
Reading specs from /usr/local/lib/gcc-lib/i686-pc-linux-gnu/2.97/specs
Configured with: ../gcc/configure --enable-shared --disable-nls
gcc version 2.97 20010111 (experimental)
/usr/local/lib/gcc-lib/i686-pc-linux-gnu/2.97/cpp0 -lang-c -v -D__GNUC__=2 -D__GNUC_MINOR__=97 -D__GNUC_PATCHLEVEL__=0 -D__ELF__ -Dunix -Dlinux -D__ELF__ -D__unix__ -D__linux__ -D__unix -D__linux -Asystem=posix -D__OPTIMIZE__ -D__STDC_HOSTED__=1 -Acpu=i386 -Amachine=i386 -Di386 -D__i386 -D__i386__ -D__i686 -D__i686__ -D__pentiumpro -D__pentiumpro__ -D__tune_i686__ -D__tune_pentiumpro__ ts.c ts.i
GNU CPP version 2.97 20010111 (experimental) (cpplib) (i386 Linux/ELF)
#include "..." search starts here:
#include <...> search starts here:
/usr/local/include
/usr/local/lib/gcc-lib/i686-pc-linux-gnu/2.97/include
/usr/local/i686-pc-linux-gnu/include
/usr/include
End of search list.
/usr/local/lib/gcc-lib/i686-pc-linux-gnu/2.97/cc1 -fpreprocessed ts.i -dumpbase ts.c -march=i686 -O -version -o ts.s
GNU CPP version 2.97 20010111 (experimental) (cpplib) (i386 Linux/ELF)
GNU C version 2.97 20010111 (experimental) (i686-pc-linux-gnu)
compiled by GNU C version 2.97 20010111 (experimental).
options passed: -fpreprocessed -march=i686 -O
options enabled: -fdefer-pop -fthread-jumps -fpeephole -ffunction-cse
-finline -fkeep-static-consts -fpcc-struct-return -fsched-interblock
-fsched-spec -fbranch-count-reg -fnew-exceptions -fcommon -fgnu-linker
-fargument-alias -fident -fmath-errno -m80387 -mhard-float -mno-soft-float
-mieee-fp -mfp-ret-in-387 -march=i686
proc_sel sys_setpriority
ts.c: In function `sys_setpriority':
ts.c:46: Internal error: Segmentation fault.
Please submit a full bug report.
See <URL:http://www.gnu.org/software/gcc/bugs.html> for instructions.
gcc -Q -v -O -c ts.c -save-temps
Reading specs from /usr/local/lib/gcc-lib/i686-pc-linux-gnu/2.97/specs
Configured with: ../gcc/configure --enable-shared --disable-nls
gcc version 2.97 20010111 (experimental)
/usr/local/lib/gcc-lib/i686-pc-linux-gnu/2.97/cpp0 -lang-c -v -D__GNUC__=2 -D__GNUC_MINOR__=97 -D__GNUC_PATCHLEVEL__=0 -D__ELF__ -Dunix -Dlinux -D__ELF__ -D__unix__ -D__linux__ -D__unix -D__linux -Asystem=posix -D__OPTIMIZE__ -D__STDC_HOSTED__=1 -Acpu=i386 -Amachine=i386 -Di386 -D__i386 -D__i386__ -D__tune_i686__ -D__tune_pentiumpro__ ts.c ts.i
GNU CPP version 2.97 20010111 (experimental) (cpplib) (i386 Linux/ELF)
#include "..." search starts here:
#include <...> search starts here:
/usr/local/include
/usr/local/lib/gcc-lib/i686-pc-linux-gnu/2.97/include
/usr/local/i686-pc-linux-gnu/include
/usr/include
End of search list.
/usr/local/lib/gcc-lib/i686-pc-linux-gnu/2.97/cc1 -fpreprocessed ts.i -dumpbase ts.c -O -version -o ts.s
GNU CPP version 2.97 20010111 (experimental) (cpplib) (i386 Linux/ELF)
GNU C version 2.97 20010111 (experimental) (i686-pc-linux-gnu)
compiled by GNU C version 2.97 20010111 (experimental).
options passed: -fpreprocessed -O
options enabled: -fdefer-pop -fthread-jumps -fpeephole -ffunction-cse
-finline -fkeep-static-consts -fpcc-struct-return -fsched-interblock
-fsched-spec -fbranch-count-reg -fnew-exceptions -fcommon -fgnu-linker
-fargument-alias -fident -fmath-errno -m80387 -mhard-float -mno-soft-float
-mieee-fp -mfp-ret-in-387
proc_sel sys_setpriority
Execution times (seconds)
preprocessing : 0.00 ( 0%) usr 0.00 ( 0%) sys 0.00 ( 0%) wall
lexical analysis : 0.00 ( 0%) usr 0.00 ( 0%) sys 0.00 ( 0%) wall
parser : 0.00 ( 0%) usr 0.00 ( 0%) sys 0.01 ( 6%) wall
varconst : 0.00 ( 0%) usr 0.00 ( 0%) sys 0.00 ( 0%) wall
jump : 0.00 ( 0%) usr 0.00 ( 0%) sys 0.00 ( 0%) wall
CSE : 0.00 ( 0%) usr 0.00 ( 0%) sys 0.00 ( 0%) wall
loop analysis : 0.00 ( 0%) usr 0.00 ( 0%) sys 0.00 ( 0%) wall
CSE 2 : 0.00 ( 0%) usr 0.00 ( 0%) sys 0.00 ( 0%) wall
flow analysis : 0.01 ( 7%) usr 0.00 ( 0%) sys 0.01 ( 6%) wall
combiner : 0.00 ( 0%) usr 0.00 ( 0%) sys 0.00 ( 0%) wall
if-conversion : 0.00 ( 0%) usr 0.00 ( 0%) sys 0.00 ( 0%) wall
local alloc : 0.00 ( 0%) usr 0.00 ( 0%) sys 0.00 ( 0%) wall
global alloc : 0.00 ( 0%) usr 0.00 ( 0%) sys 0.00 ( 0%) wall
reload CSE regs : 0.00 ( 0%) usr 0.00 ( 0%) sys 0.00 ( 0%) wall
flow 2 : 0.00 ( 0%) usr 0.00 ( 0%) sys 0.00 ( 0%) wall
if-conversion 2 : 0.00 ( 0%) usr 0.00 ( 0%) sys 0.00 ( 0%) wall
shorten branches : 0.00 ( 0%) usr 0.00 ( 0%) sys 0.00 ( 0%) wall
reg stack : 0.00 ( 0%) usr 0.00 ( 0%) sys 0.00 ( 0%) wall
final : 0.00 ( 0%) usr 0.00 ( 0%) sys 0.00 ( 0%) wall
symout : 0.00 ( 0%) usr 0.00 ( 0%) sys 0.00 ( 0%) wall
rest of compilation : 0.00 ( 0%) usr 0.00 ( 0%) sys 0.00 ( 0%) wall
TOTAL : 0.15 0.00 0.16
/usr/local/lib/gcc-lib/i686-pc-linux-gnu/2.97/../../../../i686-pc-linux-gnu/bin/as -V -Qy -o ts.o ts.s
GNU assembler version 2.10.91 (i686-pc-linux-gnu) using BFD version 2.10.1.0.4
gcc -Q -v -O -march=i586 -c ts.c -save-temps
Reading specs from /usr/local/lib/gcc-lib/i686-pc-linux-gnu/2.97/specs
Configured with: ../gcc/configure --enable-shared --disable-nls
gcc version 2.97 20010111 (experimental)
/usr/local/lib/gcc-lib/i686-pc-linux-gnu/2.97/cpp0 -lang-c -v -D__GNUC__=2 -D__GNUC_MINOR__=97 -D__GNUC_PATCHLEVEL__=0 -D__ELF__ -Dunix -Dlinux -D__ELF__ -D__unix__ -D__linux__ -D__unix -D__linux -Asystem=posix -D__OPTIMIZE__ -D__STDC_HOSTED__=1 -Acpu=i386 -Amachine=i386 -Di386 -D__i386 -D__i386__ -D__i586 -D__i586__ -D__pentium -D__pentium__ -D__tune_i586__ -D__tune_pentium__ ts.c ts.i
GNU CPP version 2.97 20010111 (experimental) (cpplib) (i386 Linux/ELF)
#include "..." search starts here:
#include <...> search starts here:
/usr/local/include
/usr/local/lib/gcc-lib/i686-pc-linux-gnu/2.97/include
/usr/local/i686-pc-linux-gnu/include
/usr/include
End of search list.
/usr/local/lib/gcc-lib/i686-pc-linux-gnu/2.97/cc1 -fpreprocessed ts.i -dumpbase ts.c -march=i586 -O -version -o ts.s
GNU CPP version 2.97 20010111 (experimental) (cpplib) (i386 Linux/ELF)
GNU C version 2.97 20010111 (experimental) (i686-pc-linux-gnu)
compiled by GNU C version 2.97 20010111 (experimental).
options passed: -fpreprocessed -march=i586 -O
options enabled: -fdefer-pop -fthread-jumps -fpeephole -ffunction-cse
-finline -fkeep-static-consts -fpcc-struct-return -fsched-interblock
-fsched-spec -fbranch-count-reg -fnew-exceptions -fcommon -fgnu-linker
-fargument-alias -fident -fmath-errno -m80387 -mhard-float -mno-soft-float
-mieee-fp -mfp-ret-in-387 -march=i586
proc_sel sys_setpriority
Execution times (seconds)
preprocessing : 0.00 ( 0%) usr 0.00 ( 0%) sys 0.00 ( 0%) wall
lexical analysis : 0.00 ( 0%) usr 0.00 ( 0%) sys 0.00 ( 0%) wall
parser : 0.00 ( 0%) usr 0.00 ( 0%) sys 0.00 ( 0%) wall
varconst : 0.00 ( 0%) usr 0.00 ( 0%) sys 0.00 ( 0%) wall
jump : 0.00 ( 0%) usr 0.00 ( 0%) sys 0.00 ( 0%) wall
CSE : 0.00 ( 0%) usr 0.00 ( 0%) sys 0.00 ( 0%) wall
loop analysis : 0.00 ( 0%) usr 0.00 ( 0%) sys 0.00 ( 0%) wall
CSE 2 : 0.00 ( 0%) usr 0.00 ( 0%) sys 0.00 ( 0%) wall
flow analysis : 0.00 ( 0%) usr 0.00 ( 0%) sys 0.00 ( 0%) wall
combiner : 0.00 ( 0%) usr 0.00 ( 0%) sys 0.00 ( 0%) wall
if-conversion : 0.00 ( 0%) usr 0.00 ( 0%) sys 0.00 ( 0%) wall
local alloc : 0.01 ( 6%) usr 0.00 ( 0%) sys 0.01 ( 5%) wall
global alloc : 0.01 ( 6%) usr 0.00 ( 0%) sys 0.01 ( 5%) wall
reload CSE regs : 0.00 ( 0%) usr 0.00 ( 0%) sys 0.00 ( 0%) wall
flow 2 : 0.00 ( 0%) usr 0.00 ( 0%) sys 0.00 ( 0%) wall
if-conversion 2 : 0.00 ( 0%) usr 0.00 ( 0%) sys 0.00 ( 0%) wall
shorten branches : 0.00 ( 0%) usr 0.00 ( 0%) sys 0.00 ( 0%) wall
reg stack : 0.00 ( 0%) usr 0.00 ( 0%) sys 0.00 ( 0%) wall
final : 0.00 ( 0%) usr 0.00 ( 0%) sys 0.00 ( 0%) wall
symout : 0.00 ( 0%) usr 0.00 ( 0%) sys 0.00 ( 0%) wall
rest of compilation : 0.00 ( 0%) usr 0.00 ( 0%) sys 0.00 ( 0%) wall
TOTAL : 0.16 0.01 0.21
/usr/local/lib/gcc-lib/i686-pc-linux-gnu/2.97/../../../../i686-pc-linux-gnu/bin/as -V -Qy -o ts.o ts.s
GNU assembler version 2.10.91 (i686-pc-linux-gnu) using BFD version 2.10.1.0.4
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted: