This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: Bug! when a function is the parameter of another function.
- To: pschen at puma dot cs dot nthu dot edu dot tw
- Subject: Re: Bug! when a function is the parameter of another function.
- From: "Martin v. Loewis" <martin at loewis dot home dot cs dot tu-berlin dot de>
- Date: Mon, 6 Mar 2000 10:15:07 +0100
- CC: gcc-bugs at gcc dot gnu dot org
- References: <NDBBLKOACKKKFPINNIPECEFBCBAA.pschen@puma.cs.nthu.edu.tw>
> Assume in m68k platform :
> My question is that if I want to produce a position-independent-code,
> the data is based on some register (ex:A5), function label is based on PC.
> GCC produce PIC code that data and function label referenced are based on A5.
> It can't reference correct postion for function that is the parameter of another function in PIC.
Thanks for your bug report. Please have a look at
http://www.gnu.org/software/gcc/bugs.html
and try to make a *COMPLETE* bug report. I.e. give us some source
code, say what operating system you are using, show us the assembler
code, say what happens when you run the program, and why you think
this is incorrect.
For example, consider the program
#include <stdio.h>
void foo(){
printf("Here\n");
}
void bar(void (*f)()){
f();
}
int main()
{
bar(foo);
}
When run, it should print 'Here'. What happens when you compile this
program on your system? What if you use -fPIC instead of -fpic?
Please also have a look at
http://gcc.gnu.org/ml/gcc/1998-02/msg00977.html
http://gcc.gnu.org/ml/gcc/1998-02/msg01000.html
http://gcc.gnu.org/ml/gcc/1999-10n/msg00415.html
http://gcc.gnu.org/ml/gcc/1999-10n/msg00442.html
Regards,
Martin