This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: Does weak work on PPC with -O2?
Franz Sirl <Franz.Sirl-kernel@lauterbach.com> writes:
> Well, contrary to my first believe the fix might be really simple,
> AFAICS the relevant piece of code is in make_decl_rtl in varasm.c,
> or? If we set the RTX VOLATILE flag (which is so far unused for
> SYMBOL_REF) for DECL_WEAK symbols, we should be set. Then we can
> just test SYMBOL_REF_WEAK at the relevant places (there are some
> places where some less important optimizations are explicitly
> disabled because of the weak symbol problem) and be happy. Or are
> there any pitfalls in this simple plan? There must be, or why wasn't
> it fixed til now?
Hey, that's really clever. I didn't think of using VOLATILE. It
even makes sense...
> Naturally the same has to be done for weak LABEL_REF's, too.
It's not clear to me how a LABEL_REF can meaningfully be weak.
Doesn't it always have to be defined in the same procedure?
--
- Geoffrey Keating <geoffk@geoffk.org>