This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Miscompilation of glibc with CVS mainline


John David Anglin wrote:
> I can't seem to find where the standard says &weak_func is always
> unequal to null.

Of course you cannot.  Weak functions are nothing ISO C defines.  They
are not even a universally available features which are available on all
platforms which gcc provides.


The problem here is that somebody thought s/he can be very clever and
add one more optimization without knowing the history of gcc.  We had
problems with exactly this situation several times over the last years
and always it has been the case that gcc was adjusted to *not* remove
the test.  Some documentation of this behavior was even added, somewhere.

If you think about when the "optimization" can be used, it is very
questionable at best whether it's useful.  Why would anybody add a test
for a function reference being NULL without the possibility of this
being the case?  For this reason and the history of code like this gcc
should never remove the tests and the old behavior should be restored.

-- 
--------------.                        ,-.            444 Castro Street
Ulrich Drepper \    ,-----------------'   \ Mountain View, CA 94041 USA
Red Hat         `--' drepper at redhat.com `---------------------------


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]