This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: define_constraints patch, re-revised
On Mon, Mar 27, 2006 at 11:17:07AM -0500, David Edelsohn wrote:
> >>>>> Bernd Schmidt writes:
>
> Bernd> libbackend.a(insn-recog.o): In function `split_2':
> Bernd> ../../trunk/gcc/config/i386/i386.md:19150: undefined reference to
> Bernd> `satisfies_constraint_K'
>
> Hmm, it didn't show up the same way in my build because I do not
> have a full set of x86 cross-tools. So, we just have genrecog.c add the
> header too. And genoutput.c as well because cris seems to use the old
> macro in that way.
You probably want to do genpeep too? I *think* that's the complete set
of places where C code from the MD can appear.
I don't understand why you're putting tm-constrs.h in tm_p_file_list,
since tm_p.h *doesn't* include it ... shouldn't you just be updating the
header file lists for the individual files that do need it?
Also ...
> ! write_tm_constrs_h (void)
> {
> struct constraint_data *c;
> + struct pred_data *p;
> +
> + printf ("\
> + /* Generated automatically by the program '%s'\n\
> + from the machine description file '%s'. */\n\n", progname, in_fname);
> +
> + puts ("\
> + #ifndef GCC_TM_CONSTRS_H\n\
> + #define GCC_TM_CONSTRS_H\n\
> + \n\
> + #ifdef HAVE_MACHINE_MODES");
> +
> + FOR_ALL_PREDICATES (p)
> + printf ("extern int %s (rtx, enum machine_mode);\n", p->name);
> +
> + puts ("#endif /* HAVE_MACHINE_MODES */\n");
Why duplicate the predicate prototypes into this header? All files that
see it should be including tm_p.h already, ne?
> + else if (gen_constrs
> + && (have_const_int_constraints
> + || have_const_dbl_constraints
> + || have_extra_constraints))
> + write_tm_constrs_h ();
Better to remove the have_* check here, so that you don't get a totally
empty file if there are no functions to generate, I think.
zw