Well, I spent some fun time on this over the weekend ...
I now have it narrowed down to a file, and I'm becoming more convinced it *is* a
compiler
bug.
1) compiling tabular.C w/o -O "fixes" the problem
2) in tabular.C::operator=, line 121 :
121 cell_info = lt.cell_info;
In the context of ::Clone, we eventually call this function. At this point we have
constructed
the vector<vector> of cellstructs, with empty InsetTexts. Now, this line should have
the effect
of calling operator= on every InsetText, to set each one to be like each one in
lt.cell_info.
And this is what happens when -O is OFF. Turning it ON, however, and something
*really* weird
happens. Instead of op= being called on InsetText, the d-tor is being called instead,
(and that's
it).
This eventually leads to a crash when we are doing the (theoretically unnecessary)
op='s
on each InsetText child in ::Clone().
3) Uncommenting this line fixes the problem !!!
4) The reason we are seeing this now rather than before is that InsetText has changed
size,
with mutable int last_drawn_width added. Try removing the (unused) interline_space
member
and the the problem will go away.
5) I spent some little time trying -fno-inline, -fno-elide-constructors, etc. etc. to
see if it
would go away. None of it worked
6) I even had a look at the assembly diff for -O vs. non -O. I couldn't see any
obvious errors.
Since the line is un-necessary, we could "fix" this by not doing it in the Clone()
case. But of
course that isn't a proper fix (and we have a duty to tell gcc if it's reproducable
with current
gcc CVS ...)
I'm really stuck now at what to do, I have no idea ...
Anyone ?
thanks
john
--
"'And the people you sell the eggs to at four and a quarter cents apiece make
a profit of two and three quarter cents apiece when they sell them back to
you at seven cents apiece. Is that right ? Why don't you sell the eggs directly
to you and eliminate the people you buy them from ?'
'Because I'm the people I buy them from,' Milo explained."
- Catch 22