public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* c/9088: c code aborts with -ftrapv
@ 2002-12-28 16:26 wefing
  0 siblings, 0 replies; 3+ messages in thread
From: wefing @ 2002-12-28 16:26 UTC (permalink / raw)
  To: gcc-gnats


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


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: c/9088: c code aborts with -ftrapv
@ 2003-01-08 10:26 Volker Reichelt
  0 siblings, 0 replies; 3+ messages in thread
From: Volker Reichelt @ 2003-01-08 10:26 UTC (permalink / raw)
  To: nobody; +Cc: gcc-prs

The following reply was made to PR c/9088; it has been noted by GNATS.

From: Volker Reichelt <reichelt@igpm.rwth-aachen.de>
To: gcc-gnats@gcc.gnu.org, wefing@gmx.de, gcc-bugs@gcc.gnu.org
Cc:  
Subject: Re: c/9088: c code aborts with -ftrapv
Date: Wed, 8 Jan 2003 12:14:55 +0100

 The bug seems to affect all versions since gcc 3.0 when the option was
 introduced (including 3.2-branch, 3.3-branch and mainline).
 
 The bug seems to be target-dependant, since I cannot reproduce it on
 mips-sgi-irix6.5.
 
 Regards,
 Volker
 
 http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=9088
 
 
 


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: c/9088: c code aborts with -ftrapv
@ 2003-01-08  2:53 bangerth
  0 siblings, 0 replies; 3+ messages in thread
From: bangerth @ 2003-01-08  2:53 UTC (permalink / raw)
  To: gcc-bugs, gcc-prs, nobody, wefing

Synopsis: c code aborts with -ftrapv

State-Changed-From-To: open->analyzed
State-Changed-By: bangerth
State-Changed-When: Tue Jan  7 18:53:45 2003
State-Changed-Why:
    Confirmed.

http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=9088


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2003-01-08 10:26 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-12-28 16:26 c/9088: c code aborts with -ftrapv wefing
2003-01-08  2:53 bangerth
2003-01-08 10:26 Volker Reichelt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).