NetBSD Problem Report #50384

From tsutsui@ceres.dti.ne.jp  Sat Oct 31 04:40:38 2015
Return-Path: <tsutsui@ceres.dti.ne.jp>
Received: from mail.netbsd.org (mail.netbsd.org [149.20.53.66])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(Client CN "mail.netbsd.org", Issuer "Postmaster NetBSD.org" (verified OK))
	by mollari.NetBSD.org (Postfix) with ESMTPS id 42B09A6555
	for <gnats-bugs@gnats.NetBSD.org>; Sat, 31 Oct 2015 04:40:38 +0000 (UTC)
Message-Id: <201510310440.t9V4eXXQ006420@mirage.localdomain>
Date: Sat, 31 Oct 2015 13:40:33 +0900 (JST)
From: Izumi Tsutsui <tsutsui@ceres.dti.ne.jp>
Reply-To: tsutsui@ceres.dti.ne.jp
To: gnats-bugs@NetBSD.org
Cc: tsutsui@ceres.dti.ne.jp
Subject: NetBSD/vax 7.0 gcc-4.8.4 gets ICE by SIGILL
X-Send-Pr-Version: 3.95

>Number:         50384
>Category:       port-vax
>Synopsis:       NetBSD/vax 7.0 gcc-4.8.4 gets ICE by SIGILL
>Confidential:   no
>Severity:       critical
>Priority:       medium
>Responsible:    port-vax-maintainer
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Oct 31 04:45:00 +0000 2015
>Closed-Date:    Sun Aug 18 05:06:18 +0000 2019
>Last-Modified:  Sat Oct 07 12:10:05 +0000 2023
>Originator:     Izumi Tsutsui
>Release:        NetBSD 7.0
>Organization:
>Environment:
System: NetBSD microvax 7.0 NetBSD 7.0 (GENERIC.201509250726Z) vax
Architecture: vax
Machine: vax
>Description:
gcc-4.8.4 in NetBSD/vax 7.0 on simh-3.9 gets ICE by SIGILL on compiling
dumb int64_t arithmetic.

>How-To-Repeat:
Install NetBSD/vax 7.0 and try following command on simh:

---
# cat killvaxgcc.c
#include <stdint.h>

int
killvaxgcc (void)
{
    int a;
    int64_t b;

    return a - 2 * b;
}
# cc killvaxgcc.c
cc: internal compiler error: Illegal instruction (program cc1)
no stack trace because unwind library not available
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://www.NetBSD.org/support/send-pr.html> for instructions.
#

---

# dmesg
Copyright (c) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
    2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015
    The NetBSD Foundation, Inc.  All rights reserved.
Copyright (c) 1982, 1986, 1989, 1991, 1993
    The Regents of the University of California.  All rights reserved.

