This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Alias code


>>>>> "Jeffrey" == Jeffrey A Law <law@hurl.cygnus.com> writes:

    Jeffrey> ps.  i just spent 3hrs tracking down a case where the
    Jeffrey> compiler would mis-compile a testcase, but not if you
    Jeffrey> turned on -g or certain debug dumps -- it was tracked
    Jeffrey> down to a call to gen_rtx (MEM) in a target config file.
    Jeffrey> I don't want to have to do this very often :(

Right.  I thought of this problem, and had meant to do something about
it, but forgot.  I apologize profusely for wasting your time.

I think the only thing we can do is modify gen_rtx to special case
MEM.  BTW, configuring with --enable-checking and compiling with
-fno-strict-aliasing might help; the type-based aliasing code will
then abort if there's ever a MEM that is *not* in alias set zero.

How about this patch?

-- 
Mark Mitchell 			mark@markmitchell.com
Mark Mitchell Consulting	http://www.markmitchell.com

Mon Jun 29 08:45:08 1998  Mark Mitchell  <mark@markmitchell.com>

	* rtl.h: Update comment about special gen_rtx variants.
	* emit-rtl.c (gen_rtx): Handle MEMs using gen_rtx_MEM.

Index: rtl.h
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/rtl.h,v
retrieving revision 1.39
diff -c -p -r1.39 rtl.h
*** rtl.h	1998/06/27 15:51:48	1.39
--- rtl.h	1998/06/29 15:42:44
*************** extern rtx static_chain_incoming_rtx;
*** 1070,1076 ****
  
  /* There are some RTL codes that require special attention; the
     generation functions included above do the raw handling.  If you
!    add to this list, modify special_rtx in gengenrtl.c as well.  */
  
  extern rtx gen_rtx_CONST_INT PROTO((enum machine_mode, HOST_WIDE_INT));
  extern rtx gen_rtx_REG PROTO((enum machine_mode, int));
--- 1070,1077 ----
  
  /* There are some RTL codes that require special attention; the
     generation functions included above do the raw handling.  If you
!    add to this list, modify special_rtx in gengenrtl.c as well.  You
!    should also modify gen_rtx to use the special function.  */
  
  extern rtx gen_rtx_CONST_INT PROTO((enum machine_mode, HOST_WIDE_INT));
  extern rtx gen_rtx_REG PROTO((enum machine_mode, int));
Index: emit-rtl.c
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/emit-rtl.c,v
retrieving revision 1.30
diff -c -p -r1.30 emit-rtl.c
*** emit-rtl.c	1998/06/25 15:14:34	1.30
--- emit-rtl.c	1998/06/29 15:42:53
*************** gen_rtx VPROTO((enum rtx_code code, enum
*** 365,370 ****
--- 365,372 ----
      rt_val = gen_rtx_CONST_INT (mode, va_arg (p, HOST_WIDE_INT));
    else if (code == REG)
      rt_val = gen_rtx_REG (mode, va_arg (p, int));
+   else if (code == MEM)
+     rt_val = gen_rtx_MEM (mode, va_arg (p, rtx));
    else
      {
        rt_val = rtx_alloc (code);	/* Allocate the storage space.  */


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]