This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/15526] New: -ftrapv aborts on 0 * (-1)
- From: "schnetter at aei dot mpg dot de" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 18 May 2004 20:43:37 -0000
- Subject: [Bug c/15526] New: -ftrapv aborts on 0 * (-1)
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
My version of gcc
$ ~/gcc/bin/gcc --version
gcc (GCC) 3.5.0 20040517 (experimental)
produces code that aborts when it encounters the expression "0 * (-1)" when
compiled with -ftrapv. The failing programme is
int test (int a)
{
return a * (a-1);
}
int main (int argc, char ** argv)
{
test (0);
return 0;
}
which I compile with
$ ~/gcc/bin/gcc -o mul-trapv mul-trapv.c -ftrapv
--
Summary: -ftrapv aborts on 0 * (-1)
Product: gcc
Version: 3.5.0
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: c
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: schnetter at aei dot mpg dot de
CC: gcc-bugs at gcc dot gnu dot org
GCC build triplet: i686-pc-linux-gnu
GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15526