public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/45817] New: __aeabi_uidiv broken when built with -Os  (5/3 == 3)
@ 2010-09-28 15:25 enrico.scholz at informatik dot tu-chemnitz.de
  2010-09-28 16:04 ` [Bug c/45817] " mikpe at it dot uu.se
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: enrico.scholz at informatik dot tu-chemnitz.de @ 2010-09-28 15:25 UTC (permalink / raw)
  To: gcc-bugs

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: unassigned@gcc.gnu.org
        ReportedBy: enrico.scholz@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)


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug c/45817] __aeabi_uidiv broken when built with -Os  (5/3 == 3)
  2010-09-28 15:25 [Bug c/45817] New: __aeabi_uidiv broken when built with -Os (5/3 == 3) enrico.scholz at informatik dot tu-chemnitz.de
@ 2010-09-28 16:04 ` mikpe at it dot uu.se
  2010-09-28 16:54 ` [Bug target/45817] " pinskia at gcc dot gnu.org
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: mikpe at it dot uu.se @ 2010-09-28 16:04 UTC (permalink / raw)
  To: gcc-bugs

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

Mikael Pettersson <mikpe at it dot uu.se> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |mikpe at it dot uu.se

--- Comment #1 from Mikael Pettersson <mikpe at it dot uu.se> 2010-09-28 12:25:22 UTC ---
It appears to be --enable-target-optspace that's broken, not -Os.  With
--enable-target-optspace lib1funcs.asm is compiled with __OPTIMIZE_SIZE__,
which selects a different definition for the ARM_DIV_BODY macro than the
default one.  It seems the other definition is broken for this case.

Without --enable-target-optspace I get the correct result (1) with 4.4/4.5/4.6.


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug target/45817] __aeabi_uidiv broken when built with -Os  (5/3 == 3)
  2010-09-28 15:25 [Bug c/45817] New: __aeabi_uidiv broken when built with -Os (5/3 == 3) enrico.scholz at informatik dot tu-chemnitz.de
  2010-09-28 16:04 ` [Bug c/45817] " mikpe at it dot uu.se
@ 2010-09-28 16:54 ` pinskia at gcc dot gnu.org
  2010-09-28 19:55 ` enrico.scholz at informatik dot tu-chemnitz.de
  2010-09-28 20:05 ` enrico.scholz at informatik dot tu-chemnitz.de
  3 siblings, 0 replies; 5+ messages in thread
From: pinskia at gcc dot gnu.org @ 2010-09-28 16:54 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
          Component|c                           |target
           Severity|critical                    |normal


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug target/45817] __aeabi_uidiv broken when built with -Os  (5/3 == 3)
  2010-09-28 15:25 [Bug c/45817] New: __aeabi_uidiv broken when built with -Os (5/3 == 3) enrico.scholz at informatik dot tu-chemnitz.de
  2010-09-28 16:04 ` [Bug c/45817] " mikpe at it dot uu.se
  2010-09-28 16:54 ` [Bug target/45817] " pinskia at gcc dot gnu.org
@ 2010-09-28 19:55 ` enrico.scholz at informatik dot tu-chemnitz.de
  2010-09-28 20:05 ` enrico.scholz at informatik dot tu-chemnitz.de
  3 siblings, 0 replies; 5+ messages in thread
From: enrico.scholz at informatik dot tu-chemnitz.de @ 2010-09-28 19:55 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from enrico.scholz at informatik dot tu-chemnitz.de 2010-09-28 16:49:57 UTC ---
sorry; my fault. Caused by broken patch for #43999


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug target/45817] __aeabi_uidiv broken when built with -Os  (5/3 == 3)
  2010-09-28 15:25 [Bug c/45817] New: __aeabi_uidiv broken when built with -Os (5/3 == 3) enrico.scholz at informatik dot tu-chemnitz.de
                   ` (2 preceding siblings ...)
  2010-09-28 19:55 ` enrico.scholz at informatik dot tu-chemnitz.de
@ 2010-09-28 20:05 ` enrico.scholz at informatik dot tu-chemnitz.de
  3 siblings, 0 replies; 5+ messages in thread
From: enrico.scholz at informatik dot tu-chemnitz.de @ 2010-09-28 20:05 UTC (permalink / raw)
  To: gcc-bugs

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

enrico.scholz at informatik dot tu-chemnitz.de changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |INVALID

--- Comment #3 from enrico.scholz at informatik dot tu-chemnitz.de 2010-09-28 16:51:57 UTC ---
closing


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2010-09-28 16:52 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-09-28 15:25 [Bug c/45817] New: __aeabi_uidiv broken when built with -Os (5/3 == 3) enrico.scholz at informatik dot tu-chemnitz.de
2010-09-28 16:04 ` [Bug c/45817] " mikpe at it dot uu.se
2010-09-28 16:54 ` [Bug target/45817] " pinskia at gcc dot gnu.org
2010-09-28 19:55 ` enrico.scholz at informatik dot tu-chemnitz.de
2010-09-28 20:05 ` enrico.scholz at informatik dot tu-chemnitz.de

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).