https://gcc.gnu.org/bugzilla/show_bug.cgi?id=123374
--- Comment #7 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
```
while (header_read < block.header_size)
{
ssize_t bytes_read = read (src, in_buf + header_read,
sizeof (in_buf) - header_read);
if (bytes_read < 0)
{
if ( (*__errno_location ()) == 4 )
continue;
throw libc_exception ( (*__errno_location ()) , "read");
}
if (bytes_read == 0)
throw reportable_exception ("truncated file");
header_read += bytes_read;
// if (header_read > sizeof(in_buf))
// __builtin_unreachable();
}
```
This is the loop which is messing up.
<bb 529> [local count: 73061770]:
# offset_1778 = PHI <offset_1703(510), offset_1703(528), 0(679)>
# size_1779 = PHI <size_1711(510), size_1711(528), size_1780(679)>
# header_read_1781 = PHI <0(510), header_read_1625(528),
header_read_1782(679)>
# need_log_extracting_1783 = PHI <need_log_extracting_1784(510),
need_log_extracting_1784(528), need_log_extracting_1785(679)>
# .MEM_2037 = PHI <.MEM_2369(510), .MEM_2369(528), .MEM_2619(679)>
<bb 530> [local count: 85516040]:
# offset_1703 = PHI <offset_1603(507), offset_1778(529)>
# size_1711 = PHI <seekable_size.550_36(507), size_1779(529)>
# header_read_1626 = PHI <0(507), header_read_1781(529)>
# need_log_extracting_1784 = PHI <need_log_extracting_1609(507),
need_log_extracting_1783(529)>
# .MEM_2038 = PHI <.MEM_2355(507), .MEM_2037(529)>
if (header_read_1626 == 0)
goto <bb 508>; [57.11%]
vs
<bb 523> [local count: 85516040]:
# offset_1696 = PHI <offset_1596(501), offset_1696(522), offset_1696(504),
0(668)>
# size_1704 = PHI <seekable_size.550_35(501), size_1704(522), size_1704(504),
size_1773(668)>
# header_read_1619 = PHI <0(501), header_read_1618(522), 0(504),
header_read_1775(668)>
# need_log_extracting_1777 = PHI <need_log_extracting_1602(501),
need_log_extracting_1777(522), need_log_extracting_1777(504),
need_log_extracting_1778(668)>
# .MEM_2030 = PHI <.MEM_2347(501), .MEM_2361(522), .MEM_2361(504),
.MEM_2611(668)>
if (header_read_1619 == 0)
goto <bb 502>; [57.11%]
1626.1[3]: _1626 = &in_buf + [1, 4096] (base0); size: 4096
waccess is just a mess ....