[Bug middle-end/23294] fold does not fold a*C+a to a*(C+1) or a*C-a to a*(C-1)
--- Comment #7 from rguenth at gcc dot gnu dot org 2005-11-19 11:29 --- Subject: Bug 23294 Author: rguenth Date: Sat Nov 19 11:29:10 2005 New Revision: 107218 URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=107218 Log: 2005-11-19 Richard Guenther [EMAIL PROTECTED] PR middle-end/23294 * fold-const.c (fold_plusminus_mult_expr): New function. (fold_binary): Use to canonicalize PLUS_EXPR and MINUS_EXPR cases, remove now unnecessary code. * gcc.dg/tree-ssa/pr23294.c: New testcase. Added: trunk/gcc/testsuite/gcc.dg/tree-ssa/pr23294.c Modified: trunk/gcc/ChangeLog trunk/gcc/fold-const.c trunk/gcc/testsuite/ChangeLog -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23294
[Bug middle-end/23294] fold does not fold a*C+a to a*(C+1) or a*C-a to a*(C-1)
--- Comment #8 from rguenth at gcc dot gnu dot org 2005-11-19 11:31 --- Fixed. -- rguenth at gcc dot gnu dot org changed: What|Removed |Added Status|ASSIGNED|RESOLVED Resolution||FIXED Target Milestone|--- |4.2.0 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23294
[Bug middle-end/23294] fold does not fold a*C+a to a*(C+1) or a*C-a to a*(C-1)
--- Additional Comments From rguenth at gcc dot gnu dot org 2005-08-26 09:34 --- I have a patch. -- What|Removed |Added AssignedTo|unassigned at gcc dot gnu |rguenth at gcc dot gnu dot |dot org |org Status|NEW |ASSIGNED Last reconfirmed|2005-08-10 00:49:31 |2005-08-26 09:34:08 date|| http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23294
[Bug middle-end/23294] fold does not fold a*C+a to a*(C+1) or a*C-a to a*(C-1)
--- Additional Comments From rguenth at gcc dot gnu dot org 2005-08-26 13:50 --- Patch posted. -- What|Removed |Added URL||http://gcc.gnu.org/ml/gcc- ||patches/2005- ||08/msg01555.html http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23294
[Bug middle-end/23294] fold does not fold a*C+a to a*(C+1) or a*C-a to a*(C-1)
--- Additional Comments From rguenth at gcc dot gnu dot org 2005-08-10 09:23 --- I believe we can only do so for -fwrapv (but we don't) or for unsigned (which we also don't do). I may look at this somewhen in the future. We also don't canonicalize int f(int a) { return a + a + a; } which I believe we did at some time? -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23294
[Bug middle-end/23294] fold does not fold a*C+a to a*(C+1) or a*C-a to a*(C-1)
--- Additional Comments From pinskia at gcc dot gnu dot org 2005-08-10 10:26 --- (In reply to comment #3) I believe we can only do so for -fwrapv (but we don't) or for unsigned (which we also don't do). I may look at this somewhen in the future. Why do you believe that with -fno-wrapv, overflow is undefined so anything can happen. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23294
[Bug middle-end/23294] fold does not fold a*C+a to a*(C+1) or a*C-a to a*(C-1)
--- Additional Comments From pinskia at gcc dot gnu dot org 2005-08-10 00:49 --- Confirmed. a*C+a is also not simplified. -- What|Removed |Added Status|UNCONFIRMED |NEW Ever Confirmed||1 Last reconfirmed|-00-00 00:00:00 |2005-08-10 00:49:31 date|| Summary|fold does not fold a*2-a to |fold does not fold a*C+a to |a |a*(C+1) or a*C-a to a*(C-1) http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23294