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]
Other format: [Raw text]

RFA: Fix rtl-checking with .md macros


Graham Stott <graham.stott@btinternet.com> writes:
> I've been trying to do some mips bootstraps with rtl checking enabled
> alas these are failing and would fail for any port using the new md
> macro support.
>
> There's an issue rtx with 'T' format nodes being accessed via XSTR
> rather than XTMPL which is trivally fixed.

Ooops, sorry about that.  I hadn't realised we had a separate accessor
for 'T'.  Fixed with the obvious second hunk of the patch below.  But...

> The main problem is we are now storing in rtx CODE and MODE fileds
> values which are beyond NUM_RTX_CODE and NUM_RTX_MODES this doesn't
> play cleanly with RTL checking and causes genconstants to bomb out.

Indeed.  I remember wondering about that at one point, but for some reason
I'd thought that build programs didn't run with checking enabled.  Duh.

I can't think of any way around this other than to disable rtl checking
for read-rtl.c.  It does very few field accesses itself, so I hope that's
acceptable.

Note that read-rtl.c shields the macro codes from other compilation units,
so there should be no impact there.

I've verified that mips64-elf gcc/ now builds with rtl checking enabled.
I'll run a bootstrap on mips-sgi-irix6.5.  OK to commit if succeeds?

Richard


	* read-rtl.c: Disable RTL checking.
	(apply_macro_to_rtx): Use XTMPL to access 'T' fields.

Index: read-rtl.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/read-rtl.c,v
retrieving revision 1.30
diff -c -p -F^\([(a-zA-Z0-9_]\|#define\) -r1.30 read-rtl.c
*** read-rtl.c	27 Aug 2004 10:12:51 -0000	1.30
--- read-rtl.c	29 Aug 2004 20:49:35 -0000
*************** Software Foundation, 59 Temple Place - S
*** 21,26 ****
--- 21,30 ----
  02111-1307, USA.  */
  
  #include "bconfig.h"
+ 
+ /* Disable rtl checking; it conflicts with the macro handling.  */
+ #undef ENABLE_RTL_CHECKING
+ 
  #include "system.h"
  #include "coretypes.h"
  #include "tm.h"
*************** apply_macro_to_rtx (rtx original, struct
*** 316,323 ****
    for (i = 0; format_ptr[i] != 0; i++)
      switch (format_ptr[i])
        {
-       case 'S':
        case 'T':
        case 's':
  	XSTR (x, i) = apply_macro_to_string (XSTR (x, i), macro, value);
  	break;
--- 320,330 ----
    for (i = 0; format_ptr[i] != 0; i++)
      switch (format_ptr[i])
        {
        case 'T':
+ 	XTMPL (x, i) = apply_macro_to_string (XTMPL (x, i), macro, value);
+ 	break;
+ 
+       case 'S':
        case 's':
  	XSTR (x, i) = apply_macro_to_string (XSTR (x, i), macro, value);
  	break;


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