OSDN Git Service

gcc:
authorghazi <ghazi@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 24 Mar 2003 01:24:41 +0000 (01:24 +0000)
committerghazi <ghazi@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 24 Mar 2003 01:24:41 +0000 (01:24 +0000)
* builtins.c (expand_builtin_fputs): When optimizing for size,
don't transform fputs into fwrite.
testsuite:
* gcc.c-torture/execute/stdio-opt-1.c: Adjust test for change to
builtin fputs.

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

gcc/ChangeLog
gcc/builtins.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.c-torture/execute/stdio-opt-1.c

index 596e91e..5e130ce 100644 (file)
@@ -1,3 +1,8 @@
+2003-03-23  Arpad Beszedes <beszedes@cc.u-szeged.hu>
+
+       * builtins.c (expand_builtin_fputs): When optimizing for size,
+       don't transform fputs into fwrite.
+
 2003-03-23  Glen Nakamura <glen@imodulo.com>
 
        PR c/8224
index 244249d..b6fe4b4 100644 (file)
@@ -3796,8 +3796,12 @@ expand_builtin_fputs (arglist, ignore, unlocked)
       /* FALLTHROUGH */
     case 1: /* length is greater than 1, call fwrite.  */
       {
-       tree string_arg = TREE_VALUE (arglist);
+       tree string_arg;
 
+       /* If optimizing for size keep fputs. */
+       if (optimize_size)
+         return 0;
+       string_arg = TREE_VALUE (arglist);
        /* New argument list transforming fputs(string, stream) to
           fwrite(string, 1, len, stream).  */
        arglist = build_tree_list (NULL_TREE, TREE_VALUE (TREE_CHAIN (arglist)));
index 9db8535..8b85ee4 100644 (file)
@@ -1,3 +1,8 @@
+2003-03-23  Arpad Beszedes <beszedes@cc.u-szeged.hu>
+
+       * gcc.c-torture/execute/stdio-opt-1.c: Adjust test for change to
+       builtin fputs.
+
 2003-03-23  Mikulas Patocka <mikulas@artax.karlin.mff.cuni.cz>
 
        PR c/8224
index f5316d4..fc43c57 100644 (file)
@@ -54,7 +54,7 @@ int main()
   return 0;
 }
 
-#ifdef __OPTIMIZE__
+#if defined (__OPTIMIZE__) && ! defined (__OPTIMIZE_SIZE__)
 /* When optimizing, all the above cases should be transformed into
    something else.  So any remaining calls to the original function
    should abort.  */