Today's (2005-01-19) gcc trunk does not build for sh-rtems*: ... make[1]: Entering directory `/users/rtems/src/rpms/BUILD/rtems-4.7-sh-rtems4.7-gcc-newlib-gcc4.0.0newlib1.13.0/build/gcc' gcc -c -g -O2 -DIN_GCC -DCROSS_COMPILE -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -fno-common -DHAVE_CONFIG_H -I. -I. -I../../gcc-4.0.0/gcc -I../../gcc-4.0.0/gcc/. -I../../gcc-4.0.0/gcc/../include -I../../gcc-4.0.0/gcc/../libcpp/include \ ../../gcc-4.0.0/gcc/config/sh/sh.c -o sh.o ../../gcc-4.0.0/gcc/config/sh/sh.c:50:16: ra.h: No such file or directory ../../gcc-4.0.0/gcc/config/sh/sh.c: In function `push_regs': ../../gcc-4.0.0/gcc/config/sh/sh.c:5049: warning: implicit declaration of function `hard_regs_intersect_p' make[1]: *** [sh.o] Error 1 make[1]: Leaving directory `/users/rtems/src/rpms/BUILD/rtems-4.7-sh-rtems4.7-gcc-newlib-gcc4.0.0newlib1.13.0/build/gcc' As it seems to me, this patch might have broken the sh: 2005-01-17 Paolo Bonzini <bonzini@gnu.org> * common.opt (-fnew-ra): Remove. * ra*.*: Remove. * toplev.h (flag_new_regalloc): Remove. * Makefile.in (ra*.*): Don't mention. * passes.c (rest_of_handle_new_regalloc): Remove. (rest_of_handle_combine, rest_of_compilation): Always consider flag_new_regalloc as false. * doc/invoke.texi: Don't document -fnew-ra.
I am not even going to try and look surprised, the SH port is a major abuser of the middle-end. But of course, hard_regs_intersect_p should have been in hard-reg-set.h from the start, *sigh*, mess-meets-mess. Try this: Index: hard-reg-set.h =================================================================== RCS file: /cvs/gcc/gcc/gcc/hard-reg-set.h,v retrieving revision 1.25 diff -u -3 -p -r1.25 hard-reg-set.h --- hard-reg-set.h 15 Jan 2005 16:06:14 -0000 1.25 +++ hard-reg-set.h 19 Jan 2005 12:21:01 -0000 @@ -499,4 +499,19 @@ extern const char * reg_class_names[]; #define REG_CANNOT_CHANGE_MODE_P(REGN, FROM, TO) \ CANNOT_CHANGE_MODE_CLASS (FROM, TO, REGNO_REG_CLASS (REGN)) +/* Determine if two hard register sets intersect. + Return 1 if they do. */ + +static inline bool +hard_regs_intersect_p (HARD_REG_SET *a, HARD_REG_SET *b) +{ + HARD_REG_SET c; + COPY_HARD_REG_SET (c, *a); + AND_HARD_REG_SET (c, *b); + GO_IF_HARD_REG_SUBSET (c, reg_class_contents[(int) NO_REGS], lose); + return 1; +lose: + return 0; +} + #endif /* ! GCC_HARD_REG_SET_H */
...and remove the #include "ra.h" of course. Paolo, you should also update doc/passes.texi, which also still has references to new-ra.
Subject: Re: [4.0 regression] missing ra.h steven at gcc dot gnu dot org wrote: > ------- Additional Comments From steven at gcc dot gnu dot org 2005-01-19 12:26 ------- > ...and remove the #include "ra.h" of course. Doh. I'm sorry for the breakage, but why the heck does the SH back-end have to include it? Why does the SH back-end have to behave different from every other one?^A^K Paolo
I've fixed the doc/passes.texi (commit in progress).
Steven, building cc1 to sh-unknown-elf with your patch succeeded.
(In reply to comment #5) > Steven, building cc1 to sh-unknown-elf with your patch succeeded. Building sh-rtems4.7 with Steven's patch also succeeds.
Good. Ralf, can you post it?
Created attachment 7996 [details] The version of Steven's patch, I am currently using.
SH is not a primary or secondary platform; removing target milestone.
Mark, while you're using your RM powers to move the target milestone on this one, could you also please use your GWP powers to approve the simple patch http://gcc.gnu.org/ml/gcc-patches/2005-01/msg01258.html that fixes this bug?
(In reply to comment #10) > Mark, while you're using your RM powers to move the target milestone on > this one, could you also please use your GWP powers to approve the simple > patch http://gcc.gnu.org/ml/gcc-patches/2005-01/msg01258.html that fixes > this bug? > I can confirm that sh-rtems builds with this patch and won't without it. The resulting compiler will also build RTEMS. No sh target builds without this fix so I am also politely asking this to be committed.
Subject: Re: [4.0 regression] missing ra.h joel at gcc dot gnu dot org wrote: > ------- Additional Comments From joel at gcc dot gnu dot org 2005-01-22 12:57 ------- > (In reply to comment #10) > >>Mark, while you're using your RM powers to move the target milestone on >>this one, could you also please use your GWP powers to approve the simple >>patch http://gcc.gnu.org/ml/gcc-patches/2005-01/msg01258.html that fixes >>this bug? >> > > > I can confirm that sh-rtems builds with this patch and won't without it. > The resulting compiler will also build RTEMS. > > No sh target builds without this fix so I am also politely asking this to > be committed. The patch should says "Returns true" rather than "Returns 1" in the comment; OK with that change.
Fixed by: 2005-01-24 J"orn Rennecke <joern.rennecke@st.com> * sh.c (ra.h): Don't #include. (hard_regs_intersect_p): New function, resurrected from ra.c. * sh.c: Fix 1996 Copyright.