Commit 95815af9 by Jeffrey A Law Committed by Jeff Law

c-typeck.c (build_function_call): Check that the built-in function is of class…

c-typeck.c (build_function_call): Check that the built-in function is of class BUILT_IN_NORMAL before trying to...

        * c-typeck.c (build_function_call): Check that the built-in
        function is of class BUILT_IN_NORMAL before trying to recongize
        it as BUILT_IN_ABS.
        * calls.c (calls_function_1): Similarly for BUILT_IN_ALLOCA.
        * stmt.c (expand_end_cae): Similarly for BUILT_IN_CLASSIFY_TYPE.

        * call.c (build_over_call):  Check that the built-in function is
        of class BUILT_IN_NORMAL before trying to recongize it as BUILT_IN_ABS.
        * typeck.c (build_function_call_real): Similarly.

From-SVN: r30208
parent 283a2545
Tue Oct 26 23:29:18 1999 Jeffrey A Law (law@cygnus.com)
* c-typeck.c (build_function_call): Check that the built-in
function is of class BUILT_IN_NORMAL before trying to recongize
it as BUILT_IN_ABS.
* calls.c (calls_function_1): Similarly for BUILT_IN_ALLOCA.
* stmt.c (expand_end_cae): Similarly for BUILT_IN_CLASSIFY_TYPE.
Wed Oct 27 00:14:13 1999 Robert Lipe <robertlipe@usa.net> Wed Oct 27 00:14:13 1999 Robert Lipe <robertlipe@usa.net>
......
...@@ -1461,7 +1461,8 @@ build_function_call (function, params) ...@@ -1461,7 +1461,8 @@ build_function_call (function, params)
if (TREE_CODE (function) == ADDR_EXPR if (TREE_CODE (function) == ADDR_EXPR
&& TREE_CODE (TREE_OPERAND (function, 0)) == FUNCTION_DECL && TREE_CODE (TREE_OPERAND (function, 0)) == FUNCTION_DECL
&& DECL_BUILT_IN (TREE_OPERAND (function, 0))) && DECL_BUILT_IN (TREE_OPERAND (function, 0))
&& DECL_BUILT_IN_CLASS (TREE_OPERAND (function, 0)) == BUILT_IN_NORMAL)
switch (DECL_FUNCTION_CODE (TREE_OPERAND (function, 0))) switch (DECL_FUNCTION_CODE (TREE_OPERAND (function, 0)))
{ {
case BUILT_IN_ABS: case BUILT_IN_ABS:
......
...@@ -218,6 +218,7 @@ calls_function_1 (exp, which) ...@@ -218,6 +218,7 @@ calls_function_1 (exp, which)
tree fndecl = TREE_OPERAND (TREE_OPERAND (exp, 0), 0); tree fndecl = TREE_OPERAND (TREE_OPERAND (exp, 0), 0);
if ((DECL_BUILT_IN (fndecl) if ((DECL_BUILT_IN (fndecl)
&& DECL_BUILT_IN_CLASS (fndecl) == BUILT_IN_NORMAL
&& DECL_FUNCTION_CODE (fndecl) == BUILT_IN_ALLOCA) && DECL_FUNCTION_CODE (fndecl) == BUILT_IN_ALLOCA)
|| (DECL_SAVED_INSNS (fndecl) || (DECL_SAVED_INSNS (fndecl)
&& DECL_SAVED_INSNS (fndecl)->calls_alloca)) && DECL_SAVED_INSNS (fndecl)->calls_alloca))
......
Tue Oct 26 23:29:56 1999 Jeffrey A Law (law@cygnus.com)
* call.c (build_over_call): Check that the built-in function is
of class BUILT_IN_NORMAL before trying to recongize it as BUILT_IN_ABS.
* typeck.c (build_function_call_real): Similarly.
1999-10-26 Mark Mitchell <mark@codesourcery.com> 1999-10-26 Mark Mitchell <mark@codesourcery.com>
* decl.c (poplevel): Don't set BLOCK_TYPE_TAGS. Don't call * decl.c (poplevel): Don't set BLOCK_TYPE_TAGS. Don't call
......
...@@ -4150,7 +4150,8 @@ build_over_call (cand, args, flags) ...@@ -4150,7 +4150,8 @@ build_over_call (cand, args, flags)
if (TREE_CODE (fn) == ADDR_EXPR if (TREE_CODE (fn) == ADDR_EXPR
&& TREE_CODE (TREE_OPERAND (fn, 0)) == FUNCTION_DECL && TREE_CODE (TREE_OPERAND (fn, 0)) == FUNCTION_DECL
&& DECL_BUILT_IN (TREE_OPERAND (fn, 0))) && DECL_BUILT_IN (TREE_OPERAND (fn, 0))
&& DECL_BUILT_IN_CLASS (TREE_OPERAND (fn, 0)) == BUILT_IN_NORMAL)
switch (DECL_FUNCTION_CODE (TREE_OPERAND (fn, 0))) switch (DECL_FUNCTION_CODE (TREE_OPERAND (fn, 0)))
{ {
case BUILT_IN_ABS: case BUILT_IN_ABS:
......
...@@ -3017,7 +3017,8 @@ build_function_call_real (function, params, require_complete, flags) ...@@ -3017,7 +3017,8 @@ build_function_call_real (function, params, require_complete, flags)
if (TREE_CODE (function) == ADDR_EXPR if (TREE_CODE (function) == ADDR_EXPR
&& TREE_CODE (TREE_OPERAND (function, 0)) == FUNCTION_DECL && TREE_CODE (TREE_OPERAND (function, 0)) == FUNCTION_DECL
&& DECL_BUILT_IN (TREE_OPERAND (function, 0))) && DECL_BUILT_IN (TREE_OPERAND (function, 0))
&& DECL_BUILT_IN_CLASS (TREE_OPERAND (function, 0)) == BUILT_IN_NORMAL)
switch (DECL_FUNCTION_CODE (TREE_OPERAND (function, 0))) switch (DECL_FUNCTION_CODE (TREE_OPERAND (function, 0)))
{ {
case BUILT_IN_ABS: case BUILT_IN_ABS:
......
...@@ -5369,6 +5369,7 @@ expand_end_case (orig_index) ...@@ -5369,6 +5369,7 @@ expand_end_case (orig_index)
|| (TREE_CODE (index_expr) == CALL_EXPR || (TREE_CODE (index_expr) == CALL_EXPR
&& TREE_CODE (TREE_OPERAND (index_expr, 0)) == ADDR_EXPR && TREE_CODE (TREE_OPERAND (index_expr, 0)) == ADDR_EXPR
&& TREE_CODE (TREE_OPERAND (TREE_OPERAND (index_expr, 0), 0)) == FUNCTION_DECL && TREE_CODE (TREE_OPERAND (TREE_OPERAND (index_expr, 0), 0)) == FUNCTION_DECL
&& DECL_BUILT_IN_CLASS (TREE_OPERAND (TREE_OPERAND (index_expr, 0), 0)) == BUILT_IN_NORMAL
&& DECL_FUNCTION_CODE (TREE_OPERAND (TREE_OPERAND (index_expr, 0), 0)) == BUILT_IN_CLASSIFY_TYPE) && DECL_FUNCTION_CODE (TREE_OPERAND (TREE_OPERAND (index_expr, 0), 0)) == BUILT_IN_CLASSIFY_TYPE)
|| (TREE_CODE (index_expr) == COMPOUND_EXPR || (TREE_CODE (index_expr) == COMPOUND_EXPR
&& TREE_CODE (TREE_OPERAND (index_expr, 1)) == INTEGER_CST)) && TREE_CODE (TREE_OPERAND (index_expr, 1)) == INTEGER_CST))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment