This is seen using r139123 on Ubuntu Hardy on ia32.

[EMAIL PROTECTED]:~/volatile/tmp6$ current-gcc -fwrapv -O0 small.c -o small 
[EMAIL PROTECTED]:~/volatile/tmp6$ ./small
[EMAIL PROTECTED]:~/volatile/tmp6$ current-gcc -fwrapv -O1 small.c -o small 
[EMAIL PROTECTED]:~/volatile/tmp6$ ./small
Aborted
[EMAIL PROTECTED]:~/volatile/tmp6$ current-gcc -v
Using built-in specs.
Target: i686-pc-linux-gnu
Configured with: ../configure --program-prefix=current-
--enable-languages=c,c++ --prefix=/home/regehr
Thread model: posix
gcc version 4.4.0 20080815 (experimental) (GCC) 
[EMAIL PROTECTED]:~/volatile/tmp6$ cat small.c

extern void abort (void);

static inline unsigned long int
mod_rhs(const long int rhs)
{
    if (rhs == 0) return 1;
    return rhs;
}

void func_44 (unsigned int p_45);
void func_44 (unsigned int p_45)
{
  if (!((p_45 * -9) % mod_rhs (-9))) {
    abort();
  }
}

int main (void)
{
  func_44 (2);
  return 0;
}


-- 
           Summary: possible integer codegen bug
           Product: gcc
           Version: 4.4.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: regehr at cs dot utah dot edu
 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=37125

Reply via email to