diff options
author | Eric Botcazou <ebotcazou@adacore.com> | 2008-01-17 16:04:10 +0000 |
---|---|---|
committer | Eric Botcazou <ebotcazou@gcc.gnu.org> | 2008-01-17 16:04:10 +0000 |
commit | 9328dd5725be9ddbca3350bf0586b30c3b920a6d (patch) | |
tree | 4bcac1ec5fb387062d0ec563f1ec4118134654c1 | |
parent | 7c1950cdf15a9a1b0509ef0cff47411a2a812ec2 (diff) | |
download | gcc-9328dd5725be9ddbca3350bf0586b30c3b920a6d.tar.gz |
tree.c (substitute_in_expr): Add missing 'break'.
* tree.c (substitute_in_expr): Add missing 'break'.
ada/
* utils.c (build_function_stub): Properly build the call expression.
From-SVN: r131600
-rw-r--r-- | gcc/ChangeLog | 4 | ||||
-rw-r--r-- | gcc/ada/ChangeLog | 4 | ||||
-rw-r--r-- | gcc/ada/utils.c | 6 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 4 | ||||
-rw-r--r-- | gcc/testsuite/gnat.dg/discr5.adb | 17 | ||||
-rw-r--r-- | gcc/tree.c | 5 |
6 files changed, 35 insertions, 5 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 17002420508..572b6edab60 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -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 diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index 1dd2fc5625e..33293cf9096 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -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 diff --git a/gcc/ada/utils.c b/gcc/ada/utils.c index 1c975416b5f..32cbbffa2a9 100644 --- a/gcc/ada/utils.c +++ b/gcc/ada/utils.c @@ -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))) diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 329c57a969e..b5a41620f9e 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,5 +1,9 @@ 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. 2008-01-17 Richard Guenther <rguenther@suse.de> diff --git a/gcc/testsuite/gnat.dg/discr5.adb b/gcc/testsuite/gnat.dg/discr5.adb new file mode 100644 index 00000000000..631db55dba0 --- /dev/null +++ b/gcc/testsuite/gnat.dg/discr5.adb @@ -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; diff --git a/gcc/tree.c b/gcc/tree.c index 21121b27788..b96dc35293f 100644 --- a/gcc/tree.c +++ b/gcc/tree.c @@ -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 (); |