Patchwork [PR,debug/45673] fix more MEM_REF -fcompare-debug lossage

login
register
mail settings
Submitter Alexandre Oliva
Date Oct. 7, 2010, 5:41 a.m.
Message ID <or7hhuy2yq.fsf@livre.localdomain>
Download mbox | patch
Permalink /patch/66996/
State New
Headers show

Comments

Alexandre Oliva - Oct. 7, 2010, 5:41 a.m.
On Oct  6, 2010, Alexandre Oliva <aoliva@redhat.com> wrote:

>> What we could do is to always print the MEM variant for INTEGER_CST
>> operand zero.  That would make sense anyway as you have no way
>> of guessing the type of operand one by looking at operand zero.
>> A patch to do this is pre-approved if it passes bootstrap & regtest.

> 'k

Here it is.  Regstraped on x86_64-linux-gnu and i686-linux-gnu.  Ok?
Richard Guenther - Oct. 7, 2010, 9:56 a.m.
On Thu, Oct 7, 2010 at 7:41 AM, Alexandre Oliva <aoliva@redhat.com> wrote:
> On Oct  6, 2010, Alexandre Oliva <aoliva@redhat.com> wrote:
>
>>> What we could do is to always print the MEM variant for INTEGER_CST
>>> operand zero.  That would make sense anyway as you have no way
>>> of guessing the type of operand one by looking at operand zero.
>>> A patch to do this is pre-approved if it passes bootstrap & regtest.
>
>> 'k
>
> Here it is.  Regstraped on x86_64-linux-gnu and i686-linux-gnu.  Ok?

Ok.

Thanks,
Richard.

>
>
>
> --
> Alexandre Oliva, freedom fighter    http://FSFLA.org/~lxoliva/
> You must be the change you wish to see in the world. -- Gandhi
> Be Free! -- http://FSFLA.org/   FSF Latin America board member
> Free Software Evangelist      Red Hat Brazil Compiler Engineer
>
>

Patch

for gcc/ChangeLog
from  Alexandre Oliva  <aoliva@redhat.com>

	PR debug/45673
	PR debug/45604
	PR debug/45419
	PR debug/45408
	* tree-pretty-print.c (dump_generic_node): Explicitly dump the
	type of MEM_REFs to INTEGER_CSTs.

Index: gcc/tree-pretty-print.c
===================================================================
--- gcc/tree-pretty-print.c.orig	2010-10-06 02:23:36.533623658 -0300
+++ gcc/tree-pretty-print.c	2010-10-06 05:30:38.002638564 -0300
@@ -801,6 +801,10 @@  dump_generic_node (pretty_printer *buffe
     case MEM_REF:
       {
 	if (integer_zerop (TREE_OPERAND (node, 1))
+	    /* Dump the types of INTEGER_CSTs explicitly, for we can't
+	       infer them and MEM_ATTR caching will share MEM_REFs
+	       with differently-typed op0s.  */
+	    && TREE_CODE (TREE_OPERAND (node, 0)) != INTEGER_CST
 	    /* Same pointer types, but ignoring POINTER_TYPE vs.
 	       REFERENCE_TYPE.  */
 	    && (TREE_TYPE (TREE_TYPE (TREE_OPERAND (node, 0)))
@@ -1163,6 +1167,10 @@  dump_generic_node (pretty_printer *buffe
 	      || (TREE_CODE (op0) == MEM_REF
 		  && TREE_CODE (TREE_OPERAND (op0, 0)) != ADDR_EXPR
 		  && integer_zerop (TREE_OPERAND (op0, 1))
+		  /* Dump the types of INTEGER_CSTs explicitly, for we
+		     can't infer them and MEM_ATTR caching will share
+		     MEM_REFs with differently-typed op0s.  */
+		  && TREE_CODE (TREE_OPERAND (op0, 0)) != INTEGER_CST
 		  /* Same pointer types, but ignoring POINTER_TYPE vs.
 		     REFERENCE_TYPE.  */
 		  && (TREE_TYPE (TREE_TYPE (TREE_OPERAND (op0, 0)))