public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* [tree-ssa] GIMPLE grammar changes in function calls.
@ 2003-05-24  3:57 Diego Novillo
  2003-05-24  4:08 ` Diego Novillo
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Diego Novillo @ 2003-05-24  3:57 UTC (permalink / raw)
  To: Jason Merrill; +Cc: gcc

Jason,

Right now is_simple_unary_expr is causing us to accept this as a gimple
statement:

p = (char *)malloc(100);

This causes every optimizer that needs to see if that is a function call
to fail (this showed up in libmudflap.c/pass36-frag.c).  To detect
whether the statement is a function call the optimizers test:

if (TREE_CODE (stmt) == CALL_EXPR
    || (TREE_CODE (stmt) == MODIFY_EXPR
         && TREE_CODE (TREE_OPERAND (stmt, 1)) == CALL_EXPR))

This now fails because of the NOP_EXPR on the RHS.

Removing the STRIP_NOPS we have now at the start of is_simple_unary_expr
would make things work again (at the expense of forcing the gimplifier
to create a new temporary).

This is a change in the GIMPLE grammar.  Do we want to change it?  This
means making CALL_EXPR detection a bit more cumbersome.

Another alternative is to call STRIP_NOPS *after* we check for
(cast)varname in is_simple_unary_expr.


Thoughts?


Diego.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [tree-ssa] GIMPLE grammar changes in function calls.
  2003-05-24  3:57 [tree-ssa] GIMPLE grammar changes in function calls Diego Novillo
@ 2003-05-24  4:08 ` Diego Novillo
  2003-05-24  9:08   ` Jason Merrill
  2003-05-24  4:58 ` Jason Merrill
  2003-05-27 14:49 ` Jason Merrill
  2 siblings, 1 reply; 6+ messages in thread
From: Diego Novillo @ 2003-05-24  4:08 UTC (permalink / raw)
  To: Jason Merrill; +Cc: gcc

On Fri, 2003-05-23 at 23:55, Diego Novillo wrote:

> Removing the STRIP_NOPS we have now at the start of is_simple_unary_expr
> would make things work again (at the expense of forcing the gimplifier
> to create a new temporary).
> 
> This is a change in the GIMPLE grammar.  Do we want to change it?  This
> means making CALL_EXPR detection a bit more cumbersome.
> 
I meant that having the STRIP_NOPS at the start of is_simple_unary_expr
is a change in the GIMPLE grammar.  Sorry.


Diego.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [tree-ssa] GIMPLE grammar changes in function calls.
  2003-05-24  3:57 [tree-ssa] GIMPLE grammar changes in function calls Diego Novillo
  2003-05-24  4:08 ` Diego Novillo
@ 2003-05-24  4:58 ` Jason Merrill
  2003-05-27 14:49 ` Jason Merrill
  2 siblings, 0 replies; 6+ messages in thread
From: Jason Merrill @ 2003-05-24  4:58 UTC (permalink / raw)
  To: Diego Novillo; +Cc: gcc

On 23 May 2003 23:55:33 -0400, Diego Novillo <dnovillo@redhat.com> wrote:

> Right now is_simple_unary_expr is causing us to accept this as a gimple
> statement:
>
> p = (char *)malloc(100);

Well, that's wrong.

> Removing the STRIP_NOPS we have now at the start of is_simple_unary_expr
> would make things work again (at the expense of forcing the gimplifier
> to create a new temporary).

Sounds right to me.

Jason

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [tree-ssa] GIMPLE grammar changes in function calls.
  2003-05-24  4:08 ` Diego Novillo
@ 2003-05-24  9:08   ` Jason Merrill
  0 siblings, 0 replies; 6+ messages in thread
From: Jason Merrill @ 2003-05-24  9:08 UTC (permalink / raw)
  To: Diego Novillo; +Cc: gcc

On 24 May 2003 00:07:04 -0400, Diego Novillo <dnovillo@redhat.com> wrote:

> On Fri, 2003-05-23 at 23:55, Diego Novillo wrote:
>
>> Removing the STRIP_NOPS we have now at the start of is_simple_unary_expr
>> would make things work again (at the expense of forcing the gimplifier
>> to create a new temporary).
>> 
>> This is a change in the GIMPLE grammar.  Do we want to change it?  This
>> means making CALL_EXPR detection a bit more cumbersome.
>> 
> I meant that having the STRIP_NOPS at the start of is_simple_unary_expr
> is a change in the GIMPLE grammar.  Sorry.

Right.  Unless we want to allow NOPs everywhere, and I don't think we do,
the STRIP_NOPS must go.

Jason

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [tree-ssa] GIMPLE grammar changes in function calls.
  2003-05-24  3:57 [tree-ssa] GIMPLE grammar changes in function calls Diego Novillo
  2003-05-24  4:08 ` Diego Novillo
  2003-05-24  4:58 ` Jason Merrill
@ 2003-05-27 14:49 ` Jason Merrill
  2003-05-27 14:52   ` Diego Novillo
  2 siblings, 1 reply; 6+ messages in thread
From: Jason Merrill @ 2003-05-27 14:49 UTC (permalink / raw)
  To: Diego Novillo; +Cc: gcc

On 23 May 2003 23:55:33 -0400, Diego Novillo <dnovillo@redhat.com> wrote:

> Removing the STRIP_NOPS we have now at the start of is_simple_unary_expr
> would make things work again (at the expense of forcing the gimplifier
> to create a new temporary).

Looks like you already removed it.  I strongly support this change.

> This is a change in the GIMPLE grammar.  Do we want to change it?  This
> means making CALL_EXPR detection a bit more cumbersome.

No.  We want to remove the STRIP_NOPS.

> Another alternative is to call STRIP_NOPS *after* we check for
> (cast)varname in is_simple_unary_expr.

Why?

Jason

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [tree-ssa] GIMPLE grammar changes in function calls.
  2003-05-27 14:49 ` Jason Merrill
@ 2003-05-27 14:52   ` Diego Novillo
  0 siblings, 0 replies; 6+ messages in thread
From: Diego Novillo @ 2003-05-27 14:52 UTC (permalink / raw)
  To: Jason Merrill; +Cc: gcc

On Tue, 2003-05-27 at 10:43, Jason Merrill wrote:
> On 23 May 2003 23:55:33 -0400, Diego Novillo <dnovillo@redhat.com> wrote:
> 
> > Removing the STRIP_NOPS we have now at the start of is_simple_unary_expr
> > would make things work again (at the expense of forcing the gimplifier
> > to create a new temporary).
> 
> Looks like you already removed it.  I strongly support this change.
> 
Ah, yes.  I think I mentioned it in my check-in message for the 'remove
INDIRECT_REFs' patch, but I'm having trouble with my mail today.

> > This is a change in the GIMPLE grammar.  Do we want to change it?  This
> > means making CALL_EXPR detection a bit more cumbersome.
> 
> No.  We want to remove the STRIP_NOPS.
> 
Good.

> > Another alternative is to call STRIP_NOPS *after* we check for
> > (cast)varname in is_simple_unary_expr.
> 
> Why?
> 
Not important anymore.  This was just a third alternative in case you
didn't like removing the STRIP_NOPS to begin with :)


Diego.

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2003-05-27 14:49 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-05-24  3:57 [tree-ssa] GIMPLE grammar changes in function calls Diego Novillo
2003-05-24  4:08 ` Diego Novillo
2003-05-24  9:08   ` Jason Merrill
2003-05-24  4:58 ` Jason Merrill
2003-05-27 14:49 ` Jason Merrill
2003-05-27 14:52   ` Diego Novillo

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).