This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [patch] gcse.c: Fix the header ordering.
Hi Graham,
> > rtx dest = SET_DEST (sset);
> > if ((REG_P (dest) || CC0_P (dest))
> > && cprop_jump (BLOCK_FOR_INSN (insn), insn, NEXT_INSN (insn), from, to))
> >
> > Since rtl.h is included before insn-config.h, which contains HAVE_cc0,
> > CC0_P is defined to be 0, so the above "if" statement doesn't let us
> > call cprop_jump at all.
> Actually it will if dest is a REG rtx :-)
Right. :-)
> > A quick grep shows that combine.c also uses CC0_P but includes
> > insn-config.h after rtl.h. I haven't seen what happens if I correct
> > the order.
> >
> > I am going to run the testsuite with the patch below, but the problem
> > seems to be a little deeper. Should rtl.h include insn-config.h?
> > Should rtl.h give an error if insn-config.h is not included yet?
> I think rtl.h should include insn-config.
>
> Note in the not to distant past such nested included were discouraged but
> it would appear that that position has changed because grepping for
> "#include" in *.h files within the gcc directory gets quite a few hits.
Discouraged for simplicity? Or for a little more specific reason?
I just put insn-config.h before rtl.h in combine.c, the generated code
seems to get slightly better. (That is, CC0_P in combine.c is now
triggered.)
Anyway, grepping in *.c arena is scary. A lot of files include
insn-config.h after rtl.h...
Kazu Hirata