------- Comment #2 from rearnsha at gcc dot gnu dot org  2010-04-14 20:50 
-------
Before confirming this bug, we need to determine if the following program has
well defined behaviour:

int count_div0 = 0;

int __aeabi_div0()
{
  count_div0++;
  return 0;
}

int divmod(int a, int b)
{
    int q = a / b;
    int r = a % b;
    return q + r;
}

int main()
{
  divmod(33, 0);
  printf("%d", count_div0);
  return 0;
}

If the above program should always print "2", then the compiler is correct and
this report is invalid.  If it may print any value, then the compiler is wrong
and should be fixed to optimize this case.  Note that __aeabi_div0 will be
called if either __aeabi_idiv or __aeabi_idivmod are called with 0 as the
second parameter.



-- 

rearnsha at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |rearnsha at gcc dot gnu dot
                   |                            |org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43721

Reply via email to