[Bug tree-optimization/89505] [9 Regression] LibreOffice miscompilation starting with r260383
jakub at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Tue Feb 26 10:25:00 GMT 2019
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89505
--- Comment #1 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
I think the problem is mainly:
MEM[(struct ScXMLTableColContext *)this_29(D) clique 1 base 1].nColCount =
_15;
vs.
_15 = MEM[(const int &)_116 clique 1 base 0];
Both have the same clique, but different base.
std::min<sal_Int32>(nColCount, MAXCOLCOUNT)
returns a reference, and I bet if this argument was explicitly __restrict, that
would be invalid, referencing *this through some other pointer (reference in
this case). this argument is not restrict though, and it can alias
references/pointers within the constructor, e.g.
struct S { int s; S (S &, S *); };
S *foo (S *);
S::S (S &x, S *y)
{
// x.s can't alias this->s
// y->s can't alias this->s
S *p = foo (this);
// p->s can alias this->s
}
More information about the Gcc-bugs
mailing list