This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/12180] New: Inline optimization for variadic function fails for sparc* targets
- From: "martin at netbsd dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 5 Sep 2003 10:36:21 -0000
- Subject: [Bug c/12180] New: Inline optimization for variadic function fails for sparc* targets
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12180
Summary: Inline optimization for variadic function fails for
sparc* targets
Product: gcc
Version: 3.3.1
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: c
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: martin at netbsd dot org
CC: gcc-bugs at gcc dot gnu dot org,martin at netbsd dot org
GCC build triplet: sparc64--netbsd
GCC host triplet: sparc64--netbsd
GCC target triplet: sparc64--netbsd
I noticed this when trying to build mpg123 on NetBSD/sparc64. Matthew Green and
I reduced it to a small example code:
Store this in test.c:
--8<--
typedef char * va_list;
void generic_sendmsg (char *fmt, ...)
{
va_list ap;
(void)(__builtin_next_arg(fmt), (ap) = (va_list)__builtin_saveregs());
}
void generic_sendstat()
{
double t;
generic_sendmsg("F %3.2f", t);
}
-->8--
Then try:
$ cc -c -O3 test.c
test.c: In function `generic_sendstat':
test.c:7: error: `va_start' used in function with fixed args
$
But:
$ cc -c -O3 -fno-inline test.c
$
The problem does not happen for non-sparc targets (AFAICT)