public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/37156]  New: Hangwith -g -O2 (or higher)  (discovered with malloc.c in sqlite3)
@ 2008-08-18 22:22 cw at f00f dot org
  2008-08-18 22:35 ` [Bug debug/37156] " cw at f00f dot org
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: cw at f00f dot org @ 2008-08-18 22:22 UTC (permalink / raw)
  To: gcc-bugs

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 2296 bytes --]

cw@lysdexia:~/wk/sqlite-cvs-git/build$ gcc -v
Using built-in specs.
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Debian 4.3.1-2'
--with-bugurl=file:///usr/share/doc/gcc-4.3/README.Bugs
--enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr --enable-shared
--with-system-zlib --libexecdir=/usr/lib --without-included-gettext
--enable-threads=posix --enable-nls --with-gxx-include-dir=/usr/include/c++/4.3
--program-suffix=-4.3 --enable-clocale=gnu --enable-libstdcxx-debug
--enable-objc-gc --enable-mpfr --enable-cld --enable-checking=release
--build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 4.3.1 (Debian 4.3.1-2)

I get a hang:

cw@lysdexia:~/wk/sqlite-cvs-git/build$ gcc -Wall -c -O2 -g malloc.i
malloc.i: In function ‘sqlite3_memory_used’:
malloc.i:10: warning: call to ‘sqlite3_status’ declared with attribute warning:
is experimental
  <...hang...>

malloc.i (below, and which i will also attach if i can) is derived from
malloc.c from sqlite (CVS as of this morning), i butchered it as much a i could
to make it as small as possible but still show the problem.

-O1 -g hangs
-O2 is ok
-O2 -g hangs

if you take out either function or any calls the hang seems to go away


cw@lysdexia:~/wk/sqlite-cvs-git/build$ cat malloc.i

typedef long long int sqlite_int64;
typedef sqlite_int64 sqlite3_int64;

__attribute__ ((warning ("is experimental"))) int sqlite3_status(int op, int
*pCurrent, int *pHighwater, int resetFlag);

sqlite3_int64 sqlite3_memory_used(void){
  int n, mx;
  sqlite3_int64 res;
  sqlite3_status(0, &n, &mx, 0);
  res = (sqlite3_int64)n;
  return res;
}

void sqlite3_soft_heap_limit(int n){
  int overage;
  overage = sqlite3_memory_used() - n;
}


-- 
           Summary: Hangwith -g -O2 (or higher)  (discovered with malloc.c
                    in sqlite3)
           Product: gcc
           Version: 4.3.1
            Status: UNCONFIRMED
          Severity: major
          Priority: P3
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: cw at f00f dot org
 GCC build triplet: x86_64-linux-gnu
  GCC host triplet: x86_64-linux-gnu
GCC target triplet: x86_64-linux-gnu


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


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

end of thread, other threads:[~2008-08-19 11:53 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-08-18 22:22 [Bug c/37156] New: Hangwith -g -O2 (or higher) (discovered with malloc.c in sqlite3) cw at f00f dot org
2008-08-18 22:35 ` [Bug debug/37156] " cw at f00f dot org
2008-08-18 22:38 ` cw at f00f dot org
2008-08-19  0:40 ` [Bug debug/37156] Hang with " cw at f00f dot org
2008-08-19  0:42 ` cw at f00f dot org
2008-08-19  0:43 ` cw at f00f dot org
2008-08-19  7:44 ` [Bug debug/37156] [4.3 Regression] " jakub at gcc dot gnu dot org
2008-08-19 11:47 ` jakub at gcc dot gnu dot org
2008-08-19 11:52 ` jakub at gcc dot gnu dot org
2008-08-19 11:53 ` jakub at gcc dot gnu dot org

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).