* [java] do not ICE when TREE_LIST node was copied
@ 2008-08-28 13:40 Jan Hubicka
2008-08-28 13:55 ` Richard Guenther
0 siblings, 1 reply; 3+ messages in thread
From: Jan Hubicka @ 2008-08-28 13:40 UTC (permalink / raw)
To: gcc-patches
Hi,
Java langhooks rely on fact that every function type parameter list is terminated
by end_params_node TREE_LIST node. This breaks with my new bits for removing operands
from functions calls since TREE_LIST node is copied.
I don't think it is safe to make this assumption (alternatively I can just make
the tree.c bits to preserve last TREE_CHAIN but it is bit painful as it does not work
well with nreverse).
Bootstrapped/regtested i686-linux.
OK?
Honza
* java/lang.c (put_decl_node): Look for VOID_TYPE node instead of cons.
Index: java/lang.c
===================================================================
*** java/lang.c (revision 139571)
--- java/lang.c (working copy)
*************** put_decl_node (tree node)
*** 391,397 ****
if (TREE_CODE (TREE_TYPE (node)) == METHOD_TYPE)
args = TREE_CHAIN (args);
put_decl_string ("(", 1);
! for ( ; args != end_params_node; args = TREE_CHAIN (args), i++)
{
if (i > 0)
put_decl_string (",", 1);
--- 391,397 ----
if (TREE_CODE (TREE_TYPE (node)) == METHOD_TYPE)
args = TREE_CHAIN (args);
put_decl_string ("(", 1);
! for ( ; args && !VOID_TYPE_P (TREE_VALUE (args)); args = TREE_CHAIN (args), i++)
{
if (i > 0)
put_decl_string (",", 1);
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [java] do not ICE when TREE_LIST node was copied
2008-08-28 13:40 [java] do not ICE when TREE_LIST node was copied Jan Hubicka
@ 2008-08-28 13:55 ` Richard Guenther
2008-08-28 14:04 ` Jan Hubicka
0 siblings, 1 reply; 3+ messages in thread
From: Richard Guenther @ 2008-08-28 13:55 UTC (permalink / raw)
To: Jan Hubicka; +Cc: gcc-patches
On Wed, Aug 27, 2008 at 4:01 PM, Jan Hubicka <jh@suse.cz> wrote:
> Hi,
> Java langhooks rely on fact that every function type parameter list is terminated
> by end_params_node TREE_LIST node. This breaks with my new bits for removing operands
> from functions calls since TREE_LIST node is copied.
> I don't think it is safe to make this assumption (alternatively I can just make
> the tree.c bits to preserve last TREE_CHAIN but it is bit painful as it does not work
> well with nreverse).
>
> Bootstrapped/regtested i686-linux.
> OK?
I think the middle-end uses void_list_node in the same regard
(it strips that before nreverse and the re-applies it). So I don't think this
patch is correct.
Richard.
> Honza
> * java/lang.c (put_decl_node): Look for VOID_TYPE node instead of cons.
> Index: java/lang.c
> ===================================================================
> *** java/lang.c (revision 139571)
> --- java/lang.c (working copy)
> *************** put_decl_node (tree node)
> *** 391,397 ****
> if (TREE_CODE (TREE_TYPE (node)) == METHOD_TYPE)
> args = TREE_CHAIN (args);
> put_decl_string ("(", 1);
> ! for ( ; args != end_params_node; args = TREE_CHAIN (args), i++)
> {
> if (i > 0)
> put_decl_string (",", 1);
> --- 391,397 ----
> if (TREE_CODE (TREE_TYPE (node)) == METHOD_TYPE)
> args = TREE_CHAIN (args);
> put_decl_string ("(", 1);
> ! for ( ; args && !VOID_TYPE_P (TREE_VALUE (args)); args = TREE_CHAIN (args), i++)
> {
> if (i > 0)
> put_decl_string (",", 1);
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [java] do not ICE when TREE_LIST node was copied
2008-08-28 13:55 ` Richard Guenther
@ 2008-08-28 14:04 ` Jan Hubicka
0 siblings, 0 replies; 3+ messages in thread
From: Jan Hubicka @ 2008-08-28 14:04 UTC (permalink / raw)
To: Richard Guenther; +Cc: Jan Hubicka, gcc-patches
> On Wed, Aug 27, 2008 at 4:01 PM, Jan Hubicka <jh@suse.cz> wrote:
> > Hi,
> > Java langhooks rely on fact that every function type parameter list is terminated
> > by end_params_node TREE_LIST node. This breaks with my new bits for removing operands
> > from functions calls since TREE_LIST node is copied.
> > I don't think it is safe to make this assumption (alternatively I can just make
> > the tree.c bits to preserve last TREE_CHAIN but it is bit painful as it does not work
> > well with nreverse).
> >
> > Bootstrapped/regtested i686-linux.
> > OK?
>
> I think the middle-end uses void_list_node in the same regard
> (it strips that before nreverse and the re-applies it). So I don't think this
> patch is correct.
Indeed it is invalid. I will send updated patch for skip_args code to
preserve void_list_node unduplicated at the end of lists.
Honza
>
> Richard.
>
> > Honza
> > * java/lang.c (put_decl_node): Look for VOID_TYPE node instead of cons.
> > Index: java/lang.c
> > ===================================================================
> > *** java/lang.c (revision 139571)
> > --- java/lang.c (working copy)
> > *************** put_decl_node (tree node)
> > *** 391,397 ****
> > if (TREE_CODE (TREE_TYPE (node)) == METHOD_TYPE)
> > args = TREE_CHAIN (args);
> > put_decl_string ("(", 1);
> > ! for ( ; args != end_params_node; args = TREE_CHAIN (args), i++)
> > {
> > if (i > 0)
> > put_decl_string (",", 1);
> > --- 391,397 ----
> > if (TREE_CODE (TREE_TYPE (node)) == METHOD_TYPE)
> > args = TREE_CHAIN (args);
> > put_decl_string ("(", 1);
> > ! for ( ; args && !VOID_TYPE_P (TREE_VALUE (args)); args = TREE_CHAIN (args), i++)
> > {
> > if (i > 0)
> > put_decl_string (",", 1);
> >
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2008-08-27 14:46 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-08-28 13:40 [java] do not ICE when TREE_LIST node was copied Jan Hubicka
2008-08-28 13:55 ` Richard Guenther
2008-08-28 14:04 ` Jan Hubicka
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).