Commit 4fbe8f4
committed
cse: Check volatile memory in cselib_redundant_set_p
For h8300-elf, gcc.dg/pr114768.c fails when compiled with -O2 -msx since
cselib_redundant_set_p returns true when called with
(gdb) call debug (set)
(set (mem:HI (reg/f:SI 0 r0 [orig:21 p ] [21]) [1 *p_3(D)+0 S2 A16])
(mem/v:HI (reg/f:SI 0 r0 [orig:21 p ] [21]) [1 MEM[(volatile int *)p_3(D)]+0 S2 A16]))
(gdb)
from reload_cse_regs. Update cselib_redundant_set_p to return false for
volatile memory source or destination.
gcc/
PR target/122343
* cselib.cc (cselib_redundant_set_p): Return false for volatile
memory source or destination.
gcc/testsuite/
PR target/122343
* gcc.dg/pr122343-1.c: New test.
Signed-off-by: H.J. Lu <[email protected]>1 parent 278eb0a commit 4fbe8f4
2 files changed
+15
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1194 | 1194 | | |
1195 | 1195 | | |
1196 | 1196 | | |
1197 | | - | |
| 1197 | + | |
| 1198 | + | |
| 1199 | + | |
1198 | 1200 | | |
1199 | 1201 | | |
1200 | 1202 | | |
| |||
1205 | 1207 | | |
1206 | 1208 | | |
1207 | 1209 | | |
| 1210 | + | |
| 1211 | + | |
| 1212 | + | |
1208 | 1213 | | |
1209 | 1214 | | |
1210 | 1215 | | |
| |||
1242 | 1247 | | |
1243 | 1248 | | |
1244 | 1249 | | |
1245 | | - | |
1246 | 1250 | | |
1247 | 1251 | | |
1248 | 1252 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
0 commit comments