]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR middle-end/18951 (Invalid code generated by expand_errno_check)
authorJakub Jelinek <jakub@redhat.com>
Tue, 14 Dec 2004 18:12:32 +0000 (19:12 +0100)
committerJakub Jelinek <jakub@gcc.gnu.org>
Tue, 14 Dec 2004 18:12:32 +0000 (19:12 +0100)
PR middle-end/18951
* builtins.c (expand_builtin_mathfn, expand_builtin_mathfn_2): Avoid
using arguments passed to save_expr after that call.

* gcc.c-torture/execute/20041213-1.c: New test.

From-SVN: r92153

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

index 960f06b6f1ffdb8124eff89ec393815181f0f225..f87baa5929194fc439401274dc96c7c7905ebc51 100644 (file)
@@ -1,3 +1,9 @@
+2004-12-14  Jakub Jelinek  <jakub@redhat.com>
+
+       PR middle-end/18951
+       * builtins.c (expand_builtin_mathfn, expand_builtin_mathfn_2): Avoid
+       using arguments passed to save_expr after that call.
+
 2004-12-13  John David Anglin  <dave.anglin@nrc-cnrc.gc.ca>
 
        PR middle-end/18730
index dadb6cd41a0e8bf80f744a8b5fa821c929229738..4cb42cc61e248f895a32492444cf833f2fd06517 100644 (file)
@@ -1708,6 +1708,7 @@ expand_builtin_mathfn (tree exp, rtx target, rtx subtarget)
       narg = save_expr (arg);
       if (narg != arg)
        {
+         arg = narg;
          arglist = build_tree_list (NULL_TREE, arg);
          exp = build_function_call_expr (fndecl, arglist);
        }
@@ -1840,6 +1841,7 @@ expand_builtin_mathfn_2 (tree exp, rtx target, rtx subtarget)
   narg = save_expr (arg1);
   if (narg != arg1)
     {
+      arg1 = narg;
       temp = build_tree_list (NULL_TREE, narg);
       stable = false;
     }
@@ -1849,6 +1851,7 @@ expand_builtin_mathfn_2 (tree exp, rtx target, rtx subtarget)
   narg = save_expr (arg0);
   if (narg != arg0)
     {
+      arg0 = narg;
       arglist = tree_cons (NULL_TREE, narg, temp);
       stable = false;
     }
index 6042617480213536ddc32d072f86e21826a9fdda..7adcb330f4cf8209d0ae8811cf78d81657527425 100644 (file)
@@ -1,3 +1,8 @@
+2004-12-14  Jakub Jelinek  <jakub@redhat.com>
+
+       PR middle-end/18951
+       * gcc.c-torture/execute/20041213-1.c: New test.
+
 2004-12-13  Richard Henderson  <rth@redhat.com>
 
        * gcc.dg/i386-sse-10.c: Fix typo in options.