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

            Bug ID: 121751
           Summary: missing copy prop if the field is a full store
           Product: gcc
           Version: 16.0
            Status: UNCONFIRMED
          Keywords: missed-optimization
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: pinskia at gcc dot gnu.org
          Reporter: pinskia at gcc dot gnu.org
            Blocks: 110035, 121364
  Target Milestone: ---

Take:
```
struct s1
{
  int t[1024];
};

struct s2 {
  struct s1 t;
};

struct s3
{
  struct s2 t;
};

void g(struct s3*);

void f(struct s1 s)
{
  struct s2 t;
  t.t = s;
  struct s3 t1;
  t1.t = t;
  g(&t1);
}
```

There should be only one memcpy but currently there are 2.


Referenced Bugs:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110035
[Bug 110035] Missed optimization for dependent assignment statements
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=121364
[Bug 121364] [meta-bug] copy prop for aggregates

Reply via email to