This is the mail archive of the gcc-patches@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]

Re: [PATCH] Fix PR32493, bring back inlining of varargs functions


On Fri, Jun 29, 2007 at 03:40:15PM +0200, Richard Guenther wrote:

> Index: testsuite/gcc.dg/inline-23.c
> ===================================================================
> *** testsuite/gcc.dg/inline-23.c	(revision 0)
> --- testsuite/gcc.dg/inline-23.c	(revision 0)
> ***************
> *** 0 ****
> --- 1,17 ----
> + /* { dg-do compile } */
> + /* { dg-options "-std=gnu89" } */
> + /* Make sure we can inline a varargs function whose variable arguments
> +    are not used.  See PR32493.  */
> + static inline __attribute__((always_inline)) void __check_printsym_format(const
> + char *fmt, ...)
> + {
> + }
> + static inline __attribute__((always_inline)) void print_symbol(const char *fmt,
> + unsigned long addr)
> + {
> +  __check_printsym_format(fmt, "");
> + }
> + void do_initcalls(void **call)
> + {
> +    print_symbol(": %s()", (unsigned long) *call);
> + }

   This testcase fails on targets with e.g. 16-bit pointers and 32-bit long
ints:

.../gcc/testsuite/gcc.dg/inline-23.c: In function 'do_initcalls':
.../gcc/testsuite/gcc.dg/inline-23.c:16: warning: cast from pointer to integer of different size

-- 
Rask Ingemann Lambertsen


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