public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* Re: Miscompilation of glibc with CVS mainline
@ 2003-01-04 18:54 Robert Dewar
  0 siblings, 0 replies; 27+ messages in thread
From: Robert Dewar @ 2003-01-04 18:54 UTC (permalink / raw)
  To: drepper, rth; +Cc: aj, dave, gcc, jakub, libc-alpha, martin

> Note that the *only* way to subvert this scheme is to use
> inline assembly to force the symbol weak behind gcc's back.
> All I can say here is "Don't Do That".

OK, that seems reasonable to me, and I withdraw my suggestion that a change
is required here :-)

^ permalink raw reply	[flat|nested] 27+ messages in thread
* Re: Miscompilation of glibc with CVS mainline
@ 2003-01-04 17:52 Robert Dewar
  0 siblings, 0 replies; 27+ messages in thread
From: Robert Dewar @ 2003-01-04 17:52 UTC (permalink / raw)
  To: dave, drepper; +Cc: aj, gcc, jakub, libc-alpha, martin

> 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.

One of the most important pieces of documentation is what you did not do
and why you did not do it :-)

In this case, when the optimization is removed (I agree it should be), then
in its place a comment saying why it is not done (perhaps even leaving the
undesirable code commented out) would be helpful to stop people doing this
again!

^ permalink raw reply	[flat|nested] 27+ messages in thread
[parent not found: <no.id>]
* Re: Miscompilation of glibc with CVS mainline
@ 2003-01-01 17:43 John David Anglin
  2003-01-02 13:18 ` Andreas Jaeger
  0 siblings, 1 reply; 27+ messages in thread
From: John David Anglin @ 2003-01-01 17:43 UTC (permalink / raw)
  To: gcc; +Cc: aj

> CPP='/opt/gcc/3.3-devel/bin/gcc -E -x c-header'  /builds/glibc/test-libc/elf/ld-linux.so.2 --library-path /builds/glibc/test-libc:/builds/glibc/test-libc/math:/builds/glibc/test-libc/elf:/builds/glibc/test-libc/dlfcn:/builds/glibc/test-libc/nss:/builds/glibc/test-libc/nis:/builds/glibc/test-libc/rt:/builds/glibc/test-libc/resolv:/builds/glibc/test-libc/crypt:/builds/glibc/test-libc/linuxthreads /builds/glibc/test-libc/sunrpc/rpcgen -Y ../scripts -c rpcsvc/bootparam_prot.x -o /builds/glibc/test-libc/sunrpc/xbootparam_prot.T
> make[2]: *** [/builds/glibc/test-libc/sunrpc/xbootparam_prot.stmp] Segmentation fault
> make[2]: Leaving directory `/cvs/libc/sunrpc'

I hit what appears to be the same error trying to build glibc-2.3.1 on
hppa-linux.  It's hard to debug because the segmentation fault occurs in
a shared library without any debug symbols.  In my particular case, it
seemed as if the code was trying to call an undefined weak (indirect
call to function at address 0x0).

Dave
-- 
J. David Anglin                                  dave.anglin@nrc.ca
National Research Council of Canada              (613) 990-0752 (FAX: 952-6605)

^ permalink raw reply	[flat|nested] 27+ messages in thread
* Miscompilation of glibc with CVS mainline
@ 2003-01-01 13:37 Andreas Jaeger
  0 siblings, 0 replies; 27+ messages in thread
From: Andreas Jaeger @ 2003-01-01 13:37 UTC (permalink / raw)
  To: gcc


GCC CVS mainline miscompiles glibc on i686-linux-gnu.  The actual
error I noticed is:
CPP='/opt/gcc/3.3-devel/bin/gcc -E -x c-header'  /builds/glibc/test-libc/elf/ld-linux.so.2 --library-path /builds/glibc/test-libc:/builds/glibc/test-libc/math:/builds/glibc/test-libc/elf:/builds/glibc/test-libc/dlfcn:/builds/glibc/test-libc/nss:/builds/glibc/test-libc/nis:/builds/glibc/test-libc/rt:/builds/glibc/test-libc/resolv:/builds/glibc/test-libc/crypt:/builds/glibc/test-libc/linuxthreads /builds/glibc/test-libc/sunrpc/rpcgen -Y ../scripts -c rpcsvc/bootparam_prot.x -o /builds/glibc/test-libc/sunrpc/xbootparam_prot.T
make[2]: *** [/builds/glibc/test-libc/sunrpc/xbootparam_prot.stmp] Segmentation fault
make[2]: Leaving directory `/cvs/libc/sunrpc'

To track down the failure, I used Janis' script and noticed that it
fails since the merge from the 3_4-basic-improvement branch.
Searching that branch I found this patch as beeing the problem:

+2002-10-07  Richard Henderson  <rth@redhat.com>
+
+       * cse.c (fixed_base_plus_p): Turn FIXED_BASE_PLUS_P into a
+       function; cleanup PLUS case by using recursion.  Update all users.
+       (NONZERO_BASE_PLUS_P): Remove.
+       (find_comparison_args): Use rtx_addr_can_trap_p instead.
+       (fold_rtx): Use nonzero_address_p.
+       * rtl.h (nonzero_address_p): Declare.
+       * rtlanal.c (rtx_varies_p): Handle ADDRESSOF.
+       (rtx_addr_can_trap_p): Likewise.
+       (nonzero_address_p): New.
+       * simplify-rtx.c (NONZERO_BASE_PLUS_P): Remove.
+       (simplify_relational_operation): Use nonzero_address_p.


I haven't been able to figure out which file in glibc is miscompiled
and therefore like to ask for an additional review of that patch
again.

Andreas
-- 
 Andreas Jaeger
  SuSE Labs aj@suse.de
   private aj@arthur.inka.de
    http://www.suse.de/~aj

^ permalink raw reply	[flat|nested] 27+ messages in thread

end of thread, other threads:[~2003-01-04 18:54 UTC | newest]

Thread overview: 27+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-01-04 18:54 Miscompilation of glibc with CVS mainline Robert Dewar
  -- strict thread matches above, loose matches on Subject: below --
2003-01-04 17:52 Robert Dewar
     [not found] <no.id>
2003-01-02 17:48 ` John David Anglin
2003-01-02 17:54   ` Jakub Jelinek
2003-01-02 18:58     ` John David Anglin
2003-01-02 17:57   ` Daniel Jacobowitz
2003-01-01 17:43 John David Anglin
2003-01-02 13:18 ` Andreas Jaeger
2003-01-02 13:27   ` Jakub Jelinek
2003-01-02 13:53     ` Andreas Jaeger
2003-01-02 14:41       ` Andreas Jaeger
2003-01-02 21:10         ` Andreas Jaeger
2003-01-02 17:38     ` John David Anglin
2003-01-02 17:48       ` "Martin v. Löwis"
2003-01-02 18:52         ` John David Anglin
2003-01-02 18:58           ` Paul Jarc
2003-01-02 19:10             ` Dale Johannesen
2003-01-02 19:16             ` John David Anglin
2003-01-02 19:26               ` Paul Jarc
2003-01-02 20:25                 ` Martin v. Löwis
2003-01-02 22:11               ` Richard Henderson
2003-01-03  1:02                 ` John David Anglin
2003-01-03  1:35                   ` Richard Henderson
2003-01-02 19:42           ` Ulrich Drepper
2003-01-02 22:16             ` Richard Henderson
2003-01-03  0:14             ` Fergus Henderson
2003-01-01 13:37 Andreas Jaeger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).