This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug target/12081] Gcc can't be compiled with -mregparm=3
- From: "mikulas at artax dot karlin dot mff dot cuni dot cz" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 18 Jan 2004 01:39:11 -0000
- Subject: [Bug target/12081] Gcc can't be compiled with -mregparm=3
- References: <20030827182850.12081.mikulas@artax.karlin.mff.cuni.cz>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- 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