[Bug middle-end/41149] -fdump-tree-original and procedure pointer components

2009-08-25 Thread steven at gcc dot gnu dot org


--- Comment #7 from steven at gcc dot gnu dot org  2009-08-25 11:21 ---
Please drop the patch in gcc-patches as well (just post it with a comment that
you've committed it to fix this PR).


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41149



[Bug middle-end/41149] -fdump-tree-original and procedure pointer components

2009-08-25 Thread janus at gcc dot gnu dot org


--- Comment #6 from janus at gcc dot gnu dot org  2009-08-25 09:38 ---
Fixed with r151075. Closing.


-- 

janus at gcc dot gnu dot org changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution||FIXED


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41149



[Bug middle-end/41149] -fdump-tree-original and procedure pointer components

2009-08-25 Thread janus at gcc dot gnu dot org


--- Comment #5 from janus at gcc dot gnu dot org  2009-08-25 09:35 ---
Subject: Bug 41149

Author: janus
Date: Tue Aug 25 09:35:41 2009
New Revision: 151075

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=151075
Log:
2009-08-25  Janus Weil  

PR middle-end/41149
* tree-pretty-print.c (print_call_name): Print the correct call name
for procedure pointer components.


Modified:
trunk/gcc/ChangeLog
trunk/gcc/tree-pretty-print.c


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41149



[Bug middle-end/41149] -fdump-tree-original and procedure pointer components

2009-08-25 Thread rguenther at suse dot de


--- Comment #4 from rguenther at suse dot de  2009-08-25 09:13 ---
Subject: Re:  -fdump-tree-original and procedure pointer
 components

On Tue, 25 Aug 2009, janus at gcc dot gnu dot org wrote:

> --- Comment #3 from janus at gcc dot gnu dot org  2009-08-25 09:08 ---
> The patch in comment #2 was successfully bootstrapped and regtested. Ok for
> trunk?

Ok with a changelog entry.

Richard.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41149



[Bug middle-end/41149] -fdump-tree-original and procedure pointer components

2009-08-25 Thread janus at gcc dot gnu dot org


--- Comment #3 from janus at gcc dot gnu dot org  2009-08-25 09:08 ---
The patch in comment #2 was successfully bootstrapped and regtested. Ok for
trunk?


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41149



[Bug middle-end/41149] -fdump-tree-original and procedure pointer components

2009-08-24 Thread janus at gcc dot gnu dot org


--- Comment #2 from janus at gcc dot gnu dot org  2009-08-24 19:44 ---
(In reply to comment #1)
> Seems like by design, see tree-pretty-print.c:print_call_name

Thanks for pointing me at the right place.


> Likely for printing prettier member function names.  IMHO we should just
> drop this function on the floor

I wouldn't go as far as dropping the whole function, but at least the part
concerning COMPONENT_REF seems pretty braindead to me. I'd propose to just drop
this and replace it by something more sane, like here:


Index: gcc/tree-pretty-print.c
===
--- gcc/tree-pretty-print.c (revision 151053)
+++ gcc/tree-pretty-print.c (working copy)
@@ -2705,19 +2705,6 @@ print_call_name (pretty_printer *buffer,
   dump_generic_node (buffer, TREE_OPERAND (op0, 2), 0, flags, false);
   break;

-case COMPONENT_REF:
-  /* The function is a pointer contained in a structure.  */
-  if (TREE_CODE (TREE_OPERAND (op0, 0)) == INDIRECT_REF ||
- TREE_CODE (TREE_OPERAND (op0, 0)) == VAR_DECL)
-   dump_function_name (buffer, TREE_OPERAND (op0, 1), flags);
-  else
-   dump_generic_node (buffer, TREE_OPERAND (op0, 0), 0, flags, false);
-  /* else
-We can have several levels of structures and a function
-pointer inside.  This is not implemented yet...  */
-  /* NIY;*/
-  break;
-
 case ARRAY_REF:
   if (TREE_CODE (TREE_OPERAND (op0, 0)) == VAR_DECL)
dump_function_name (buffer, TREE_OPERAND (op0, 0), flags);
@@ -2725,6 +2712,7 @@ print_call_name (pretty_printer *buffer,
dump_generic_node (buffer, op0, 0, flags, false);
   break;

+case COMPONENT_REF:
 case SSA_NAME:
 case OBJ_TYPE_REF:
   dump_generic_node (buffer, op0, 0, flags, false);


This seems to do the right thing (also for multiply nested function pointers as
in comment #1). Regtesting now ...


-- 

janus at gcc dot gnu dot org changed:

   What|Removed |Added

 AssignedTo|unassigned at gcc dot gnu   |janus at gcc dot gnu dot org
   |dot org |
 Status|NEW |ASSIGNED
   Last reconfirmed|2009-08-24 09:21:23 |2009-08-24 19:44:09
   date||


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41149



[Bug middle-end/41149] -fdump-tree-original and procedure pointer components

2009-08-24 Thread rguenth at gcc dot gnu dot org


--- Comment #1 from rguenth at gcc dot gnu dot org  2009-08-24 09:21 ---
Seems like by design, see tree-pretty-print.c:print_call_name

Likely for printing prettier member function names.  IMHO we should just
drop this function on the floor considering it prints t.w (...) for

  struct
{
  struct
{
  funcPtr *ppc;
} w;
} t;
  t.w.ppc = func;
  l = t.w.ppc("Hello");

I'll happily approve a patch that passes bootstrap and testing that
reduces the function to strip an address-taking operation (note the
CALL_EXPR operand is an address of the function, so &a (...) should
print as a (...) and p (...) should print as (*p) (...)).


-- 

rguenth at gcc dot gnu dot org changed:

   What|Removed |Added

 CC||rguenth at gcc dot gnu dot
   ||org
 Status|UNCONFIRMED |NEW
 Ever Confirmed|0   |1
   Last reconfirmed|-00-00 00:00:00 |2009-08-24 09:21:23
   date||


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41149