This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c/15526] New: -ftrapv aborts on 0 * (-1)


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]