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

            Bug ID: 122250
           Summary: Missing LIM
           Product: gcc
           Version: 16.0
            Status: UNCONFIRMED
          Keywords: missed-optimization
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: pinskia at gcc dot gnu.org
            Blocks: 122219
  Target Milestone: ---

Take the C++ code:
```
struct s1
{
  int tl;
  int t2;
  int t3[1022] = {}; // Here to force not doing SRA
};

void f(struct s1 &a, int n)
{
  int f1 = 1;
  int f2 = 2;
  for (int i = 0; i < n; i++)
  {
    f1 = f1 + f1;
    f2 = f2 + f2;
    struct s1 b = {f1, f2};
    a = b;
  }
}
```

We should be move the store to *a out of the loop but currently don't even with
-fstack-reuse=none.


Referenced Bugs:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=122219
[Bug 122219] Missed store sinking when using memcpy with vector_size type in
inlined functions

Reply via email to