Testsuites in gcc override LD_LIBRARY_PATH by using the global ld_library_path, which causes LD_LIBRARY_PATH to be set as $ld_library_path, and/or setting it directly.
A patch is posted at http://gcc.gnu.org/ml/gcc-patches/2004-09/msg01446.html
An updated patch is at http://gcc.gnu.org/ml/gcc-patches/2004-09/msg01626.html
Confirmed.
*** Bug 18526 has been marked as a duplicate of this bug. ***
This is a bit confused. The bug reported here is not the same as the bug reported in PR 18526. It appears that HJ linked them together because he had a single patch that fixes both bugs, even though the patch description says it only fixes one bug. It really fixes two different problems. The first bug, the one reported in this PR, was fixed here http://gcc.gnu.org/ml/gcc-patches/2004-11/msg01538.html The second bug, the one reported in PR 18526, was fixed here http://gcc.gnu.org/ml/gcc-patches/2005-03/msg02335.html I believe both bugs, this one and PR 18526, are now fixed. I have made no effort to confirm this.
Since this bug isn't considered serious, I just make sure that all my gcc system libraries used by "make check" in gcc are current. I will close it.