public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* Re: Question on cfg_remove_useless_stmts_bb
@ 2004-08-18 11:51 Richard Kenner
  0 siblings, 0 replies; 11+ messages in thread
From: Richard Kenner @ 2004-08-18 11:51 UTC (permalink / raw)
  To: law; +Cc: gcc

    You might want to add a suitable comment while you're in there

Most certainly.

^ permalink raw reply	[flat|nested] 11+ messages in thread
* Re: Question on cfg_remove_useless_stmts_bb
@ 2004-08-18 11:52 Richard Kenner
  2004-09-01  6:22 ` Jeffrey A Law
  0 siblings, 1 reply; 11+ messages in thread
From: Richard Kenner @ 2004-08-18 11:52 UTC (permalink / raw)
  To: law; +Cc: gcc

    the fact that it wasn't obvious to you is a good indication that I
    should have had more comments in that code.

Actually, there's still some confusion there.  Now that you've pointed it
out, from the way I read that code, VAL is always either a PARM_DECL or
a VAR_DECL.  So why test !TREE_CONSTANT (val)?

And why exclude a constant anyway

^ permalink raw reply	[flat|nested] 11+ messages in thread
* Re: Question on cfg_remove_useless_stmts_bb
@ 2004-08-17 16:49 Richard Kenner
  2004-08-18  8:42 ` Jeffrey A Law
  0 siblings, 1 reply; 11+ messages in thread
From: Richard Kenner @ 2004-08-17 16:49 UTC (permalink / raw)
  To: law; +Cc: gcc

    VAL can only be a _DECL node or a constant.  

I missed that part.  Thanks.

So I'll test and then commit that trivial change.

^ permalink raw reply	[flat|nested] 11+ messages in thread
* Re: Question on cfg_remove_useless_stmts_bb
@ 2004-08-17 12:31 Richard Kenner
  2004-08-17 15:49 ` Jeffrey A Law
  0 siblings, 1 reply; 11+ messages in thread
From: Richard Kenner @ 2004-08-17 12:31 UTC (permalink / raw)
  To: law; +Cc: gcc

      if (TREE_CODE (stmt) == ASM_EXPR
          || (TREE_CODE (stmt) == MODIFY_EXPR
              && (TREE_OPERAND (stmt, 0) == var
                  || TREE_CODE (stmt, 0) == val)))

    Ought to do the trick.

In this case, yes, but I'm not convinced that it's complete.  Couldn't
VAL be a more complex expression here and we have to verify that none of
its operands were modified?  That issue is basically the other motivation
for my query (the primary one being, of course, "how did this ever work?"!).

^ permalink raw reply	[flat|nested] 11+ messages in thread
* Re: Question on cfg_remove_useless_stmts_bb
@ 2004-08-13 21:29 Richard Kenner
  0 siblings, 0 replies; 11+ messages in thread
From: Richard Kenner @ 2004-08-13 21:29 UTC (permalink / raw)
  To: dnovillo; +Cc: gcc

    On a clean tree?  

No, on my tree.  But I still need to understand what's causing it,
hence my questions.

^ permalink raw reply	[flat|nested] 11+ messages in thread
* Question on cfg_remove_useless_stmts_bb
@ 2004-08-13 19:59 Richard Kenner
  2004-08-13 20:19 ` Diego Novillo
  2004-08-17  8:26 ` Jeffrey A Law
  0 siblings, 2 replies; 11+ messages in thread
From: Richard Kenner @ 2004-08-13 19:59 UTC (permalink / raw)
  To: gcc

I'm getting a failure on c-torture/execute/930513-2.c with -O3 and what's
happening is that the out of ssa pass is looking at 

  if (j != i) goto <L1>; else goto <L2>;

    ...

<L2>:;
  i = i + 1;
  j = i;


The cfg_remove_useless_stmts_bb knows that J and I are equal.  So when it
gets to the "j = i" assignment, it deletes it.  The problem is that it
doesn't notice that "i = i + 1" clobbers the equality relation.

I don't think it's sufficient to test for an assignment to VAL here because
I think VAL can be an expression since we are no longer in GIMPLE, but
I'm not sure.

Hence my question.

I don't know why this test isn't failing for everybody, so I suspect this
is some sort of latent bug somehow.  (Or else I'm missing something,
which is quite possible.)

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

end of thread, other threads:[~2004-09-01  6:22 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-08-18 11:51 Question on cfg_remove_useless_stmts_bb Richard Kenner
  -- strict thread matches above, loose matches on Subject: below --
2004-08-18 11:52 Richard Kenner
2004-09-01  6:22 ` Jeffrey A Law
2004-08-17 16:49 Richard Kenner
2004-08-18  8:42 ` Jeffrey A Law
2004-08-17 12:31 Richard Kenner
2004-08-17 15:49 ` Jeffrey A Law
2004-08-13 21:29 Richard Kenner
2004-08-13 19:59 Richard Kenner
2004-08-13 20:19 ` Diego Novillo
2004-08-17  8:26 ` Jeffrey A Law

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