This is the mail archive of the gcc-bugs@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]

use of register keyword gives undefined reference to `LC0'


[This was originally posted on the cygwin mailing list - I was asked to
post it to gcc-bugs]

On the 'cygwin' platform, using the -g flag to gcc results in the following
program compiling but failing to link. The error message is

gcc -g test.c
/cygdrive/c/TEMP/ccJVVXiI.o(.stab+0x1c4): In function `test':
/support/crbrb.c:11: undefined reference to `LC0'
collect2: ld returned 1 exit status

Contents of test.c is

int main(){
    return 0;
}
void test(double *b)
{
    register double a = 0.0;
    int k;
    for (k = 0; k < 1; k++) {
        *b = a;
    }
}


Removing the 'register' keywork or switching off the debug option 'fixes'
the problem. This bug seems platform specific  eg gcc 3.2 on [intel] linux
works ok.

Version Information:
gcc -v
Reading specs from /bin/../lib/gcc-lib/i686-pc-cygwin/3.2/specs
Configured with: /netrel/src/gcc-3.2-3/configure
--enable-languages=c,c++,f77,java --enable-libgcj --enable-threads=posix
--with-system-zlib --enable-nls --without-included-gettext
--enable-interpreter --disable-sjlj-exceptions
--disable-version-specific-runtime-libs --enable-shared
--build=i686-pc-linux --host=i686-pc-cygwin --target=i686-pc-cygwin
--enable-haifa --prefix=/usr --exec-prefix=/usr --sysconfdir=/etc
--libdir=/usr/lib --includedir=/nonexistent/include --libexecdir=/usr/sbin
Thread model: posix
gcc version 3.2 20020927 (prerelease)


Mark.



This communication is for informational purposes only.  It is not intended as
an offer or solicitation for the purchase or sale of any financial instrument
or as an official confirmation of any transaction. All market prices, data
and other information are not warranted as to completeness or accuracy and
are subject to change without notice. Any comments or statements made herein
do not necessarily reflect those of J.P. Morgan Chase & Co., its
subsidiaries and affiliates.


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