NetBSD 7.0 (GENERIC.201509250726Z)
MicroVAX 3800/3900
total memory = 255 MB
avail memory = 243 MB
kern.module.path=/stand/vax/7.0/modules
timecounter: Timecounters tick every 10.000 msec
mainbus0 (root)
cpu0 at mainbus0: KA655, CVAX microcode rev 6 Firmware rev 83
lance at mainbus0 not configured
uba0 at mainbus0: Q22
dz1 at uba0 csr 160100 vec 304 ipl 17
mtc0 at uba0 csr 174500 vec 774 ipl 17
mscpbus0 at mtc0: version 5 model 3
mscpbus0: DMA burst size set to 4
uda0 at uba0 csr 172150 vec 770 ipl 17
mscpbus1 at uda0: version 3 model 3
mscpbus1: DMA burst size set to 4
qe0 at uba0 csr 174440 vec 764 ipl 17: delqa, hardware address 08:00:2b:aa:bb:cc
rlc0 at uba0 csr 174400 vec 160 ipl 17
rl0 at rlc0 drive 0: RL01, drive not loaded
rl1 at rlc0 drive 1: RL01, drive not loaded
rl2 at rlc0 drive 2: RL01, drive not loaded
rl3 at rlc0 drive 3: RL01, drive not loaded
ts0 at uba0 csr 172520 vec 224 ipl 17: TS11
ts0: rev 0, extended features enabled, transport offline
timecounter: Timecounter "clockinterrupt" frequency 100 Hz quality 0
timecounter: Timecounter "mfpr" frequency 1000000 Hz quality 100
mt0 at mscpbus0 drive 0: TK50
mt1 at mscpbus0 drive 1: TK50
mt2 at mscpbus0 drive 2: TK50
mt3 at mscpbus0 drive 3: TK50
ra0 at mscpbus1 drive 0: RA92
racd0 at mscpbus1 drive 1: RRD40
ra1 at mscpbus1 drive 2: RD54
rx0 at mscpbus1 drive 3: RX50
Kernelized RAIDframe activated
ra0: size 2940951 sectors
racd0: size 1331200 sectors
ra1: attempt to bring on line failed:  unit offline (not mounted) (code 3, subcode 1)
rx0: attempt to bring on line failed:  unit offline (not mounted) (code 3, subcode 1)
boot device: ra0
root on ra0a dumps on ra0b
root file system type: ffs
# gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/libexec/lto-wrapper
Target: vax--netbsdelf
Configured with: /usr/7/src/tools/gcc/../../external/gpl3/gcc/dist/configure --target=vax--netbsdelf --enable-long-long --enable-threads --with-bugurl=http://www.NetBSD.org/Misc/send-pr.html --with-pkgversion='NetBSD nb2 20150115' --with-system-zlib --enable-__cxa_atexit --enable-libstdcxx-threads --enable-libstdcxx-time=rt --enable-lto --with-mpc-lib=/var/obj/mknative/vax/usr/7/src/external/lgpl3/mpc/lib/libmpc --with-mpfr-lib=/var/obj/mknative/vax/usr/7/src/external/lgpl3/mpfr/lib/libmpfr --with-gmp-lib=/var/obj/mknative/vax/usr/7/src/external/lgpl3/gmp/lib/libgmp --with-mpc-include=/usr/7/src/external/lgpl3/mpc/dist/src --with-mpfr-include=/usr/7/src/external/lgpl3/mpfr/dist/src --with-gmp-include=/usr/7/src/external/lgpl3/gmp/lib/libgmp/arch/vax --disable-multilib --disable-symvers --disable-libstdcxx-pch --build=x86_64-unknown-netbsd6.0. --host=vax--netbsdelf --with-sysroot=/var/obj/mknative/vax/usr/7/src/destdir.vax
Thread model: posix
gcc version 4.8.4 (nb2 20150115) 
#
---

gcc 4.1.3 in NetBSD/vax 6.1.5 works fine.

>Fix:
No idea.

>Release-Note:

>Audit-Trail:
From: Rin Okuyama <rokuyama@rk.phys.keio.ac.jp>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: port-vax/50384 NetBSD/vax 7.0 gcc-4.8.4 gets ICE by SIGILL
Date: Tue, 14 Feb 2017 07:01:36 +0900

 This problem does no longer exist with GCC 5.4 from NetBSD 5.99.59:

    # uname -a
    NetBSD vax 7.99.59 NetBSD 7.99.59 (GENERIC) #0: Wed Jan 18 00:10:36 JST 2017  rin@latipes:/var/build/src/sys/arch/vax/compile/obj.vax-vax/GENERIC vax
    # cc --version
    cc (nb1 20160606) 5.4.0
    Copyright (C) 2015 Free Software Foundation, Inc.
    This is free software; see the source for copying conditions.  There is NO
    warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
    # cc killvaxgcc.c
    # ls -l killvaxgcc.o
    -rw-r--r--  1 root  wheel  796 Feb 14 06:59 killvaxgcc.o

State-Changed-From-To: open->closed
State-Changed-By: maya@NetBSD.org
State-Changed-When: Sun, 18 Aug 2019 05:06:18 +0000
State-Changed-Why:
reported fixed in newer versions. IMO, backporting is not worth the extra effort, since any vax-efforts should be spent on fixing other issues.


From: "Rin Okuyama" <rin@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/50384 CVS commit: src/external/gpl3/gcc.old/dist/gcc/config/vax
Date: Sat, 7 Oct 2023 12:09:07 +0000

 Module Name:	src
 Committed By:	rin
 Date:		Sat Oct  7 12:09:06 UTC 2023

 Modified Files:
 	src/external/gpl3/gcc.old/dist/gcc/config/vax: builtins.md

 Log Message:
 gcc.old: vax: PR port-vax/57646 patch provided by Kalvis Duckmanton [16/21]

 PR port-vax/50384: NetBSD/vax 7.0 gcc-4.8.4 gets ICE by SIGILL

 Fix for https://gnats.netbsd.org/cgi-bin/query-pr-single.pl?number=50384
 as encountered in gcc 7 in NetBSD 7.

 VAX's FFS instruction as used in GCC's count_zero and ffssi2 instructions
 uses the Z flag to indicate whether a set bit was found or not; GCC expects
 the Z flag to consistently indicate whether the result is zero.


 To generate a diff of this commit:
 cvs rdiff -u -r1.11 -r1.12 \
     src/external/gpl3/gcc.old/dist/gcc/config/vax/builtins.md

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.47 2022/09/11 19:34:41 kim Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2023 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.