This is the mail archive of the gcc-patches@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]

SH fix silly typo in OVERRIDE_OPTIONS


All,

While building a sh64-elf toolchain I found that the built cc1 was
segfaulting on all input because targetm.address_cost was NULL which
shouldn't be the case because it's correctly statically initialised
in sh.c!

Something odd was definately up.

It turned out it was a silly typo in OVERRIDE_OPTIONS in the initialisation
of reg_class_from_letter which only occurs of TARGET_FMOVD is true.

The attached patch fixes the segfault

OK to commit mainline?

I suspect it's also needed for 3.3 but I don't have that branch
checked out.

Graham


ChangeLog

       * config/sh/sh.h (OVERRIDE_OPTIONS): Fix typo.

----------------------------------------------------------------------
Index: sh.h
===================================================================
RCS file: /cvs/uberbaum/gcc/config/sh/sh.h,v
retrieving revision 1.189
diff -c -p -r1.189 sh.h
*** sh.h        31 Jan 2003 23:34:17 -0000      1.189
--- sh.h        12 Feb 2003 20:30:06 -0000
*************** do {                                                                    \
*** 456,462 ****
         targetm.asm_out.unaligned_op.di = NULL;                                \
      }                                                                 \
    if (TARGET_FMOVD)                                                   \
!     reg_class_from_letter['e'] = NO_REGS;                             \
                                                                        \
    for (regno = 0; regno < FIRST_PSEUDO_REGISTER; regno++)             \
      if (! VALID_REGISTER_P (regno))                                   \
--- 456,462 ----
         targetm.asm_out.unaligned_op.di = NULL;                                \
      }                                                                 \
    if (TARGET_FMOVD)                                                   \
!     reg_class_from_letter['e' - 'a'] = NO_REGS;                               \
                                                                        \
    for (regno = 0; regno < FIRST_PSEUDO_REGISTER; regno++)             \
      if (! VALID_REGISTER_P (regno))                                   \
-------------------------------------------------------------------------


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