public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "su at cs dot ucdavis.edu" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/57719] [4.8/4.9 Regression] wrong code at -O3 on x86_64-linux-gnu Date: Thu, 27 Jun 2013 20:48:00 -0000 [thread overview] Message-ID: <bug-57719-4-O4FhGu7Zsx@http.gcc.gnu.org/bugzilla/> (raw) In-Reply-To: <bug-57719-4@http.gcc.gnu.org/bugzilla/> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57719 --- Comment #2 from Zhendong Su <su at cs dot ucdavis.edu> --- Hi Jakub, below are three additional (possibly related) testcases that may help you folks diagnose the issue; they (including the original testcase) all manifest differently: --------------------- test #2: wrong code from both gcc trunk and 4.8 at -O3 in 32-bit mode only: int printf (const char *, ...); int c, e[2], f, g, *l; long long h; int foo () { int s[1]; int i = 0; for (; i < 1; i++) s[0] = 0; h = 0; for (; h; h = 1) { int *dp[1] = {&s[0]}; *dp[0] = 0; } g = 0; return 0; } void bar () { for (; c < 2; c++) { int *ip = &f; *ip = 0; *ip = 0 < foo (); l = &e[c]; *ip = 1; *l = 0; } } int main () { bar (); printf ("%d\n", f); return 0; } --------------------- test #3: wrong code from gcc trunk (but not gcc 4.8) at -O3 in 32-bit mode only: int printf (const char *, ...); int f1; int a, b, c; volatile int d; int e[2], f, g; long long h; int j, k, *l; short fn1 (unsigned short ui1) { return ui1 - a; } int fn4 (int p) { int s[1]; int *tp = &f; int *cp = &g; int i = 0; for (; i < 1; i++) s[0] = 0; h = 0; for (; h; h = 1) { int *dp[1] = {&s[0]}; *dp[0] = 0; } *cp = p % (1 ^ *tp); return 0; } void fn5 () { unsigned short t = 0; for (; c < 2; c++) { int *ip = &f1; b = 0; j = 0; d ^ (*ip = 0); t = fn1 (k); *ip = e[0] < fn4 (t); l = &e[c]; *ip = 1; *l = 0; } } int main () { fn5 (); printf ("%d\n", f1); return 0; } --------------------- test #4: wrong code from gcc trunk (but not gcc 4.8) at -O3 in both 32-bit and 64-bit modes: int printf (const char *, ...); int a; int b; int c; volatile int d; int e; int f[2]; int g; int h; int j; int *k = &f[0]; int l; short fn1 (unsigned short p) { return p * a; } int fn2 (int p) { int m[1]; int i = 0; for (; i < 1; i++) m[0] = 0; g = 0; for (; g; g = 1) { int *n[1] = {&m[0]}; } l = p % (1 ^ *k); return 0; } int main () { unsigned short o = 0; int *p; for (; c < 2; c++) { int *q = &e; b = 0; h = 0; d ^ (*q = 0); o = fn1 (j); *q = f[0] < fn2 (o); p = &f[c]; *q = 1; fn2 (0); *p = 0; } printf ("%d\n", e); return 0; }
next prev parent reply other threads:[~2013-06-27 20:48 UTC|newest] Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top [not found] <bug-57719-4@http.gcc.gnu.org/bugzilla/> 2013-06-26 8:46 ` jakub at gcc dot gnu.org 2013-06-27 20:48 ` su at cs dot ucdavis.edu [this message] 2013-06-29 17:58 ` mikpe at it dot uu.se 2013-06-29 20:17 ` mikpe at it dot uu.se 2013-09-29 16:13 ` mikpelinux at gmail dot com 2013-09-29 18:37 ` mikpelinux at gmail dot com 2013-10-16 9:51 ` jakub at gcc dot gnu.org 2013-10-30 13:06 ` rguenth 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-57719-4-O4FhGu7Zsx@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).