summaryrefslogtreecommitdiff
path: root/gcc/c/c-array-notation.c
diff options
context:
space:
mode:
authorbviyer <bviyer@138bc75d-0d04-0410-961f-82ee72b054a4>2013-06-10 23:14:12 +0000
committerbviyer <bviyer@138bc75d-0d04-0410-961f-82ee72b054a4>2013-06-10 23:14:12 +0000
commit62aab3f32fad9b01ee0ead73ed58817af3ac5046 (patch)
treeaaa8d116d537e4253cf42dbd2f2f1bb4638b756c /gcc/c/c-array-notation.c
parent8544d95d3a6def0b5ee52341d685b3e8a40e8d1a (diff)
downloadgcc-62aab3f32fad9b01ee0ead73ed58817af3ac5046.tar.gz
Fix for PR c/57563
gcc/c/ChangeLog +2013-06-10 Balaji V. Iyer <balaji.v.iyer@intel.com> + + * c-array-notation.c (fix_builtin_array_notation_fn): Fully folded + excessive precision expressions in function parameters. Also removed + couple unwanted while statements. + gcc/testsuite/ChangeLog +2013-06-10 Balaji V. Iyer <balaji.v.iyer@intel.com> + + PR c/57563 + * c-c++-common/cilk-plus/AN/builtin_fn_mutating.c (main): Fixed a bug + in how we check __sec_reduce_mutating function's result. + git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@199925 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/c/c-array-notation.c')
-rw-r--r--gcc/c/c-array-notation.c17
1 files changed, 5 insertions, 12 deletions
diff --git a/gcc/c/c-array-notation.c b/gcc/c/c-array-notation.c
index b1040da0cc7..32859691cc3 100644
--- a/gcc/c/c-array-notation.c
+++ b/gcc/c/c-array-notation.c
@@ -143,25 +143,18 @@ fix_builtin_array_notation_fn (tree an_builtin_fn, tree *new_var)
|| an_type == BUILT_IN_CILKPLUS_SEC_REDUCE_MUTATING)
{
call_fn = CALL_EXPR_ARG (an_builtin_fn, 2);
- while (TREE_CODE (call_fn) == CONVERT_EXPR
- || TREE_CODE (call_fn) == NOP_EXPR)
+ if (TREE_CODE (call_fn) == ADDR_EXPR)
call_fn = TREE_OPERAND (call_fn, 0);
- call_fn = TREE_OPERAND (call_fn, 0);
-
identity_value = CALL_EXPR_ARG (an_builtin_fn, 0);
- while (TREE_CODE (identity_value) == CONVERT_EXPR
- || TREE_CODE (identity_value) == NOP_EXPR)
- identity_value = TREE_OPERAND (identity_value, 0);
func_parm = CALL_EXPR_ARG (an_builtin_fn, 1);
}
else
func_parm = CALL_EXPR_ARG (an_builtin_fn, 0);
- while (TREE_CODE (func_parm) == CONVERT_EXPR
- || TREE_CODE (func_parm) == EXCESS_PRECISION_EXPR
- || TREE_CODE (func_parm) == NOP_EXPR)
- func_parm = TREE_OPERAND (func_parm, 0);
-
+ /* Fully fold any EXCESSIVE_PRECISION EXPR that can occur in the function
+ parameter. */
+ func_parm = c_fully_fold (func_parm, false, NULL);
+
location = EXPR_LOCATION (an_builtin_fn);
if (!find_rank (location, an_builtin_fn, an_builtin_fn, true, &rank))