tree.c (substitute_in_expr): Add missing 'break'.
authorEric Botcazou <ebotcazou@adacore.com>
Thu, 17 Jan 2008 16:04:10 +0000 (16:04 +0000)
committerEric Botcazou <ebotcazou@gcc.gnu.org>
Thu, 17 Jan 2008 16:04:10 +0000 (16:04 +0000)
        * tree.c (substitute_in_expr): Add missing 'break'.
ada/
        * utils.c (build_function_stub): Properly build the call expression.

From-SVN: r131600

gcc/ChangeLog
gcc/ada/ChangeLog
gcc/ada/utils.c
gcc/testsuite/ChangeLog
gcc/testsuite/gnat.dg/discr5.adb [new file with mode: 0644]
gcc/tree.c

index 1700242050894243a010bd661535f0c5b8579ee6..572b6edab601a16e4bced3fa784b70f565e24a05 100644 (file)
@@ -1,3 +1,7 @@
+2008-01-17  Eric Botcazou  <ebotcazou@adacore.com>
+
+       * tree.c (substitute_in_expr): Add missing 'break'.
+
 2008-01-17  Richard Guenther  <rguenther@suse.de>
 
        PR tree-optimization/34825
index 1dd2fc5625ecf98ecc37cb273b84d8116a3a5d95..33293cf9096d4ab29021781454d27c12f12b4f68 100644 (file)
@@ -1,3 +1,7 @@
+2008-01-17  Eric Botcazou  <ebotcazou@adacore.com>
+
+       * utils.c (build_function_stub): Properly build the call expression.
+
 2008-01-14  Eric Botcazou  <ebotcazou@adacore.com>
 
        * decl.c (gnat_to_gnu_entity) <object>: Process renamings
index 1c975416b5fb0e5e8fdfcf27654cc0d111eb3edb..32cbbffa2a962275aa6591c04458e7896fc05055 100644 (file)
@@ -3022,9 +3022,9 @@ build_function_stub (tree gnu_subprog, Entity_Id gnat_subprog)
   /* Invoke the internal subprogram.  */
   gnu_subprog_addr = build1 (ADDR_EXPR, build_pointer_type (gnu_subprog_type),
                             gnu_subprog);
-  gnu_subprog_call = build3 (CALL_EXPR, TREE_TYPE (gnu_subprog_type),
-                            gnu_subprog_addr, nreverse (gnu_param_list),
-                            NULL_TREE);
+  gnu_subprog_call = build_call_list (TREE_TYPE (gnu_subprog_type),
+                                     gnu_subprog_addr,
+                                     nreverse (gnu_param_list));
 
   /* Propagate the return value, if any.  */
   if (VOID_TYPE_P (TREE_TYPE (gnu_subprog_type)))
index 329c57a969e7b5db22c760df846e2cbc1fcf7d57..b5a41620f9effe7663ef50f4f7333eacd8e7b16c 100644 (file)
@@ -1,3 +1,7 @@
+2008-01-17  Eric Botcazou  <ebotcazou@adacore.com>
+
+       * gnat.dg/discr5.adb: New test.
+
 2008-01-17  Eric Botcazou  <ebotcazou@adacore.com>
 
        * gcc.c-torture/compile/20080114-1.c: Use empty asm statements.
diff --git a/gcc/testsuite/gnat.dg/discr5.adb b/gcc/testsuite/gnat.dg/discr5.adb
new file mode 100644 (file)
index 0000000..631db55
--- /dev/null
@@ -0,0 +1,17 @@
+-- { dg-do compile }
+
+procedure Discr5 is
+
+   type Enum is (Ten, Twenty);
+   for Enum use (10, 20);
+   type Arr is array (Enum range <>) of Integer;
+   type Rec (Discr: Enum := Ten) is record
+      case Discr is
+         when others =>
+            A: Arr (Ten .. Discr);
+      end case;
+   end record;
+
+begin
+   null;
+end;
index 21121b27788bf7fe39f35961658a87165b7fa321..b96dc35293f562e0cf4c84cf8764f034e3f01008 100644 (file)
@@ -2530,8 +2530,8 @@ substitute_in_expr (tree exp, tree f, tree r)
        {
          tree copy = NULL_TREE;
          int i;
-         int n = TREE_OPERAND_LENGTH (exp);
-         for (i = 1; i < n; i++)
+
+         for (i = 1; i < TREE_OPERAND_LENGTH (exp); i++)
            {
              tree op = TREE_OPERAND (exp, i);
              tree newop = SUBSTITUTE_IN_EXPR (op, f, r);
@@ -2546,6 +2546,7 @@ substitute_in_expr (tree exp, tree f, tree r)
          else
            return exp;
        }
+       break;
 
       default:
        gcc_unreachable ();