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

            Bug ID: 125896
           Summary: load common does not support non-only MEM_REF-refences
           Product: gcc
           Version: 17.0
            Status: UNCONFIRMED
          Keywords: missed-optimization
          Severity: enhancement
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: pinskia at gcc dot gnu.org
  Target Milestone: ---

Take:
```
struct s1
{
  bool t;
};

bool f(struct s1 *a, struct s1 *c, bool b)
{
  bool t;
  if (b)
    t = a->t;
  else
    t = c->t;
  return t;
}

```

My current load patches don't support references around MEM_REF:
```
  <bb 2> [local count: 1073741824]:
  if (b_2(D) != 0)
    goto <bb 3>; [50.00%]
  else
    goto <bb 4>; [50.00%]

  <bb 3> [local count: 536870912]:
  t_7 = a_6(D)->t;
  goto <bb 5>; [100.00%]

  <bb 4> [local count: 536870912]:
  t_5 = c_4(D)->t;

  <bb 5> [local count: 1073741824]:
  # t_1 = PHI <t_7(3), t_5(4)>

```

Reply via email to