This patch: http://gcc.gnu.org/ml/gcc-patches/2005-09/msg01279.html breaks ia64. I got /net/gnu-13/export/gnu/src/gcc/gcc/gcc/final.c: In function `get_attr_length': /net/gnu-13/export/gnu/src/gcc/gcc/gcc/final.c:454: error: `insn_default_length' undeclared (first use in this function) /net/gnu-13/export/gnu/src/gcc/gcc/gcc/final.c:454: error: (Each undeclared identifier is reported only once /net/gnu-13/export/gnu/src/gcc/gcc/gcc/final.c:454: error: for each function it appears in.) /net/gnu-13/export/gnu/src/gcc/gcc/gcc/final.c: In function `get_attr_min_length': /net/gnu-13/export/gnu/src/gcc/gcc/gcc/final.c:462: error: `insn_min_length' undeclared (first use in this function)
Confirmed, it is kinda of interesting that IA64 is one of the few targets which does not have the length attr (or have HAVE_ATTR_length defined). The easy fix is the following: int get_attr_length (rtx insn) { #ifdef HAVE_ATTR_length return get_attr_length_1 (insn, insn_default_length); #else return get_attr_length_1 (insn, 0); #endif }
Subject: Re: [4.1 Regression]: Gcc failed to build on ia64 pinskia at gcc dot gnu dot org wrote: >------- Additional Comments From pinskia at gcc dot gnu dot org 2005-09-21 11:28 ------- >Confirmed, it is kinda of interesting that IA64 is one of the few targets which does not have the length >attr (or have HAVE_ATTR_length defined). > >The easy fix is the following: >int >get_attr_length (rtx insn) >{ >#ifdef HAVE_ATTR_length > return get_attr_length_1 (insn, insn_default_length); >#else > return get_attr_length_1 (insn, 0); >#endif >} > > > We have to cover both get_attr_length and get_attr_min_length. I think the attached patch is a cleaner solution. 2005-09-21 J"orn Rennecke <joern.rennecke@st.com> * final.c (get_attr_length_1): In !HAVE_ATTR_length case, define as macro. Don't attach ATTRIBUTE_UNUSED to arguments. (get_attr_length, get_attr_min_length): Add ATTRIBUTE_UNUSED. --- final.c 2005-09-20 22:41:08.000000000 +0100 +++ final.c-fixed 2005-09-21 14:58:05.000000000 +0100 @@ -385,11 +385,10 @@ init_insn_lengths (void) /* Obtain the current length of an insn. If branch shortening has been done, get its actual length. Otherwise, use FALLBACK_FN to calcualte the length. */ +#ifdef HAVE_ATTR_length static inline int -get_attr_length_1 (rtx insn ATTRIBUTE_UNUSED, - int (*fallback_fn) (rtx) ATTRIBUTE_UNUSED) +get_attr_length_1 (rtx insn, int (*fallback_fn) (rtx)) { -#ifdef HAVE_ATTR_length rtx body; int i; int length = 0; @@ -441,15 +440,15 @@ get_attr_length_1 (rtx insn ATTRIBUTE_UN ADJUST_INSN_LENGTH (insn, length); #endif return length; +} #else /* not HAVE_ATTR_length */ - return 0; +#define get_attr_length_1(insn,fallback_fn) 0 #endif /* not HAVE_ATTR_length */ -} /* Obtain the current length of an insn. If branch shortening has been done, get its actual length. Otherwise, get its maximum length. */ int -get_attr_length (rtx insn) +get_attr_length (rtx insn ATTRIBUTE_UNUSED) { return get_attr_length_1 (insn, insn_default_length); } @@ -457,7 +456,7 @@ get_attr_length (rtx insn) /* Obtain the current length of an insn. If branch shortening has been done, get its actual length. Otherwise, get its minimum length. */ int -get_attr_min_length (rtx insn) +get_attr_min_length (rtx insn ATTRIBUTE_UNUSED) { return get_attr_length_1 (insn, insn_min_length); }
Subject: Re: [4.1 Regression]: Gcc failed to build on ia64 Joern RENNECKE <joern.rennecke@st.com> writes: > 2005-09-21 J"orn Rennecke <joern.rennecke@st.com> > > * final.c (get_attr_length_1): In !HAVE_ATTR_length case, define as > macro. Don't attach ATTRIBUTE_UNUSED to arguments. > (get_attr_length, get_attr_min_length): Add ATTRIBUTE_UNUSED. Ick, don't do that. Suppose you just #define insn_default_length and insn_min_length as macros ifndef HAVE_ATTR_length. Ian
Subject: Re: [4.1 Regression]: Gcc failed to build on ia64 On Sep 21, 2005, at 3:20 PM, Ian Lance Taylor wrote: > Joern RENNECKE <joern.rennecke@st.com> writes: > >> 2005-09-21 J"orn Rennecke <joern.rennecke@st.com> >> >> * final.c (get_attr_length_1): In !HAVE_ATTR_length case, define as >> macro. Don't attach ATTRIBUTE_UNUSED to arguments. >> (get_attr_length, get_attr_min_length): Add ATTRIBUTE_UNUSED. > > Ick, don't do that. Suppose you just #define insn_default_length and > insn_min_length as macros ifndef HAVE_ATTR_length. Of course both insn_default_length and insn_min_length are used as functions in this situation. Thanks, Andrew Pinski
Subject: Re: [4.1 Regression]: Gcc failed to build on ia64 Andrew Pinski <pinskia@physics.uc.edu> writes: > On Sep 21, 2005, at 3:20 PM, Ian Lance Taylor wrote: > > > Joern RENNECKE <joern.rennecke@st.com> writes: > > > >> 2005-09-21 J"orn Rennecke <joern.rennecke@st.com> > >> > >> * final.c (get_attr_length_1): In !HAVE_ATTR_length case, define as > >> macro. Don't attach ATTRIBUTE_UNUSED to arguments. > >> (get_attr_length, get_attr_min_length): Add ATTRIBUTE_UNUSED. > > > > Ick, don't do that. Suppose you just #define insn_default_length and > > insn_min_length as macros ifndef HAVE_ATTR_length. > > > Of course both insn_default_length and insn_min_length are used as > functions > in this situation. Hmmm, right. Bother. Still doable, but uglier. Ian
Subject: Re: [4.1 Regression]: Gcc failed to build on ia64 Ian Lance Taylor wrote: >>2005-09-21 J"orn Rennecke <joern.rennecke@st.com> >> >> * final.c (get_attr_length_1): In !HAVE_ATTR_length case, define as >> macro. Don't attach ATTRIBUTE_UNUSED to arguments. >> (get_attr_length, get_attr_min_length): Add ATTRIBUTE_UNUSED. >> >> > >Ick, don't do that. Suppose you just #define insn_default_length and >insn_min_length as macros ifndef HAVE_ATTR_length. > >Ian > > Do you like the attached patch better? 2005-09-22 J"orn Rennecke <joern.rennecke@st.com> * final.c (insn_default_length, insn_min_length): In !HAVE_ATTR_length case, define as macros. Index: final.c =================================================================== RCS file: /cvs/gcc/gcc/gcc/final.c,v retrieving revision 1.361 diff -p -r1.361 final.c *** final.c 20 Sep 2005 21:48:36 -0000 1.361 --- final.c 22 Sep 2005 17:10:14 -0000 *************** get_attr_length_1 (rtx insn ATTRIBUTE_UN *** 443,448 **** --- 443,450 ---- return length; #else /* not HAVE_ATTR_length */ return 0; + #define insn_default_length 0 + #define insn_min_length 0 #endif /* not HAVE_ATTR_length */ }
Subject: Re: [4.1 Regression]: Gcc failed to build on ia64 Joern RENNECKE <joern.rennecke@st.com> writes: > 2005-09-22 J"orn Rennecke <joern.rennecke@st.com> > > * final.c (insn_default_length, insn_min_length): In !HAVE_ATTR_length > case, define as macros. I do like it better. This patch is approved after testing. Thanks. Ian
Subject: Bug 23991 CVSROOT: /cvs/gcc Module name: gcc Changes by: amylaar@gcc.gnu.org 2005-09-23 12:15:43 Modified files: gcc : ChangeLog Log message: Add PR number in this entry: PR middle-end/23991 * final.c (insn_default_length, insn_min_length): In !HAVE_ATTR_length case, define as macros. Patches: http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&r1=2.10009&r2=2.10010
Fixed.