https://gcc.gnu.org/bugzilla/show_bug.cgi?id=124099
Bug ID: 124099
Summary: [16 Regression] emutls not handling replacement in
returns correctly happens since r16-7504
Product: gcc
Version: 16.0
Status: UNCONFIRMED
Keywords: ice-on-valid-code
Severity: normal
Priority: P3
Component: tree-optimization
Assignee: pinskia at gcc dot gnu.org
Reporter: pinskia at gcc dot gnu.org
Target Milestone: ---
Testcase:
```
struct s1 { int t[2];};
__thread struct s1 t;
struct s1 g()
{
return t;
}
```
GCC output:
```
[00:23] <iains> $ ./gcc/xgcc -Bgcc t.c -S -O2
[00:23] <iains> t.c: In function 'g':
[00:23] <iains> t.c:1:54: error: invalid operand in return statement
[00:23] <iains> 1 | struct s1 { int t[2];}; __thread struct s1 t; struct s1
g() { return t; }
[00:23] <iains> | ^~
[00:23] <iains> *_2;
[00:23] <iains> # VUSE <.MEM_1(D)>
[00:23] <iains> return *_2;
[00:23] <iains> during IPA pass: emutls
[00:23] <iains> t.c:1:54: internal compiler error: verify_gimple failed
```
Snce r16-7504-gb960a57e1b0039