This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Build error with USE_MD_CONSTRAINTS vs. CONST_OK_FOR_CONSTRAINT_P


I've got a local port of GCC 4.5.0 to an in-house CPU.

I'm trying to remove *all* single-letter constraints from my cpu.md file and replace them with define_constraint entries that define *multi-letter* constraint names.  Example:  (define_constraint "aFOO" ...)

But I've found that when I remove all single-letter constraints, I see these errors when compiling GCC:

libbackend.a(ira-costs.o): In function `record_reg_classes':
/sw/gcc-4.5.0-lcl/gcc/ira-costs.c:471: undefined reference to `CONST_OK_FOR_CONSTRAINT_P'
libbackend.a(ira-lives.o): In function `single_reg_class':
/sw/gcc-4.5.0-lcl/gcc/ira-lives.c:680: undefined reference to `CONST_OK_FOR_CONSTRAINT_P'
/sw/gcc-4.5.0-lcl/gcc/ira-lives.c:684: undefined reference to `CONST_OK_FOR_CONSTRAINT_P'
libbackend.a(recog.o): In function `asm_operand_ok':
/sw/gcc-4.5.0-lcl/gcc/recog.c:1739: undefined reference to `CONST_OK_FOR_CONSTRAINT_P'
/sw/gcc-4.5.0-lcl/gcc/recog.c:1744: undefined reference to `CONST_OK_FOR_CONSTRAINT_P'
libbackend.a(recog.o):/sw/gcc-4.5.0-lcl/gcc/recog.c:1749: more undefined references to `CONST_OK_FOR_CONSTRAINT_P' follow
collect2: ld returned 1 exit status



I see in 'defaults.h' this code:

  /* If none of these macros are defined, the port must use the new
     technique of defining constraints in the machine description.
     tm_p.h will define those macros that machine-independent code
     still uses.  */
  #if  !defined CONSTRAINT_LEN                    \
    && !defined REG_CLASS_FROM_LETTER             \
    && !defined REG_CLASS_FROM_CONSTRAINT         \
    && !defined CONST_OK_FOR_LETTER_P             \
    && !defined CONST_OK_FOR_CONSTRAINT_P         \
    && !defined CONST_DOUBLE_OK_FOR_LETTER_P      \
    && !defined CONST_DOUBLE_OK_FOR_CONSTRAINT_P  \
    && !defined EXTRA_CONSTRAINT                  \
    && !defined EXTRA_CONSTRAINT_STR              \
    && !defined EXTRA_MEMORY_CONSTRAINT           \
    && !defined EXTRA_ADDRESS_CONSTRAINT

  #define USE_MD_CONSTRAINTS


I do not define any of these macros in my cpu.h file, and I verified that 'USE_MD_CONSTRAINTS' *IS* being defined by defaults.h, as expected.

However, I still see the above errors when I compile.  My reading of the ira-costs.c and ira-lives.c code seems to indicate that 'CONST_OK_FOR_CONSTRAINT_P' is simply assumed to be defined and that there is no provision for doing something else if CONST_OK_FOR_CONSTRAINT_P is undefined but USE_MD_CONSTRAINTS is defined.

I *am* using the IRA, if that matters.

Am I *required* to define at least some of the single-letter constraints?  My reading of the "Operand Constraints" section of the GCC internals documentation is that this is not a requirement.

Suggestions?  Thanks for any help.



      


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]