https://gcc.gnu.org/bugzilla/show_bug.cgi?id=123541
Bug ID: 123541
Summary: Load merging missing
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: 94094
Target Milestone: ---
Take:
```
unsigned int f(unsigned char *a)
{
unsigned short *b = (unsigned short*)a;
return (*b<<8) | a[1];
}
```
We should only get one load but currently there are 2.
This testcase is reduced from store_merging_18.c after a match patch.
Referenced Bugs:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94094
[Bug 94094] [meta-bug] store-merging and/or bswap load/store-merging missed
optimizations