public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/67815] Optimize const1 * copysign (const2, y) into copysign (const1 * const2, y) if const1 > 0 or -copysign (const1 * const2, y) if const1 < 0
       [not found] <bug-67815-4@http.gcc.gnu.org/bugzilla/>
@ 2015-10-02 10:12 ` mpolacek at gcc dot gnu.org
  2015-10-02 10:29 ` mpolacek at gcc dot gnu.org
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 7+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2015-10-02 10:12 UTC (permalink / raw)
  To: gcc-bugs

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

Marek Polacek <mpolacek at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |mpolacek at gcc dot gnu.org

--- Comment #1 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
A reminder: think about what to do with 0.0 * copysign (cst, x) and -0.0 *
copysign (cst, x).


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug tree-optimization/67815] Optimize const1 * copysign (const2, y) into copysign (const1 * const2, y) if const1 > 0 or -copysign (const1 * const2, y) if const1 < 0
       [not found] <bug-67815-4@http.gcc.gnu.org/bugzilla/>
  2015-10-02 10:12 ` [Bug tree-optimization/67815] Optimize const1 * copysign (const2, y) into copysign (const1 * const2, y) if const1 > 0 or -copysign (const1 * const2, y) if const1 < 0 mpolacek at gcc dot gnu.org
@ 2015-10-02 10:29 ` mpolacek at gcc dot gnu.org
  2015-10-02 15:29 ` joseph at codesourcery dot com
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 7+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2015-10-02 10:29 UTC (permalink / raw)
  To: gcc-bugs

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

Marek Polacek <mpolacek at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |ASSIGNED
   Last reconfirmed|                            |2015-10-02
           Assignee|unassigned at gcc dot gnu.org      |mpolacek at gcc dot gnu.org
   Target Milestone|---                         |6.0
     Ever confirmed|0                           |1

--- Comment #2 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
Let me have a look then.


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug tree-optimization/67815] Optimize const1 * copysign (const2, y) into copysign (const1 * const2, y) if const1 > 0 or -copysign (const1 * const2, y) if const1 < 0
       [not found] <bug-67815-4@http.gcc.gnu.org/bugzilla/>
  2015-10-02 10:12 ` [Bug tree-optimization/67815] Optimize const1 * copysign (const2, y) into copysign (const1 * const2, y) if const1 > 0 or -copysign (const1 * const2, y) if const1 < 0 mpolacek at gcc dot gnu.org
  2015-10-02 10:29 ` mpolacek at gcc dot gnu.org
@ 2015-10-02 15:29 ` joseph at codesourcery dot com
  2015-10-12 17:42 ` mpolacek at gcc dot gnu.org
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 7+ messages in thread
From: joseph at codesourcery dot com @ 2015-10-02 15:29 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from joseph at codesourcery dot com <joseph at codesourcery dot com> ---
Note that this should only be applied when the multiplication of the two 
constants can be folded to a single constant (thus, not for 
-frounding-math - HONOR_SIGN_DEPENDENT_ROUNDING - if the multiplication is 
inexact).


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug tree-optimization/67815] Optimize const1 * copysign (const2, y) into copysign (const1 * const2, y) if const1 > 0 or -copysign (const1 * const2, y) if const1 < 0
       [not found] <bug-67815-4@http.gcc.gnu.org/bugzilla/>
                   ` (2 preceding siblings ...)
  2015-10-02 15:29 ` joseph at codesourcery dot com
@ 2015-10-12 17:42 ` mpolacek at gcc dot gnu.org
  2015-10-12 17:56 ` jakub at gcc dot gnu.org
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 7+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2015-10-12 17:42 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
Created attachment 36487
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=36487&action=edit
r2

Untested preliminary patch.  I'm not sure about the floating-point matter in
there.


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug tree-optimization/67815] Optimize const1 * copysign (const2, y) into copysign (const1 * const2, y) if const1 > 0 or -copysign (const1 * const2, y) if const1 < 0
       [not found] <bug-67815-4@http.gcc.gnu.org/bugzilla/>
                   ` (3 preceding siblings ...)
  2015-10-12 17:42 ` mpolacek at gcc dot gnu.org
@ 2015-10-12 17:56 ` jakub at gcc dot gnu.org
  2015-10-14 12:54 ` mpolacek at gcc dot gnu.org
  2015-10-14 12:55 ` mpolacek at gcc dot gnu.org
  6 siblings, 0 replies; 7+ messages in thread
