From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19389 invoked by alias); 29 Dec 2002 00:26:00 -0000 Mailing-List: contact gcc-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-prs-owner@gcc.gnu.org Received: (qmail 19363 invoked by uid 71); 29 Dec 2002 00:26:00 -0000 Resent-Date: 29 Dec 2002 00:26:00 -0000 Resent-Message-ID: <20021229002600.19362.qmail@sources.redhat.com> Resent-From: gcc-gnats@gcc.gnu.org (GNATS Filer) Resent-Cc: gcc-prs@gcc.gnu.org, gcc-bugs@gcc.gnu.org Resent-Reply-To: gcc-gnats@gcc.gnu.org, wefing@gmx.de Received: (qmail 18746 invoked from network); 29 Dec 2002 00:20:38 -0000 Received: from unknown (HELO mail.gex.gmd.de) (192.76.241.110) by 209.249.29.67 with SMTP; 29 Dec 2002 00:20:38 -0000 Received: from antibiotix.caesar.de ([212.184.115.205]) by mail.gex.gmd.de (8.9.3/8.9.3) with ESMTP id BAA27410 for ; Sun, 29 Dec 2002 01:20:25 +0100 (MET) Received: (from wefing@localhost) by antibiotix.caesar.de (8.11.0/8.11.0/SuSE Linux 8.11.0-0.4) id gBT0KOE04779; Sun, 29 Dec 2002 01:20:24 +0100 Message-Id: <200212290020.gBT0KOE04779@antibiotix.caesar.de> Date: Sat, 28 Dec 2002 16:26:00 -0000 From: wefing@gmx.de Reply-To: wefing@gmx.de To: gcc-gnats@gcc.gnu.org X-Send-Pr-Version: 3.113 Subject: c/9088: c code aborts with -ftrapv X-SW-Source: 2002-12/txt/msg01358.txt.bz2 List-Id: >Number: 9088 >Category: c >Synopsis: c code aborts with -ftrapv >Confidential: no >Severity: serious >Priority: medium >Responsible: unassigned >State: open >Class: sw-bug >Submitter-Id: net >Arrival-Date: Sat Dec 28 16:26:00 PST 2002 >Closed-Date: >Last-Modified: >Originator: Stephan Wefing >Release: 3.2 >Organization: none >Environment: System: Linux kato 2.4.19-64GB-SMP #1 SMP Fri Sep 13 13:15:53 UTC 2002 i686 unknown Architecture: i686 Linux-Distribution: SuSE Professional 8.1 host: i486-suse-linux-gnu build: i486-suse-linux-gnu target: i486-suse-linux-gnu configured with: ../configure --enable-threads=posix --prefix=/usr --with-local-prefix=/usr/local --infodir=/usr/share/info --mandir=/usr/share/man --libdir=/usr/lib --enable-languages=c,c++,f77,objc,java,ada --enable-libgcj --with-gxx-include-dir=/usr/include/g++ --with-slibdir=/lib --with-system-zlib --enable-shared --enable-__cxa_atexit i486-suse-linux >Description: simple c code using pointer arithmetics aborts if compiled with -ftrapv. may be related to PR 9097. >How-To-Repeat: kato wefing/tmp> cat prog.c int main(void) { struct s { int i; double x; }; struct s a[2]; struct s *p=a+1; int i=p-a; return 0; } kato wefing/tmp> gcc -o prog prog.c kato wefing/tmp> ./prog kato wefing/tmp> gcc -ftrapv -o prog prog.c kato wefing/tmp> ./prog Abort (core dumped) Exit 134 kato wefing/tmp> gcc -g -ftrapv -o prog prog.c kato wefing/tmp> ./prog Abort (core dumped) Exit 134 kato wefing/tmp> gdb ./prog core GNU gdb 5.2.1 Copyright 2002 Free Software Foundation, Inc. GDB is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions. Type "show copying" to see the conditions. There is absolutely no warranty for GDB. Type "show warranty" for details. This GDB was configured as "i586-suse-linux"... Core was generated by `./prog'. Program terminated with signal 6, Aborted. Reading symbols from /lib/libc.so.6...done. Loaded symbols for /lib/libc.so.6 Reading symbols from /lib/ld-linux.so.2...done. Loaded symbols for /lib/ld-linux.so.2 #0 0x4004edf1 in kill () from /lib/libc.so.6 (gdb) w #0 0x4004edf1 in kill () from /lib/libc.so.6 #1 0x4004ebd8 in raise () from /lib/libc.so.6 #2 0x400504d9 in abort () from /lib/libc.so.6 #3 0x08048452 in __mulvsi3 () at ../../gcc/libgcc2.c:144 #4 0x08048378 in main () at prog.c:11 #5 0x4003d4a2 in __libc_start_main () from /lib/libc.so.6 (gdb) f 4 #4 0x08048378 in main () at prog.c:11 11 int i=p-a; >Fix: >Release-Note: >Audit-Trail: >Unformatted: