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 7/17/07, Rask Ingemann Lambertsen <rask@sygehus.dk> wrote:
On Tue, Jul 17, 2007 at 05:59:32PM +0200, Rask Ingemann Lambertsen wrote:
>
>    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

   This appears to do the trick. Ok if passes testing on
x86_64-unknown-linux-gnu, i686-pc-linux-gnu and m32c-unknown-elf?

Ok.


Thanks,
Richard.


2007-07-17 Rask Ingemann Lambertsen <rask@sygehus.dk>


* gcc.dg/inline-23.c: Use pointer sized type for cast from pointer.

Index: gcc.dg/inline-23.c
===================================================================
--- gcc.dg/inline-23.c  (revision 126653)
+++ gcc.dg/inline-23.c  (working copy)
@@ -2,16 +2,17 @@
 /* { dg-options "-std=gnu89" } */
 /* Make sure we can inline a varargs function whose variable arguments
    are not used.  See PR32493.  */
+#include <stddef.h>
 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)
+ptrdiff_t addr)
 {
  __check_printsym_format(fmt, "");
 }
 void do_initcalls(void **call)
 {
-   print_symbol(": %s()", (unsigned long) *call);
+   print_symbol(": %s()", (ptrdiff_t) *call);
 }

--
Rask Ingemann Lambertsen



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