[Bug rtl-optimization/29589] incorrect conversion of (ior (ashiftrt (plus ...))) in combine.c
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29589 Steven Bosscher steven at gcc dot gnu.org changed: What|Removed |Added Status|NEW |RESOLVED Resolution|--- |DUPLICATE --- Comment #11 from Steven Bosscher steven at gcc dot gnu.org --- Merry Christmas! *** This bug has been marked as a duplicate of bug 57829 ***
[Bug rtl-optimization/29589] incorrect conversion of (ior (ashiftrt (plus ...))) in combine.c
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29589 Bernhard Kaindl bernhard.kaindl at thalesgroup dot com changed: What|Removed |Added CC||bernhard.kaindl at ||thalesgroup dot com --- Comment #10 from Bernhard Kaindl bernhard.kaindl at thalesgroup dot com 2012-03-02 19:16:13 UTC --- Verification using gcc-4.4.6 --target=powerpc-linux --host=i686-linux: The test case works with -O2, -Os as well as -O3 -no-inline with this cross-gcc, but when using -O1, the test case still calls abort() - foo returns 0 in gdb, so it has been improved, but not completely fixed in 4.4.6
[Bug rtl-optimization/29589] incorrect conversion of (ior (ashiftrt (plus ...))) in combine.c
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29589 --- Comment #9 from Mikael Pettersson mikpe at it dot uu.se 2011-11-30 08:37:49 UTC --- I can reproduce the bug on powerpc64-linux with gcc-4.2.4 -O2 -m32/-m64, but not with gcc-4.3.6, 4.4.6, 4.5.3, 4.6.1, or 4.7-current, with either -m32 or -m64. Close as fixed?
[Bug rtl-optimization/29589] incorrect conversion of (ior (ashiftrt (plus ...))) in combine.c
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29589 Andrew Pinski pinskia at gcc dot gnu.org changed: What|Removed |Added Status|ASSIGNED|NEW AssignedTo|pinskia at gcc dot gnu.org |unassigned at gcc dot ||gnu.org --- Comment #8 from Andrew Pinski pinskia at gcc dot gnu.org 2011-11-29 23:16:23 UTC --- No longer working on this and I lost the patch.
[Bug rtl-optimization/29589] incorrect conversion of (ior (ashiftrt (plus ...))) in combine.c
--- Comment #6 from steven at gcc dot gnu dot org 2008-02-03 14:39 --- Andrew, ping about your fix? -- steven at gcc dot gnu dot org changed: What|Removed |Added Status|ASSIGNED|WAITING http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29589
[Bug rtl-optimization/29589] incorrect conversion of (ior (ashiftrt (plus ...))) in combine.c
--- Comment #7 from pinskia at gcc dot gnu dot org 2008-02-03 19:30 --- (In reply to comment #6) Andrew, ping about your fix? I have to extract it, it has changed since the bug was originally sent out. -- pinskia at gcc dot gnu dot org changed: What|Removed |Added Status|WAITING |ASSIGNED Last reconfirmed|2007-06-07 21:00:43 |2008-02-03 19:30:25 date|| http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29589
[Bug rtl-optimization/29589] incorrect conversion of (ior (ashiftrt (plus ...))) in combine.c
--- Comment #5 from pinskia at gcc dot gnu dot org 2007-06-11 04:44 --- I have a fix from our local tree which also fixes up the regression which we found with a different patch. -- pinskia at gcc dot gnu dot org changed: What|Removed |Added AssignedTo|unassigned at gcc dot gnu |pinskia at gcc dot gnu dot |dot org |org Status|NEW |ASSIGNED http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29589
[Bug rtl-optimization/29589] incorrect conversion of (ior (ashiftrt (plus ...))) in combine.c
--- Comment #4 from pinskia at gcc dot gnu dot org 2007-06-07 21:00 --- And here is a testcase which makes this reproduciable on the trunk (on powerpc-linux): extern void abort (void); extern void exit (int); _Bool a; int foo () { int b; int c = a; c = __builtin_abs(c); c = c-1; c = (c) 31; b = c | 60; return b; } int main(int argc, char **argv) { a = 1; if (foo() != 0x3c) abort(); exit(0); } -- pinskia at gcc dot gnu dot org changed: What|Removed |Added Status|UNCONFIRMED |NEW Ever Confirmed|0 |1 GCC target triplet||powerpc-*-* Keywords||wrong-code Last reconfirmed|-00-00 00:00:00 |2007-06-07 21:00:43 date|| http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29589
[Bug rtl-optimization/29589] incorrect conversion of (ior (ashiftrt (plus ...))) in combine.c
--- Comment #1 from dje at transmeta dot com 2006-10-25 02:23 --- Re: We think may be what wanted is: ... That's just off the cuff speculation. The curious things are: - op1 is shifted outside the mode of the operation (0x3c 31) (HOST_WIDE_INT is 64 bits) and this value is the value AND'd with the result of nonzero_bits. - nonzero_bits returns bits that may be one, not bits that are one, so it's not clear this optimization is valid regardless of anything else -- dje at transmeta dot com changed: What|Removed |Added Summary|incorrect conversion of (ior|incorrect conversion of (ior |(ashiftrt (plus ...))) in |(ashiftrt (plus ...))) in |combine.c |combine.c http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29589
[Bug rtl-optimization/29589] incorrect conversion of (ior (ashiftrt (plus ...))) in combine.c
--- Comment #2 from dje at transmeta dot com 2006-10-25 02:41 --- Thinking about it some more, disregard this (I think): - nonzero_bits returns bits that may be one, not bits that are one, so it's not clear this optimization is valid regardless of anything else I _think_ this is the culprit, though it's not worded very well: - op1 is shifted outside the mode of the operation (0x3c 31) (HOST_WIDE_INT is 64 bits) and this value is the value AND'd with the result of nonzero_bits. I think that's what you want, but We do this by seeing if OP1 can be safely shifted left C bits doesn't take into account the mode of the operation. Just guessing though. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29589
[Bug rtl-optimization/29589] incorrect conversion of (ior (ashiftrt (plus ...))) in combine.c
--- Comment #3 from pinskia at gcc dot gnu dot org 2006-10-25 03:07 --- Revision 1.169 / (download) - annotate - [select for diffs] , Fri May 6 16:42:40 1994 UTC (12 years, 5 months ago) by kenner Branch: MAIN Changes since 1.168: +123 -91 lines Diff to previous 1.168 (colored) (simplify_rtx, case MULT): Don't convert MULT to shift here. (simplify_logical, case IOR): Convert back to PLUS if valid and it will combine with another PLUS. (extract_left_shift): New function. (make_compound_operation, case ASHIFTRT): Simplify by calling it. (force_to_mode): Don't ignore if X is a SUBREG. (force_to_mode, case AND): Try to turn unchecked bits on instead of just off and see which is cheaper. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29589