OSDN Git Service

2010-04-30 Richard Guenther <rguenther@suse.de>
authorrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 30 Apr 2010 08:18:51 +0000 (08:18 +0000)
committerMasaki Muranaka <monaka@monami-software.com>
Sun, 23 May 2010 05:37:13 +0000 (14:37 +0900)
* builtins.c (fold_builtin_1): Delete free (0).

* gcc.dg/tree-ssa/builtin-free.c: New testcase.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@158923 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/builtins.c
gcc/testsuite/ChangeLog

index 6abbab3..d20e202 100644 (file)
@@ -1,3 +1,7 @@
+2010-04-30  Richard Guenther  <rguenther@suse.de>
+
+       * builtins.c (fold_builtin_1): Delete free (0).
+
 2010-04-29  Jan HUbicka  <jh@suse.cz>
 
        * gengtype.c (open_base_files): Add lto-streamer.h
 2010-04-29  Jan HUbicka  <jh@suse.cz>
 
        * gengtype.c (open_base_files): Add lto-streamer.h
index 997c13a..b514ae0 100644 (file)
@@ -9817,7 +9817,6 @@ fold_builtin_1 (location_t loc, tree fndecl, tree arg0, bool ignore)
   enum built_in_function fcode = DECL_FUNCTION_CODE (fndecl);
   switch (fcode)
     {
   enum built_in_function fcode = DECL_FUNCTION_CODE (fndecl);
   switch (fcode)
     {
-
     case BUILT_IN_CONSTANT_P:
       {
        tree val = fold_builtin_constant_p (arg0);
     case BUILT_IN_CONSTANT_P:
       {
        tree val = fold_builtin_constant_p (arg0);
@@ -10199,6 +10198,11 @@ fold_builtin_1 (location_t loc, tree fndecl, tree arg0, bool ignore)
     case BUILT_IN_VPRINTF:
       return fold_builtin_printf (loc, fndecl, arg0, NULL_TREE, ignore, fcode);
 
     case BUILT_IN_VPRINTF:
       return fold_builtin_printf (loc, fndecl, arg0, NULL_TREE, ignore, fcode);
 
+    case BUILT_IN_FREE:
+      if (integer_zerop (arg0))
+       return build_empty_stmt (loc);
+      break;
+
     default:
       break;
     }
     default:
       break;
     }
index b2b0e51..45f0023 100644 (file)
@@ -1,3 +1,7 @@
+2010-04-30  Richard Guenther  <rguenther@suse.de>
+
+       * gcc.dg/tree-ssa/builtin-free.c: New testcase.
+
 2010-04-29  Fabien ChĂȘne  <fabien.chene@gmail.com>
 
        PR c++/43890
 2010-04-29  Fabien ChĂȘne  <fabien.chene@gmail.com>
 
        PR c++/43890