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 c/80852] Optimisation fails to recognise sum computed by loop


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

--- Comment #2 from Raphael C <drraph at gmail dot com> ---
You are quite right. This code shows the same issue:

int foo(int num) {
    int a = 0;
    for (int x = 0; x < num; x+=2) {
        a += x;
   }
    return a;
  }

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