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]

Bug in expand_builtin_sprintf


I think there's a small bug in expand_builtin_sprintf in trunk,
introduced by commit 122018. Fix below:

Index: builtins.c
===================================================================
--- builtins.c  (revision 129124)
+++ builtins.c  (working copy)
@@ -5449,7 +5449,7 @@
   dest = CALL_EXPR_ARG (exp, 0);
   if (! POINTER_TYPE_P (TREE_TYPE (dest)))
     return NULL_RTX;
-  fmt = CALL_EXPR_ARG (exp, 0);
+  fmt = CALL_EXPR_ARG (exp, 1);
   if (! POINTER_TYPE_P (TREE_TYPE (fmt)))
     return NULL_RTX;

-- 
  Heikki Linnakangas
  EnterpriseDB   http://www.enterprisedb.com


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