reorg.c : argument mismatch for sets_cc0_p

Hans Cappelle cappelle@imec.be
Thu Nov 5 04:42:00 GMT 1998


dear all,

following problem is relevant for gcc-2.8.x and
all egcs releases.

* main problem 
  when building gcc for a machine with delay slots and cc0. 
  (eg the romp) make stops at reorg.c.
* side problem
  romp.h contains a typo in the LEGITIMIZE_ADDRESS macro :
  the last GEN_INT contains an unneeded comma
  this needs to get fixed to expose the main problem

The rest of the discussion focuses on the main problem :

reorg.c contains an argument mismatch for sets_cc0_p in reorg.c.
At the end of the mail I included the relevant
code fragments (source code lines may vary)

The problem is :
  - not depending on the host platform
  - depending on how picky the native compiler
    is for argument mismatches (the one to built gcc)
    I used gcc-2.8.1 as native compiler. I expect
    any recent gcc will treat argument mismatches
    as an error.
  - depending on the target architecture :
    the target needs to have delay slots and cc0
    -> eg the romp configuration.
  - depending on the (target) compiler sources.
    The problem occurs with gcc-2.8.x and any
    egcs release. Probably some 2.7.x releases
    are affected too; I did not investigate this.

To reproduce the problem :
build a cross compiler for the romp machine description

0) unpack a gcc-2.8.x or egcs distribution
1) fix a typo in gcc/config/romp/romp.h
   the last GEN_INT in the
   LEGITIMIZE_ADDRESS(X,OLDX,MODE,WIN) macro
   contains an unneeded comma
2) in the gcc dir 
  ./configure --target=romp-mach
  make cc1

  make will fail when compiling reorg.c with following
  message.
  reorg.c:3199: too many arguments to function `sets_cc0_p'


Below you find the relevant code fragments.

I discovered this (tiny) problem while porting gcc to
a custom dsp processor. I am very impressed about
the porting ease, robustness and quality of generated
code of gcc, keep up the good work !

Best regards,

--
Hans Cappelle,

Embedded software engineer.

IMEC / VSDM division, Kapeldreef 75, B-3001 Leuven, Belgium
phone: +32/16/281.601      e-mail: cappelle@imec.be
fax  : +32/16/281.515      www   : http://www.imec.be


==============================================================

code fragments :

My guess is that skipping the cc0_rtx argument in
the "reorg.c: sets_cc0_p (cc0_rtx, pat) " line
is the solution to the problem.
 

---< rtl.h:1248: >--------------------------------------------

extern int sets_cc0_p			PROTO ((rtx));

---------------------------------------------------------------
---< jump.c:3343: >--------------------------------------------


int
sets_cc0_p (x)
     rtx x ATTRIBUTE_UNUSED;

---------------------------------------------------------------
---< reorg.c:3199: >-------------------------------------------

#ifdef HAVE_cc0
		  /* Can't separate set of cc0 from its use.  */
		  && ! (reg_mentioned_p (cc0_rtx, pat)
			&& ! sets_cc0_p (cc0_rtx, pat))
#endif

---------------------------------------------------------------



More information about the Gcc-bugs mailing list