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]

[PATCH, committed] define_constraint follow-up


	This patch fixes some more problems uncovered in the recent
define_constraint commit.

	The downside of the define_constraint conversion is the explosion
of dependencies.  The new model collects the equivalent of the various
constraint macros and *_OK_FOR_LETTER_P macros into one header used
everywhere.  This introduces three additional levels of complexity:

1) Within a GCC port, all files using the new functions need to be able to
handle the all of the functions where once they only saw the references
from a the subset of macros that they used.

2) The new header needs to be included in all files where they might
be generated or referenced by any port.

3) The files need to provide declarations for any global GCC function or
variable that the new functions from any port reference.

This inevitably includes more headers, creating more dependencies, more
fragility, and more serialization of the GCC build.  I'm not arguing that
the benefit is not worth the sacrifice, but there is a sacrifice.

Bootstrapped on powerpc-ibm-aix5.2.0.0 and powerpc-linux.  Committed as
obvious to fix bootstrap.

David

        * genpreds.c (write_tm_constrs_h): Delete variable p.
        * genconditions.c (write_header): Add tm-constrs.h to included
        headers.
        * genpeep.c (main): Add toplev.h to included headers.
        * Makefile.in (build/gencondmd.o): Add tm-constrs.h dependency.
        (build/genpeep.o): Add toplev.h dependency.
        * config/rs6000/constraints.md: Add "W" constraint.

*** genpreds.c	Mon Mar 27 19:11:56 2006
--- genpreds.c	Wed Mar 29 17:44:52 2006
*************** static void
*** 950,956 ****
  write_tm_constrs_h (void)
  {
    struct constraint_data *c;
-   struct pred_data *p;
  
    printf ("\
  /* Generated automatically by the program '%s'\n\
--- 950,955 ----
*** genconditions.c	Sat Mar 25 15:39:12 2006
--- genconditions.c	Wed Mar 29 17:52:24 2006
*************** write_header (void)
*** 87,93 ****
  #include \"hard-reg-set.h\"\n\
  #include \"resource.h\"\n\
  #include \"toplev.h\"\n\
! #include \"reload.h\"\n");
  
    if (saw_eh_return)
      puts ("#define HAVE_eh_return 1");
--- 87,94 ----
  #include \"hard-reg-set.h\"\n\
  #include \"resource.h\"\n\
  #include \"toplev.h\"\n\
! #include \"reload.h\"\n\
! #include \"tm-constrs.h\"\n");
  
    if (saw_eh_return)
      puts ("#define HAVE_eh_return 1");
*** genpeep.c	Mon Mar 27 18:55:17 2006
--- genpeep.c	Wed Mar 29 18:21:37 2006
*************** from the machine description file `md'. 
*** 378,383 ****
--- 378,384 ----
    printf ("#include \"recog.h\"\n");
    printf ("#include \"except.h\"\n");
    printf ("#include \"function.h\"\n");
+   printf ("#include \"toplev.h\"\n");
    printf ("#include \"tm-constrs.h\"\n\n");
  
    printf ("#ifdef HAVE_peephole\n");
*** Makefile.in	Mon Mar 27 18:56:38 2006
--- Makefile.in	Wed Mar 29 18:54:47 2006
*************** build/vec.o : vec.c $(CONFIG_H) $(SYSTEM
*** 2923,2929 ****
  build/gencondmd.o : build/gencondmd.c $(BCONFIG_H) $(SYSTEM_H)		\
    coretypes.h $(GTM_H) insn-constants.h $(RTL_H) $(TM_P_H)		\
    $(FUNCTION_H) $(REGS_H) $(RECOG_H) $(REAL_H) output.h $(FLAGS_H)	\
!   $(RESOURCE_H) toplev.h reload.h except.h
  
  # ...these are the programs themselves.
  build/genattr.o : genattr.c $(RTL_BASE_H) $(BCONFIG_H) $(SYSTEM_H)	\
--- 2924,2930 ----
  build/gencondmd.o : build/gencondmd.c $(BCONFIG_H) $(SYSTEM_H)		\
    coretypes.h $(GTM_H) insn-constants.h $(RTL_H) $(TM_P_H)		\
    $(FUNCTION_H) $(REGS_H) $(RECOG_H) $(REAL_H) output.h $(FLAGS_H)	\
!   $(RESOURCE_H) toplev.h reload.h except.h tm-constrs.h
  
  # ...these are the programs themselves.
  build/genattr.o : genattr.c $(RTL_BASE_H) $(BCONFIG_H) $(SYSTEM_H)	\
*************** build/genopinit.o : genopinit.c $(RTL_BA
*** 2967,2973 ****
  build/genoutput.o : genoutput.c $(RTL_BASE_H) $(BCONFIG_H) $(SYSTEM_H)	\
    coretypes.h $(GTM_H) errors.h gensupport.h
  build/genpeep.o : genpeep.c $(RTL_BASE_H) $(BCONFIG_H) $(SYSTEM_H)	\
!   coretypes.h $(GTM_H) errors.h gensupport.h
  build/genpreds.o : genpreds.c $(RTL_BASE_H) $(BCONFIG_H) $(SYSTEM_H)	\
    coretypes.h $(GTM_H) errors.h gensupport.h $(OBSTACK_H)
  build/genrecog.o : genrecog.c $(RTL_BASE_H) $(BCONFIG_H) $(SYSTEM_H)	\
--- 2968,2974 ----
  build/genoutput.o : genoutput.c $(RTL_BASE_H) $(BCONFIG_H) $(SYSTEM_H)	\
    coretypes.h $(GTM_H) errors.h gensupport.h
  build/genpeep.o : genpeep.c $(RTL_BASE_H) $(BCONFIG_H) $(SYSTEM_H)	\
!   coretypes.h $(GTM_H) errors.h gensupport.h toplev.h
  build/genpreds.o : genpreds.c $(RTL_BASE_H) $(BCONFIG_H) $(SYSTEM_H)	\
    coretypes.h $(GTM_H) errors.h gensupport.h $(OBSTACK_H)
  build/genrecog.o : genrecog.c $(RTL_BASE_H) $(BCONFIG_H) $(SYSTEM_H)	\
*** config/rs6000/constraints.md	Mon Mar 20 12:36:59 2006
--- config/rs6000/constraints.md	Wed Mar 29 18:16:21 2006
***************
*** 156,158 ****
--- 156,162 ----
  			      || !logical_operand (op, DImode))"))
  	    (not (match_operand 0 "mask_operand")))
         (not (match_operand 0 "mask64_operand"))))
+ 
+ (define_constraint "W"
+   "vector constant that does not require memory"
+   (match_operand 0 "easy_vector_constant"))


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