This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

PATCH to fold_builtin


fold_builtin was failing to handle cases where the function address was
wrapped in a NOP.  Fixed by using the same routine to get at the function
decl that we use elsewhere in the compiler.

Tested athlon-pc-linux-gnu, applied to tree-ssa.  Currently testing on the
trunk.

2003-08-19  Jason Merrill  <jason@redhat.com>

	* builtins.c (fold_builtin): Use get_callee_fndecl.

*** ./builtins.c.~1~	Tue Aug 19 14:38:35 2003
--- ./builtins.c	Tue Aug 19 17:07:44 2003
*************** fold_builtin_ceil (tree exp)
*** 5760,5766 ****
  tree
  fold_builtin (tree exp)
  {
!   tree fndecl = TREE_OPERAND (TREE_OPERAND (exp, 0), 0);
    tree arglist = TREE_OPERAND (exp, 1);
    tree type = TREE_TYPE (TREE_TYPE (fndecl));
  
--- 5760,5766 ----
  tree
  fold_builtin (tree exp)
  {
!   tree fndecl = get_callee_fndecl (exp);
    tree arglist = TREE_OPERAND (exp, 1);
    tree type = TREE_TYPE (TREE_TYPE (fndecl));
  

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]