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: 28 Oct 2007 16:09:15 -0000
- Subject: [Bug target/12081] Gcc can't be compiled with -mregparm=3
- References: <bug-12081-1600@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #16 from mikulas at artax dot karlin dot mff dot cuni dot cz 2007-10-28 16:09 -------
Subject: Re: Gcc can't be compiled with -mregparm=3
> arguments the function receives. We have gen_* functions taking 0, 1, 2, 3, ...
> arguments and with GCC being designed the way it is, they need to be
> prototyped and defined with the same arguments.
>
> You are most definitely welcome to post some non-varargs code which works.
> You are most definitely also welcome to time it against my patches.
You can cast them at the time of calling and store them as void * in the
table --- that is standard-compliant.
Or you can define
union gen_function {
rtx (*one_arg)(rtx);
rtx (*two_args)(rtx, rtx);
rtx (*three_args)(rtx, rtx, rtx);
... etc;
};
--- this will be correct C without the performance impact of varargs.
Mikulas
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12081