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]

[Bug target/12081] Gcc can't be compiled with -mregparm=3


------- Additional Comments From mikulas at artax dot karlin dot mff dot cuni dot cz  2004-01-18 01:39 -------
Gcc is code written the wrong way

Let's have these declarations:

void f(int a, int b);
void (*g)(int a, ...);

and this code:

g = (void (*)(int, ...))f;
f(1,2);

--- the code is obviously wrong in C and might not work. It works on most
architectures, but it doesn't on x86 with regparm 3 or -mrtd.

Similar code exists in gcc in insn-output.c (there is:
"(insn_gen_fn)gen_cmpqi_ext_3_insn" and many more like this).

I "fixed" it for myself by adding attribute regparm(0),cdecl to these
functions, but it is not correct fix. Correct fix would be to not use these
kind of casts.

I can't show you how to reproduce the bug, because you don't have environment
where regparm(3) is default calling convention. I do have.


-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|WAITING                     |NEW


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12081


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