From: jakub at gcc dot gnu.org @ 2015-10-12 17:56 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Comment on attachment 36487
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=36487
r2

I think for copysign we don't want/need the first_pass_instance guard, and
likely also not flag_unsafe_math_optimizations, we want only be able to
reassociate, which can_reassociate_p should already guarantee, and then what
Joseph talked about for inexact.


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug tree-optimization/67815] Optimize const1 * copysign (const2, y) into copysign (const1 * const2, y) if const1 > 0 or -copysign (const1 * const2, y) if const1 < 0
       [not found] <bug-67815-4@http.gcc.gnu.org/bugzilla/>
                   ` (4 preceding siblings ...)
  2015-10-12 17:56 ` jakub at gcc dot gnu.org
@ 2015-10-14 12:54 ` mpolacek at gcc dot gnu.org
  2015-10-14 12:55 ` mpolacek at gcc dot gnu.org
  6 siblings, 0 replies; 7+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2015-10-14 12:54 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #6 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
Author: mpolacek
Date: Wed Oct 14 12:54:03 2015
New Revision: 228809

URL: https://gcc.gnu.org/viewcvs?rev=228809&root=gcc&view=rev
Log:
        PR tree-optimization/67815
        * tree-ssa-reassoc.c (attempt_builtin_copysign): New function.
        (reassociate_bb): Call it.

        * gcc.dg/tree-ssa/reassoc-39.c: New test.
        * gcc.dg/tree-ssa/reassoc-40.c: New test.
        * gcc.dg/tree-ssa/reassoc-41.c: New test.

Added:
    trunk/gcc/testsuite/gcc.dg/tree-ssa/reassoc-39.c
    trunk/gcc/testsuite/gcc.dg/tree-ssa/reassoc-40.c
    trunk/gcc/testsuite/gcc.dg/tree-ssa/reassoc-41.c
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/tree-ssa-reassoc.c


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug tree-optimization/67815] Optimize const1 * copysign (const2, y) into copysign (const1 * const2, y) if const1 > 0 or -copysign (const1 * const2, y) if const1 < 0
       [not found] <bug-67815-4@http.gcc.gnu.org/bugzilla/>
                   ` (5 preceding siblings ...)
  2015-10-14 12:54 ` mpolacek at gcc dot gnu.org
@ 2015-10-14 12:55 ` mpolacek at gcc dot gnu.org
  6 siblings, 0 replies; 7+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2015-10-14 12:55 UTC (permalink / raw)
  To: gcc-bugs

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

Marek Polacek <mpolacek at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|---                         |FIXED

--- Comment #7 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
Done for GCC 6.


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2015-10-14 12:55 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-67815-4@http.gcc.gnu.org/bugzilla/>
2015-10-02 10:12 ` [Bug tree-optimization/67815] Optimize const1 * copysign (const2, y) into copysign (const1 * const2, y) if const1 > 0 or -copysign (const1 * const2, y) if const1 < 0 mpolacek at gcc dot gnu.org
2015-10-02 10:29 ` mpolacek at gcc dot gnu.org
2015-10-02 15:29 ` joseph at codesourcery dot com
2015-10-12 17:42 ` mpolacek at gcc dot gnu.org
2015-10-12 17:56 ` jakub at gcc dot gnu.org
2015-10-14 12:54 ` mpolacek at gcc dot gnu.org
2015-10-14 12:55 ` mpolacek at gcc dot gnu.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).