public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] Handle MEM_REF with non-zero offset in expand_debug_expr
@ 2010-11-04 22:39 Jakub Jelinek
  2010-11-05 10:25 ` Richard Guenther
  0 siblings, 1 reply; 2+ messages in thread
From: Jakub Jelinek @ 2010-11-04 22:39 UTC (permalink / raw)
  To: gcc-patches

Hi!

Each of x86_64-linux and i686-linux bootstrap/regtests triggers
MEM_REF with non-zero offset more than 68000 times, so IMNSHO it
is worth to handle it.

Fixed thusly, bootstrapped/regtested it on x86_64-linux and i686-linux, ok
for trunk?

2010-11-04  Jakub Jelinek  <jakub@redhat.com>

	* cfgexpand.c (expand_debug_expr): Handle MEM_REF
	with non-zero offset.

--- gcc/cfgexpand.c.jj	2010-11-04 20:12:19.000000000 +0100
+++ gcc/cfgexpand.c	2010-11-04 20:46:12.160386088 +0100
@@ -2552,15 +2552,20 @@ expand_debug_expr (tree exp)
       }
 
     case MEM_REF:
-      /* ??? FIXME.  */
-      if (!integer_zerop (TREE_OPERAND (exp, 1)))
-	return NULL;
-      /* Fallthru.  */
     case INDIRECT_REF:
       op0 = expand_debug_expr (TREE_OPERAND (exp, 0));
       if (!op0)
 	return NULL;
 
+      if (TREE_CODE (exp) == MEM_REF)
+	{
+	  op1 = expand_debug_expr (TREE_OPERAND (exp, 1));
+	  if (!op1 || !CONST_INT_P (op1))
+	    return NULL;
+
+	  op0 = plus_constant (op0, INTVAL (op1));
+	}
+
       if (POINTER_TYPE_P (TREE_TYPE (exp)))
 	as = TYPE_ADDR_SPACE (TREE_TYPE (TREE_TYPE (exp)));
       else

	Jakub

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

* Re: [PATCH] Handle MEM_REF with non-zero offset in expand_debug_expr
  2010-11-04 22:39 [PATCH] Handle MEM_REF with non-zero offset in expand_debug_expr Jakub Jelinek
@ 2010-11-05 10:25 ` Richard Guenther
  0 siblings, 0 replies; 2+ messages in thread
From: Richard Guenther @ 2010-11-05 10:25 UTC (permalink / raw)
  To: Jakub Jelinek; +Cc: gcc-patches

On Thu, Nov 4, 2010 at 10:46 PM, Jakub Jelinek <jakub@redhat.com> wrote:
> Hi!
>
> Each of x86_64-linux and i686-linux bootstrap/regtests triggers
> MEM_REF with non-zero offset more than 68000 times, so IMNSHO it
> is worth to handle it.
>
> Fixed thusly, bootstrapped/regtested it on x86_64-linux and i686-linux, ok
> for trunk?

Ok.

Thanks,
Richard.

> 2010-11-04  Jakub Jelinek  <jakub@redhat.com>
>
>        * cfgexpand.c (expand_debug_expr): Handle MEM_REF
>        with non-zero offset.
>
> --- gcc/cfgexpand.c.jj  2010-11-04 20:12:19.000000000 +0100
> +++ gcc/cfgexpand.c     2010-11-04 20:46:12.160386088 +0100
> @@ -2552,15 +2552,20 @@ expand_debug_expr (tree exp)
>       }
>
>     case MEM_REF:
> -      /* ??? FIXME.  */
> -      if (!integer_zerop (TREE_OPERAND (exp, 1)))
> -       return NULL;
> -      /* Fallthru.  */
>     case INDIRECT_REF:
>       op0 = expand_debug_expr (TREE_OPERAND (exp, 0));
>       if (!op0)
>        return NULL;
>
> +      if (TREE_CODE (exp) == MEM_REF)
> +       {
> +         op1 = expand_debug_expr (TREE_OPERAND (exp, 1));
> +         if (!op1 || !CONST_INT_P (op1))
> +           return NULL;
> +
> +         op0 = plus_constant (op0, INTVAL (op1));
> +       }
> +
>       if (POINTER_TYPE_P (TREE_TYPE (exp)))
>        as = TYPE_ADDR_SPACE (TREE_TYPE (TREE_TYPE (exp)));
>       else
>
>        Jakub
>

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

end of thread, other threads:[~2010-11-05 10:21 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-11-04 22:39 [PATCH] Handle MEM_REF with non-zero offset in expand_debug_expr Jakub Jelinek
2010-11-05 10:25 ` Richard Guenther

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