https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99696
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Ever confirmed|0 |1
Known to fail| |10.2.1, 11.0, 7.5.0
Status|UNCONFIRMED |NEW
Version|unknown |10.2.1
Last reconfirmed| |2021-03-22
Component|middle-end |ipa
CC| |hubicka at gcc dot gnu.org,
| |marxin at gcc dot gnu.org,
| |rguenth at gcc dot gnu.org
--- Comment #2 from Richard Biener <rguenth at gcc dot gnu.org> ---
Confirmed. Honza, can you please have a look?
The cgraph dump shows:
x/5 (x) @0x7ffff637b180
Type: variable definition analyzed
Visibility: prevailing_def_ironly
References:
Referring: y/6 (alias) init/7 (write)
Read from file: ./a.ltrans0.o
Availability: available
Varpool flags:
y/6 (y) @0x7ffff637b080
Type: variable definition analyzed alias
Visibility: prevailing_def_ironly
References: x/5 (alias)
Referring: main/0 (read)
Read from file: ./a.ltrans0.o
Availability: available
Varpool flags: read-only const-value-known
so indeed somehow the read-only flag is "miscomputed".
OTOH I remember that we chose to "ignore" mismatches in constness for aliases
and thus simply declare this use unsupported (there have been related
bugreports IIRC around const / non-const mixing in aliases).
Note we do not have ODR warnings for y vs. x though.