This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: disturbing g++ 971031 results. defer-pop to blame?
> Real strange since I've actually looked in the log files when I've
> done H8 testing and everything seems to be in order... Got to
> be something simple/stupid we're missing.
Probably. I'll investigate that next.
> > Now is when I notice that GDB is not playing nice with EGCS ELF output.
> > When it rains...
> Sigh. More likely it's not playing nice with dwarf2 more so than
> ELF.
Yes, and '-gdwarf1' results in unresolved externals. Sigh. I'm
investigating that right now.
Let's focus on this problem right now:
> > > > If I add '-defer-pop' to most of the cases I've tried by hand, it
> > > > seems to work. In fact, I just wrote a script to loop through thos
> > I meant "-fdefer-pop". -fno-defer-pop (the default) still shows the
> > problem.
> Hmmm, -fdefer-pop is the default; the compiler will arrange for
> -fno-defer-pop to be on inside EH regions and such. Real strange.
Actually, it's only the default if we're optimizing, right? That's
what I'm led to believe from 'gcc -S' output. That's actually
consistent with some more tests that I just ran.
Perhaps we need to make the c++ tests run with varying -O levels
as we do for the gcc tests. After all, what's another few hours
during the build? :-)
Here's what I'm seeing. negcs is just a script that calls the native
egcs:
G=/play/negcs
L=${G}/libraries
exec ${G}/gcc/xgcc -B${G}/gcc/ \
-I${L}/libio/ \
-I${L}/libstdc++/ \
"$@"
$ ./negcs /tmp/net34.C -lstdc++ && ./a.out
bar_1::k -> 1
bar_2::k -> 2
bar_1::get_k() -> 1
bar_2::get_k() -> 2
Memory fault(coredump)
(robertl) rjlhome:/play/testgcc
$ ./negcs -O0 /tmp/net34.C -lstdc++ && ./a.out
bar_1::k -> 1
bar_2::k -> 2
bar_1::get_k() -> 1
bar_2::get_k() -> 2
Memory fault(coredump)
(robertl) rjlhome:/play/testgcc
$ ./negcs -O1 /tmp/net34.C -lstdc++ && ./a.out
bar_1::k -> 1
bar_2::k -> 2
bar_1::get_k() -> 1
bar_2::get_k() -> 2
(robertl) rjlhome:/play/testgcc
$ ./negcs -O2 /tmp/net34.C -lstdc++ && ./a.out
bar_1::k -> 1
bar_2::k -> 2
bar_1::get_k() -> 1
bar_2::get_k() -> 2
(robertl) rjlhome:/play/testgcc
$ ./negcs -O3 /tmp/net34.C -lstdc++ && ./a.out
bar_1::k -> 1
bar_2::k -> 2
bar_1::get_k() -> 1
bar_2::get_k() -> 2
$
Perhaps something is doing something bad on the stack and defer-pop
is just circumventing it.
RJL