public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
* [Bug c/17169] New: optimization bug @ 2004-08-24 14:39 kminola at eng dot umd dot edu 2004-08-24 15:28 ` [Bug rtl-optimization/17169] " pinskia at gcc dot gnu dot org ` (2 more replies) 0 siblings, 3 replies; 5+ messages in thread From: kminola at eng dot umd dot edu @ 2004-08-24 14:39 UTC (permalink / raw) To: gcc-bugs /* gcc-3.4.1 optimization bug gcc -o foo foo.c -O0 ok gcc -o foo foo.c -O1 bug % ./config.guess ia64-unknown-linux-gnu % % gcc -v Reading specs from /u/kminola/public/gcc-3.4.1/ia64-Linux/bin/../lib/gcc/ia64-un known-linux-gnu/3.4.1/specs Configured with: /u/kminola/public/gcc-3.4.1/src/gcc-3.4.1/configure --enable-la nguages=c --prefix=/u/kminola/public/gcc-3.4.1/ia64-Linux Thread model: posix gcc version 3.4.1 % does NOT exist in gcc-3.5-20040711 */ #include <stdio.h> #define GMP_RNDU 2 #define GMP_RNDD 3 int bar (long a, int rnd_mode) { int signx; long b; b = a >> 31; if (b) { signx = -1; } else { signx = 1; } if (signx < 0 && rnd_mode == GMP_RNDD) { return -1; } if (signx > 0 && rnd_mode == GMP_RNDU) { return 1; } return 2; } int main (int argc, char *argv[]) { int val; long a; a = 1; val = bar (a, GMP_RNDU); if (val == 2) { printf("bug!\n"); } else { printf("ok!\n"); } return 0; } -- Summary: optimization bug Product: gcc Version: 3.4.1 Status: UNCONFIRMED Severity: normal Priority: P2 Component: c AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: kminola at eng dot umd dot edu CC: gcc-bugs at gcc dot gnu dot org GCC build triplet: ia64-unknown-linux-gnu GCC host triplet: ia64-unknown-linux-gnu GCC target triplet: ia64-unknown-linux-gnu http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17169 ^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug rtl-optimization/17169] optimization bug 2004-08-24 14:39 [Bug c/17169] New: optimization bug kminola at eng dot umd dot edu @ 2004-08-24 15:28 ` pinskia at gcc dot gnu dot org 2004-08-26 2:03 ` wilson at gcc dot gnu dot org 2005-01-10 23:43 ` sje at cup dot hp dot com 2 siblings, 0 replies; 5+ messages in thread From: pinskia at gcc dot gnu dot org @ 2004-08-24 15:28 UTC (permalink / raw) To: gcc-bugs -- What |Removed |Added ---------------------------------------------------------------------------- Component|c |rtl-optimization Keywords| |wrong-code Known to work| |3.5.0 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17169 ^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug rtl-optimization/17169] optimization bug 2004-08-24 14:39 [Bug c/17169] New: optimization bug kminola at eng dot umd dot edu 2004-08-24 15:28 ` [Bug rtl-optimization/17169] " pinskia at gcc dot gnu dot org @ 2004-08-26 2:03 ` wilson at gcc dot gnu dot org 2005-01-10 23:43 ` sje at cup dot hp dot com 2 siblings, 0 replies; 5+ messages in thread From: wilson at gcc dot gnu dot org @ 2004-08-26 2:03 UTC (permalink / raw) To: gcc-bugs ------- Additional Comments From wilson at gcc dot gnu dot org 2004-08-26 02:03 ------- Appears to be a problem in combine. We have 3 possible return values before combine, but only two possible return values after combine. I haven't traced through combine far enough yet to determine what the problem is. -- What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEW Ever Confirmed| |1 Last reconfirmed|0000-00-00 00:00:00 |2004-08-26 02:03:30 date| | http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17169 ^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug rtl-optimization/17169] optimization bug 2004-08-24 14:39 [Bug c/17169] New: optimization bug kminola at eng dot umd dot edu 2004-08-24 15:28 ` [Bug rtl-optimization/17169] " pinskia at gcc dot gnu dot org 2004-08-26 2:03 ` wilson at gcc dot gnu dot org @ 2005-01-10 23:43 ` sje at cup dot hp dot com 2 siblings, 0 replies; 5+ messages in thread From: sje at cup dot hp dot com @ 2005-01-10 23:43 UTC (permalink / raw) To: gcc-bugs ------- Additional Comments From sje at cup dot hp dot com 2005-01-10 23:43 ------- I looked into this bug some, it is fixed on 4.0, but the patch that fixes it is the integration of tree-ssa into the mainline. I believe that the underlying combine bug still exists but the tree-ssa changes result in different RTL being generated so that the combine bug isn't hit. I looked at try_combine using the 3.4 sources. Attached is the i1, i2, i3 values we enter try_combine with and what it generates. I have no idea how it came up with the result that it did but that seems to be the heart of the problem. In try_combine: I1 is (nil) I2 is (insn 53 51 54 2 (set (reg:BI 360) (eq:BI (reg/v:SI 341 [ rnd_mode ]) (const_int 2 [0x2]))) 209 {*cmpsi_normal} (nil) (expr_list:REG_DEAD (reg/v:SI 341 [ rnd_mode ]) (nil))) I3 is (insn 57 56 58 2 (set (reg:BI 363) (and:BI (gt:BI (reg/v:SI 342 [ signx ]) (const_int 0 [0x0])) (reg:BI 360))) 66 {*cmpsi_and_1} (insn_list 53 (nil)) (expr_list:REG_DEAD (reg/v:SI 342 [ signx ]) (expr_list:REG_DEAD (reg:BI 360) (nil)))) ========================== Returns: (insn 57 56 58 2 (set (reg:BI 363) (const_int 0 [0x0])) 1 {movbi} (nil) (nil)) ========================== -- What |Removed |Added ---------------------------------------------------------------------------- CC| |sje at cup dot hp dot com http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17169 ^ permalink raw reply [flat|nested] 5+ messages in thread
[parent not found: <bug-17169-6067@http.gcc.gnu.org/bugzilla/>]
* [Bug rtl-optimization/17169] optimization bug [not found] <bug-17169-6067@http.gcc.gnu.org/bugzilla/> @ 2007-05-17 14:18 ` ebotcazou at gcc dot gnu dot org 0 siblings, 0 replies; 5+ messages in thread From: ebotcazou at gcc dot gnu dot org @ 2007-05-17 14:18 UTC (permalink / raw) To: gcc-bugs ------- Comment #3 from ebotcazou at gcc dot gnu dot org 2007-05-17 15:17 ------- 3.4.x is not maintained anymore. -- ebotcazou at gcc dot gnu dot org changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |ebotcazou at gcc dot gnu dot | |org Status|NEW |RESOLVED Resolution| |WONTFIX http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17169 ^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2007-05-17 14:18 UTC | newest] Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2004-08-24 14:39 [Bug c/17169] New: optimization bug kminola at eng dot umd dot edu 2004-08-24 15:28 ` [Bug rtl-optimization/17169] " pinskia at gcc dot gnu dot org 2004-08-26 2:03 ` wilson at gcc dot gnu dot org 2005-01-10 23:43 ` sje at cup dot hp dot com [not found] <bug-17169-6067@http.gcc.gnu.org/bugzilla/> 2007-05-17 14:18 ` ebotcazou 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).