From mboxrd@z Thu Jan 1 00:00:00 1970 From: Robert Lipe To: "H.J. Lu" Cc: gas2@cygnus.com Subject: Re: pushl computed immediate address on 2.8.1 Date: Fri, 09 Jan 1998 23:02:00 -0000 Message-id: <19980110010126.03024@dgii.com> References: <19980102144041.15293@dgii.com> X-SW-Source: 1998/msg00006.html Re: Test case containing cryptic assembler to exercise a GAS problem. > > // This is the aproach that works, and is what GCC should emit. > > // registers > > leal .LC0@GOTOFF(%ebx),%eax > > pushl %eax > > call printf@PLT > > > > // This what GCC does emit, but seems to be nonsensical. > > // assembler. > > pushl $.LC0@GOTOFF(%ebx) > > call printf@PLT > > > > Which gcc are you using? How did you get gcc to emit that? We have to try really hard. :-) I can see this behaviour specifically on EGCS 1.0.1 under g77 when targeted for i586-pc-sco3.2v5.0.4. It does not equate exactly to the test case that I submitted to the GAS2 list as I was trying to show an assembler problem, not the gcc problem. As an aside, Richard Henderson did take an interest just this morning in solving the gcc problem. See the thread at: http://www.cygnus.com/ml/egcs/1998-Jan/0208.html Looking at the example I gave more, I implied that this was from "hello world" compiled as PIC. This was wrong. I apologize. I grafted the failure from a f77 test case into a C hello world and didn't make that clear. I was focusing on the gas issue on this list and the gcc issues in the egcs list. In trying to simplify the gas test case, I obscured the actual case where gcc/egcs would emit this. You can see one real example of this failure by running g77 with -fPIC and -O3: $ g77 -O3 -fPIC /play/egcs/gcc/testsuite/g77.f-torture/execute/short.f -o /tm> /usr/tmp/cca003D7.s:136:syntax error at ( /usr/tmp/cca003D7.s:151:syntax error at ( /usr/tmp/cca003D7.s:162:syntax error at ( /usr/tmp/cca003D7.s:173:syntax error at ( (robertl) rjlhome:/play/egcs/gcc/testsuite/g77.f-torture/execute $ g77 --version egcs-2.90.23 980102 (egcs-1.0.1 release) The lines it wails about are of the form: pushl $.LC4@GOTOFF(%ebx) The assembler in the case above is not GAS. It's the OpenServer 5.0.4 assembler. GAS should complain about this as well. Does EGCS 1.0.1 for GNU/Linux for x86 really emit something different, or did you get tripped up in my obscurity in the test case? If so, I'm sorry to have wasted your time. -- Robert Lipe http://www.dgii.com/people/robertl robertl@dgii.com