PR/c++ 15119
authorRichard Kenner <kenner@gcc.gnu.org>
Sun, 25 Apr 2004 23:54:42 +0000 (19:54 -0400)
committerRichard Kenner <kenner@gcc.gnu.org>
Sun, 25 Apr 2004 23:54:42 +0000 (19:54 -0400)
PR/c++ 15119
* tree.c (substitute_placeholder_in_expr, case 4): New case,
for TARGET_EXPR.

From-SVN: r81170

gcc/ChangeLog
gcc/tree.c

index 10de4bdcd7d3eb700b93110850d1aebeed9fc1ba..b74866cd47a677362dd01ed976a89430afc36295 100644 (file)
@@ -1,4 +1,10 @@
-2004-03-25  Zdenek Dvorak  <rakdver@atrey.karlin.mff.cuni.cz>
+2004-04-25  Richard Kenner  <kenner@vlsi1.ultra.nyu.edu>
+
+       PR/c++ 15119
+       * tree.c (substitute_placeholder_in_expr, case 4): New case,
+       for TARGET_EXPR.
+
+2004-04-25  Zdenek Dvorak  <rakdver@atrey.karlin.mff.cuni.cz>
 
        * gcov-io.h (__gcov_fork, __gcov_execl, __gcov_execlp, __gcov_execle,
        __gcov_execv, __gcov_execvp, __gcov_execve): Do not declare when
index 0b301e2bb38f26b03fffd24abebf829b341fdea4..e7435a78a3c9d58be2ce0f4c1023b22a352b8fdb 100644 (file)
@@ -2053,7 +2053,7 @@ tree
 substitute_placeholder_in_expr (tree exp, tree obj)
 {
   enum tree_code code = TREE_CODE (exp);
-  tree op0, op1, op2;
+  tree op0, op1, op2, op3;
 
   /* If this is a PLACEHOLDER_EXPR, see if we find a corresponding type
      in the chain of OBJ.  */
@@ -2151,6 +2151,19 @@ substitute_placeholder_in_expr (tree exp, tree obj)
            else
              return fold (build3 (code, TREE_TYPE (exp), op0, op1, op2));
 
+         case 4:
+           op0 = SUBSTITUTE_PLACEHOLDER_IN_EXPR (TREE_OPERAND (exp, 0), obj);
+           op1 = SUBSTITUTE_PLACEHOLDER_IN_EXPR (TREE_OPERAND (exp, 1), obj);
+           op2 = SUBSTITUTE_PLACEHOLDER_IN_EXPR (TREE_OPERAND (exp, 2), obj);
+           op3 = SUBSTITUTE_PLACEHOLDER_IN_EXPR (TREE_OPERAND (exp, 3), obj);
+
+           if (op0 == TREE_OPERAND (exp, 0) && op1 == TREE_OPERAND (exp, 1)
+               && op2 == TREE_OPERAND (exp, 2)
+               && op3 == TREE_OPERAND (exp, 3))
+             return exp;
+           else
+             return fold (build4 (code, TREE_TYPE (exp), op0, op1, op2, op3));
+
          default:
            abort ();
          }