Bug 19528 - [4.0 regression] missing ra.h
Summary: [4.0 regression] missing ra.h
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: target (show other bugs)
Version: 4.0.0
: P3 normal
Target Milestone: 4.0.0
Assignee: Not yet assigned to anyone
URL:
Keywords: build
Depends on:
Blocks:
 
Reported: 2005-01-19 09:52 UTC by Ralf Corsepius
Modified: 2005-04-20 02:02 UTC (History)
4 users (show)

See Also:
Host:
Target: sh-rtems, sh-unknown-elf
Build:
Known to work:
Known to fail:
Last reconfirmed: 2005-01-19 12:26:17


Attachments
The version of Steven's patch, I am currently using. (571 bytes, patch)
2005-01-19 21:42 UTC, Ralf Corsepius
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ralf Corsepius 2005-01-19 09:52:03 UTC
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.
Comment 1 Steven Bosscher 2005-01-19 12:21:59 UTC
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 */ 
 
Comment 2 Steven Bosscher 2005-01-19 12:26:17 UTC
...and remove the #include "ra.h" of course. 
 
Paolo, you should also update doc/passes.texi, which also still 
has references to new-ra. 
 
Comment 3 paolo.bonzini@lu.unisi.ch 2005-01-19 12:55:09 UTC
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
Comment 4 Paolo Bonzini 2005-01-19 13:27:00 UTC
I've fixed the doc/passes.texi (commit in progress).
Comment 5 Paolo Bonzini 2005-01-19 13:47:05 UTC
Steven, building cc1 to sh-unknown-elf with your patch succeeded.
Comment 6 Ralf Corsepius 2005-01-19 16:35:17 UTC
(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.
Comment 7 Steven Bosscher 2005-01-19 18:59:55 UTC
Good.  Ralf, can you post it? 
Comment 8 Ralf Corsepius 2005-01-19 21:42:00 UTC
Created attachment 7996 [details]
The version of Steven's patch, I am currently using.
Comment 9 Mark Mitchell 2005-01-21 17:33:15 UTC
SH is not a primary or secondary platform; removing target milestone.
Comment 10 Steven Bosscher 2005-01-22 12:19:49 UTC
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? 
 
Comment 11 Joel Sherrill 2005-01-22 12:57:49 UTC
(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.
Comment 12 Mark Mitchell 2005-01-22 19:43:52 UTC
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.

Comment 13 Andrew Pinski 2005-01-24 16:21:52 UTC
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.