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: identifying free() in tree-ssa


Hi Roger,

This patch adds BUILT_IN_FREE to builtins.def file.

I have tested it for C and C++ on powerpc-suse-linux,
and it figured out that there is a call for free function
without previous declaration in /gcc.dg/torture/pr24750-1.c,
that I added on Andrew's advice.

OK for mainline?

Olga

Index: ChangeLog
===================================================================
--- ChangeLog     (revision 120668)
+++ ChangeLog     (working copy)
@@ -1,3 +1,7 @@
+2007-01-11  Olga Golovanevsky  <olga@il.ibm.com>
+
+     * builtins.def : Add BUILT_IN_FREE.
+
 2007-01-10  Jan Hubicka  <jh@suse.cz>

      * tree-vrp.c (remove_range_assertions): Release defs.
Index: testsuite/gcc.dg/torture/pr24750-1.c
===================================================================
--- testsuite/gcc.dg/torture/pr24750-1.c  (revision 120668)
+++ testsuite/gcc.dg/torture/pr24750-1.c  (working copy)
@@ -1,3 +1,4 @@
+extern void free (void *);
 extern int unknown;
 extern int n0;
 extern short *s0;
Index: testsuite/ChangeLog
===================================================================
--- testsuite/ChangeLog (revision 120668)
+++ testsuite/ChangeLog (working copy)
@@ -98,6 +98,10 @@
      * gfortran.dg/do_iterator.f90: Adjust pattern for expected error.
      * gfortran.dg/gomp/pr29759.f90: Ditto.

+2007-01-11  Olga Golovanevsky  <olga@il.ibm.com>
+
+     * gcc.dg/torture/pr24750-1.c:  Add prototype of free.
+
 2007-01-06  Steven G. Kargl  <kargl@gcc.gnu.org>

      * gfortran.dg/present_1.f90:  Update error message.
Index: builtins.def
===================================================================
--- builtins.def  (revision 120668)
+++ builtins.def  (working copy)
@@ -632,6 +632,7 @@ DEF_EXT_LIB_BUILTIN    (BUILT_IN_FFSL, "
 DEF_EXT_LIB_BUILTIN    (BUILT_IN_FFSLL, "ffsll", BT_FN_INT_LONGLONG,
ATTR_CONST_NOTHROW_LIST)
 DEF_EXT_LIB_BUILTIN        (BUILT_IN_FORK, "fork", BT_FN_PID,
ATTR_NOTHROW_LIST)
 DEF_GCC_BUILTIN        (BUILT_IN_FRAME_ADDRESS, "frame_address",
BT_FN_PTR_UINT, ATTR_NULL)
+DEF_LIB_BUILTIN        (BUILT_IN_FREE, "free", BT_FN_VOID_PTR,
ATTR_NOTHROW_LIST)
 DEF_GCC_BUILTIN        (BUILT_IN_FROB_RETURN_ADDR, "frob_return_addr",
BT_FN_PTR_PTR, ATTR_NULL)
 DEF_EXT_LIB_BUILTIN    (BUILT_IN_GETTEXT, "gettext",
BT_FN_STRING_CONST_STRING, ATTR_FORMAT_ARG_1)
 DEF_C99_BUILTIN        (BUILT_IN_IMAXABS, "imaxabs", BT_FN_INTMAX_INTMAX,
ATTR_CONST_NOTHROW_LIST)


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