This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug tree-optimization/17686] New: sincos can be folded at the tree level


If a sincos instruction is defined, it is profitable to introduce these foldings:

  sincos (x, &s, &c);
  sincos (-x, &s, &c);

to

  (*c = cos (x), *s = sin (x))
  (*c = cos (x), *s = -sin (x))

respectively.  This allows the sincos instruction to be used; the second folding
is necessary to avoid that the cos (x) = cos (-x) optimization kicks in, leaving
us with an unoptimizable

  (*c = cos (x), *s = sin (-x))

This patch is proposed for 4.1 through the 17652 metabug.

-- 
           Summary: sincos can be folded at the tree level
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Keywords: missed-optimization
          Severity: enhancement
          Priority: P3
         Component: tree-optimization
        AssignedTo: bonzini at gcc dot gnu dot org
        ReportedBy: bonzini at gcc dot gnu dot org
                CC: gcc-bugs at gcc dot gnu dot org,uros at kss-loka dot si


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17686


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]