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/78194] New: Failure to optimize squaring


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

            Bug ID: 78194
           Summary: Failure to optimize squaring
           Product: gcc
           Version: 7.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: jakub at gcc dot gnu.org
  Target Milestone: ---

int square(int x) {
  int result = 0;
  for (int i = 0; i < x; ++i)
    result += x;
  return result;
}
is not optimized into return x * x; while llvm can do that.

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