https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63798

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |missed-optimization
             Status|UNCONFIRMED                 |ASSIGNED
   Last reconfirmed|                            |2014-11-10
                 CC|rguenther at suse dot de           |rguenth at gcc dot 
gnu.org
           Assignee|unassigned at gcc dot gnu.org      |rguenth at gcc dot 
gnu.org
   Target Milestone|---                         |5.0
     Ever confirmed|0                           |1

--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> ---
There are four fneg instructions present still with r217281.  I suppose

        fneg 0,10
        fmadd 0,11,0,12
...
        fneg 0,10
        fmsub 0,11,0,12
...
        fneg 12,12
        fmadds 0,11,12,0
...
        fneg 0,0
        fmsubs 0,12,0,11

should have been combined with the following instruction.

I don't see anything wrong here but eventually that

  _65 = -_64;
  _67 = _63 * _65 + _62;

has canonicalized operand order so that the negate is not always the
first operand of the embedded multiply?

>From expr.c:

        def0 = get_def_for_expr (treeop0, NEGATE_EXPR);
        def2 = get_def_for_expr (treeop2, NEGATE_EXPR);
...

indeed it doesn't consider the multiply is commutative.

I have a patch.

Reply via email to