define_constraints patch, re-revised

Zack Weinberg zackw@panix.com
Mon Mar 20 03:10:00 GMT 2006


On Sun, Mar 19, 2006 at 06:40:00PM -0500, David Edelsohn wrote:
> 	I tried converting the PowerPC port to define_constrants and ran
> into a problem that only appeared in the last re-revision of the patch.
> The end of write_tm_preds_h() is:
> 
>      if (have_const_int_constraints || have_const_dbl_constraints
>          || have_extra_constraints)
>        write_satisfies_constraint_fns ();
> 
> write_insn_preds_c() outputs the #include directives for header files, but
> tm_p.h (which includes tm-preds.h) occurs fairly early -- before a number
> of header files declaring functions and variable that can be referenced by
> the satisfies_constraints functions.

Bleah.  I knew the inline per-constraint functions were going to be trouble.

> 	PowerPC constraints reference exact_log2, which produces implicit
> declaration warning, and fixed_regs, which produces undeclared error when
> compiling build/gencondmd.c.
> 
> 	Was there a specific purpose in the current ordering of the header
> file inclusion?

No, it was just the way it was done before.  

I have no better suggestion than that you move the #include "tm_p.h"
to the very bottom of the #include stack in every file that trips over
this.  I believe this is safe, since the only things in CPU-protos.h
and tm-preds.h are function declarations + these inlines, and nothing
in other headers should need to see them.

zw



More information about the Gcc-patches mailing list