public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* Question on tree-ssa-loop-ivopts.c:constant_multiple_of
@ 2005-06-29 21:42 Richard Kenner
  2005-06-30  2:17 ` Andrew Pinski
  2005-06-30 15:13 ` Zdenek Dvorak
  0 siblings, 2 replies; 4+ messages in thread
From: Richard Kenner @ 2005-06-29 21:42 UTC (permalink / raw)
  To: gcc

Isn't it the case that *any* conversion can be stripped for the purpose
of this routine?  I get an ICE compiling the Ada RTS a-strfix.adb because
of that.  The following seems to fix it, but is it right?

*** tree-ssa-loop-ivopts.c	26 Jun 2005 21:21:32 -0000	2.82
--- tree-ssa-loop-ivopts.c	29 Jun 2005 21:38:29 -0000
*************** constant_multiple_of (tree type, tree to
*** 2594,2599 ****
    bool negate;
  
!   STRIP_NOPS (top);
!   STRIP_NOPS (bot);
  
    if (operand_equal_p (top, bot, 0))
--- 2594,2603 ----
    bool negate;
  
!   /* For determining the condition above, we can ignore all conversions, not
!      just those that don't change the mode, so can't use STRIP_NOPS here. */
!   while (TREE_CODE (top) == NOP_EXPR || TREE_CODE (top) == CONVERT_EXPR)
!     top = TREE_OPERAND (top, 0);
!   while (TREE_CODE (bot) == NOP_EXPR || TREE_CODE (bot) == CONVERT_EXPR)
!     bot = TREE_OPERAND (bot, 0);
  
    if (operand_equal_p (top, bot, 0))

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

* Re: Question on tree-ssa-loop-ivopts.c:constant_multiple_of
  2005-06-29 21:42 Question on tree-ssa-loop-ivopts.c:constant_multiple_of Richard Kenner
@ 2005-06-30  2:17 ` Andrew Pinski
  2005-06-30 15:13 ` Zdenek Dvorak
  1 sibling, 0 replies; 4+ messages in thread
From: Andrew Pinski @ 2005-06-30  2:17 UTC (permalink / raw)
  To: Richard Kenner; +Cc: gcc


On Jun 29, 2005, at 5:44 PM, Richard Kenner wrote:

> Isn't it the case that *any* conversion can be stripped for the purpose
> of this routine?  I get an ICE compiling the Ada RTS a-strfix.adb 
> because
> of that.  The following seems to fix it, but is it right?

This is PR 22212: http://gcc.gnu.org/PR22212,

Thanks,
Andrew Pinski

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

* Re: Question on tree-ssa-loop-ivopts.c:constant_multiple_of
  2005-06-29 21:42 Question on tree-ssa-loop-ivopts.c:constant_multiple_of Richard Kenner
  2005-06-30  2:17 ` Andrew Pinski
@ 2005-06-30 15:13 ` Zdenek Dvorak
  1 sibling, 0 replies; 4+ messages in thread
From: Zdenek Dvorak @ 2005-06-30 15:13 UTC (permalink / raw)
  To: Richard Kenner; +Cc: gcc

Hello,

> Isn't it the case that *any* conversion can be stripped for the purpose
> of this routine?  I get an ICE compiling the Ada RTS a-strfix.adb because
> of that.  The following seems to fix it, but is it right?

no, it is not.  The uses of constant_multiple_of expect that it
determines whether TOP = CST * BOT, except for no-op casts.  It is true
that there are some sequences of casts that in the end satisfy this, but
are not handled by constant_multiple_of, but you would need to be more
careful when changing it.

The bug you describe most probably is PR 21963 (and there is a patch for
this PR submitted).

Zdenek

> *** tree-ssa-loop-ivopts.c	26 Jun 2005 21:21:32 -0000	2.82
> --- tree-ssa-loop-ivopts.c	29 Jun 2005 21:38:29 -0000
> *************** constant_multiple_of (tree type, tree to
> *** 2594,2599 ****
>     bool negate;
>   
> !   STRIP_NOPS (top);
> !   STRIP_NOPS (bot);
>   
>     if (operand_equal_p (top, bot, 0))
> --- 2594,2603 ----
>     bool negate;
>   
> !   /* For determining the condition above, we can ignore all conversions, not
> !      just those that don't change the mode, so can't use STRIP_NOPS here. */
> !   while (TREE_CODE (top) == NOP_EXPR || TREE_CODE (top) == CONVERT_EXPR)
> !     top = TREE_OPERAND (top, 0);
> !   while (TREE_CODE (bot) == NOP_EXPR || TREE_CODE (bot) == CONVERT_EXPR)
> !     bot = TREE_OPERAND (bot, 0);
>   
>     if (operand_equal_p (top, bot, 0))

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

* Re: Question on tree-ssa-loop-ivopts.c:constant_multiple_of
@ 2005-06-30 16:28 Richard Kenner
  0 siblings, 0 replies; 4+ messages in thread
From: Richard Kenner @ 2005-06-30 16:28 UTC (permalink / raw)
  To: rakdver; +Cc: gcc

    The bug you describe most probably is PR 21963 (and there is a patch for
    this PR submitted).

Actually, I found out after my email that the exact case I found is
PR22212, but 21963 does look like the same symptom.  What's the status
of this patch?

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

end of thread, other threads:[~2005-06-30 16:28 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-06-29 21:42 Question on tree-ssa-loop-ivopts.c:constant_multiple_of Richard Kenner
2005-06-30  2:17 ` Andrew Pinski
2005-06-30 15:13 ` Zdenek Dvorak
2005-06-30 16:28 Richard Kenner

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