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

           Summary: __aeabi_uidiv broken when built with -Os  (5/3 == 3)
           Product: gcc
           Version: 4.5.2
            Status: UNCONFIRMED
          Severity: critical
          Priority: P3
         Component: c
        AssignedTo: unassig...@gcc.gnu.org
        ReportedBy: enrico.sch...@informatik.tu-chemnitz.de


int main(int argc, char *argv[])
{
    unsigned int volatile    a = 5;
    unsigned int volatile    b = 3;
    __asm__ __volatile__("" ::: "memory");
    return a/b;
}

$ arm-linux-gnueabi-gcc -O0 m.c

---

# /a.out ; echo $?
3


Implementation of uidiv in gcc/config/arm/lib1funcs.asm differs depending on
the -Os flag (which is used by me) and issue might be missed by regression
tests which were run with non -Os compilers.

------------------

$ LANG=C arm-linux-gnueabi-gcc -v 
Using built-in specs.
COLLECT_GCC=arm-linux-gnueabi-gcc
COLLECT_LTO_WRAPPER=/srv/projects/elito-ref/COLIBRI270/tmp/sysroots/x86_64-linux/usr/armv5te/libexec/gcc/arm-linux-gnueabi/4.5.2/lto-wrapper
Target: arm-linux-gnueabi
Configured with:
/srv/projects/elito-ref/COLIBRI270/tmp/work/armv5te-linux-gnueabi/gcc-cross-4.5-r1+svnr163322/gcc-4.5/configure
--build=x86_64-linux --host=x86_64-linux --target=arm-linux-gnueabi
--prefix=/srv/projects/elito-ref/COLIBRI270/tmp/sysroots/x86_64-linux/usr/armv5te
--exec_prefix=/srv/projects/elito-ref/COLIBRI270/tmp/sysroots/x86_64-linux/usr/armv5te
--bindir=/srv/projects/elito-ref/COLIBRI270/tmp/sysroots/x86_64-linux/usr/armv5te/bin
--sbindir=/srv/projects/elito-ref/COLIBRI270/tmp/sysroots/x86_64-linux/usr/armv5te/bin
--libexecdir=/srv/projects/elito-ref/COLIBRI270/tmp/sysroots/x86_64-linux/usr/armv5te/libexec
--datadir=/srv/projects/elito-ref/COLIBRI270/tmp/sysroots/x86_64-linux/usr/armv5te/share
--sysconfdir=/srv/projects/elito-ref/COLIBRI270/tmp/sysroots/x86_64-linux/etc
--sharedstatedir=/srv/projects/elito-ref/COLIBRI270/tmp/sysroots/x86_64-linux/com
--localstatedir=/srv/projects/elito-ref/COLIBRI270/tmp/sysroots/x86_64-linux/var
--libdir=/srv/projects/elito-ref/COLIBRI270/tmp/sysroots/x86_64-linux/usr/armv5te/lib
--includedir=/srv/projects/elito-ref/COLIBRI270/tmp/sysroots/x86_64-linux/usr/armv5te/include
--oldincludedir=/srv/projects/elito-ref/COLIBRI270/tmp/sysroots/x86_64-linux/usr/armv5te/include
--infodir=/srv/projects/elito-ref/COLIBRI270/tmp/sysroots/x86_64-linux/usr/armv5te/share/info
--mandir=/srv/projects/elito-ref/COLIBRI270/tmp/sysroots/x86_64-linux/usr/armv5te/share/man
--with-gnu-ld --enable-shared --enable-languages=c,c++,objc
--enable-threads=posix --disable-multilib --enable-c99 --enable-long-long
--enable-symvers=gnu --enable-libstdcxx-pch --program-prefix=arm-linux-gnueabi-
--enable-target-optspace --enable-lto --enable-libssp --disable-bootstrap
--disable-libgomp --disable-libmudflap --with-abi=aapcs-linux --with-float=soft
--with-sysroot=/srv/projects/elito-ref/COLIBRI270/tmp/sysroots/armv5te-linux-gnueabi
--with-build-sysroot=/srv/projects/elito-ref/COLIBRI270/tmp/sysroots/armv5te-linux-gnueabi
--with-build-time-tools=/srv/projects/elito-ref/COLIBRI270/tmp/sysroots/x86_64-linux/usr/armv5te/bin
--disable-libunwind-exceptions
--with-mpfr=/srv/projects/elito-ref/COLIBRI270/tmp/sysroots/x86_64-linux/usr
--with-system-zlib --program-prefix=arm-linux-gnueabi- --enable-__cxa_atexit
Thread model: posix
gcc version 4.5.2 20100818 (prerelease) (GCC)

Reply via email to