public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "hjl.tools at gmail dot com" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug target/47383] New: [x32] Incorrect array access Date: Thu, 20 Jan 2011 20:12:00 -0000 [thread overview] Message-ID: <bug-47383-4@http.gcc.gnu.org/bugzilla/> (raw) http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47383 Summary: [x32] Incorrect array access Product: gcc Version: 4.6.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: target AssignedTo: unassigned@gcc.gnu.org ReportedBy: hjl.tools@gmail.com [hjl@gnu-6 build]$ cat test/prXXX.c static int heap[2*(256 +1+29)+1]; static int heap_len; static int heap_max; void __attribute__ ((noinline)) foo (int elems) { int n, m; int max_code = -1; int node = elems; heap_len = 0, heap_max = (2*(256 +1+29)+1); for (n = 0; n < elems; n++) heap[++heap_len] = max_code = n; do { n = heap[1]; heap[1] = heap[heap_len--]; m = heap[1]; heap[--heap_max] = n; heap[--heap_max] = m; } while (heap_len >= 2); } int main () { foo (286); return 0; } [hjl@gnu-6 build]$ make mkdir -p x32/exe /export/build/gnu/gcc-x32/build-x86_64-linux/gcc/xgcc -B/export/build/gnu/gcc-x32/build-x86_64-linux/gcc/ -mx32 -fPIC -fno-exceptions -I/export/gnu/import/git/kernel.org/x32/libc/build/../bionic/libc/arch-x32/include -I/export/gnu/import/git/kernel.org/x32/libc/build/../bionic/libc/include -I/export/gnu/import/git/kernel.org/x32/libc/build/../bionic/libc/kernel/arch-x32 -I/export/gnu/import/git/kernel.org/x32/libc/build/../bionic/libc/kernel -I/export/gnu/import/git/kernel.org/x32/libc/build/../bionic/libc/kernel/common -I/export/gnu/import/git/kernel.org/x32/libc/build/../bionic/libm/include -I/export/gnu/import/git/kernel.org/x32/libc/build/../bionic/libm/include/i387 -Ulinux -D__ANDROID__ -DANDROID -DUSE_SSSE3 -DUSE_SSE2 -DPIC -g -O2 -o x32/exe/prXXX.static -nostdlib -Wl,-Bstatic -Wl,-z,nocombreloc x32/lib/crtbegin_static.o x32/obj/prXXX.o -Wl,--start-group x32/lib/libc.a /export/build/gnu/gcc-x32/build-x86_64-linux/gcc/libgcc.a -Wl,--end-group x32/lib/crtend_android.o mkdir -p x32/exe /export/build/gnu/gcc-x32/build-x86_64-linux/gcc/xgcc -B/export/build/gnu/gcc-x32/build-x86_64-linux/gcc/ -mx32 -fPIC -fno-exceptions -I/export/gnu/import/git/kernel.org/x32/libc/build/../bionic/libc/arch-x32/include -I/export/gnu/import/git/kernel.org/x32/libc/build/../bionic/libc/include -I/export/gnu/import/git/kernel.org/x32/libc/build/../bionic/libc/kernel/arch-x32 -I/export/gnu/import/git/kernel.org/x32/libc/build/../bionic/libc/kernel -I/export/gnu/import/git/kernel.org/x32/libc/build/../bionic/libc/kernel/common -I/export/gnu/import/git/kernel.org/x32/libc/build/../bionic/libm/include -I/export/gnu/import/git/kernel.org/x32/libc/build/../bionic/libm/include/i387 -Ulinux -D__ANDROID__ -DANDROID -DUSE_SSSE3 -DUSE_SSE2 -DPIC -g -O2 -o x32/exe/prXXX.dynamic -nostdlib -Wl,-z,nocopyreloc -Wl,-z,nocombreloc -Wl,-dynamic-linker /export/gnu/import/git/kernel.org/x32/libc/build/x32/lib/ld.so x32/lib/crtbegin_dynamic.o x32/obj/prXXX.o x32/lib/libc.so x32/lib/libdl.so /export/build/gnu/gcc-x32/build-x86_64-linux/gcc/libgcc.a x32/lib/crtend_android.o export LD_LIBRARY_PATH=x32/lib; \ for f in x32/exe/init-mixed.static x32/exe/init-mixed.dynamic x32/exe/hello.static x32/exe/hello.dynamic x32/exe/prXXX.static x32/exe/prXXX.dynamic; do \ ./$f; \ done OK OK Hello world Hello world /bin/sh: line 1: 22295 Segmentation fault ./$f /bin/sh: line 1: 22296 Segmentation fault ./$f make: *** [all] Error 139 [hjl@gnu-6 build]$
next reply other threads:[~2011-01-20 20:00 UTC|newest] Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top 2011-01-20 20:12 hjl.tools at gmail dot com [this message] 2011-01-20 20:13 ` [Bug target/47383] " hjl.tools at gmail dot com 2011-01-21 0:02 ` hjl.tools at gmail dot com 2011-01-21 7:11 ` [Bug middle-end/47383] ivopts miscompiles Pmode != ptr_mode hjl.tools at gmail dot com 2011-01-21 7:13 ` hjl.tools at gmail dot com 2011-01-21 8:29 ` hjl.tools at gmail dot com 2011-01-21 11:54 ` pinskia at gmail dot com 2011-01-21 12:59 ` rguenth at gcc dot gnu.org 2011-02-04 4:13 ` hjl.tools at gmail dot com 2011-02-07 12:29 ` rguenth at gcc dot gnu.org 2011-02-08 23:28 ` hjl.tools at gmail dot com 2011-02-09 17:33 ` hjl at gcc dot gnu.org 2011-02-12 17:38 ` hjl at gcc dot gnu.org 2011-02-12 17:48 ` hjl at gcc dot gnu.org 2011-07-06 13:20 ` hjl at gcc dot gnu.org 2011-07-06 18:23 ` hjl.tools at gmail dot com 2011-07-06 20:31 ` hjl at gcc dot gnu.org 2011-08-03 14:45 ` [Bug middle-end/47383] [x32] " hjl at gcc dot gnu.org
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=bug-47383-4@http.gcc.gnu.org/bugzilla/ \ --to=gcc-bugzilla@gcc.gnu.org \ --cc=gcc-bugs@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
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).