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]

Re: Incorrect code using gcc 2.8.x for Motorola 5200 Coldfire



  In message <35E577BF.D73E3356@intellistor.com>you write:
  > Here is some more detail:
  > For some reason, it appears that when the Coldfire port was done,
  > byte (or quarter-word) access was allowed on address registers
  > for the Coldfire.  This is not allowed, but does not produce a
  > trap or illegal instruction on the 5200 series.  It does do this
  > on the 5307 specifically however.
If such code is allowed on the 5200, but not the 5307, then you should
probably create a new target flag for the 5307 so that you can test
for it explicitly instead of pessimizing the 5200.

  > --- m68k.c.orig Fri Nov 21 10:53:07 1997
  > +++ m68k.c      Tue Aug 18 06:58:17 1998
  > @@ -1641,6 +1641,11 @@
  >    if ((ADDRESS_REG_P (operands[0]) || ADDRESS_REG_P (operands[1]))
  >        && ! TARGET_5200)
  >      return "move%.w %1,%0";
  > +/**** ISI Start ****/
  > +  if ((ADDRESS_REG_P (operands[0]) || ADDRESS_REG_P (operands[1]))
  > +      && ! TARGET_5200)
  > +    return "stop %1";
  > +/**** ISI End ****/
  >    return "move%.b %1,%0";
Presumably this was for your own testing purposes :-)

  > --- m68k.h.orig Tue Aug 11 20:01:02 1998
  > +++ m68k.h      Tue Aug 18 06:59:10 1998
  > @@ -468,7 +468,7 @@
  >     if 68881 use is disabled.  */
  >  
  >  #define HARD_REGNO_MODE_OK(REGNO, MODE) \
  > -  (((REGNO) < 16                                       \
  > +  ((TARGET_5200 && ((REGNO) < 24 && (REGNO) > 7) && (MODE == QImode)) ? 0 
  > :
  > ((REGNO) < 16                                 \
  >     && !((REGNO) < 8 && (REGNO) + GET_MODE_SIZE ((MODE)) / 4 > 8))      \
  >     || ((REGNO) < 24                                    \
  >         && TARGET_68881                                  \
  > --- m68k.md.orig        Wed Aug 12 02:12:45 1998
  > +++ m68k.md     Tue Aug 18 06:58:38 1998
  > @@ -1027,8 +1027,8 @@
   "* return output_move_qimode (operands);")
  >  
  >  (define_insn ""
  > -  [(set (match_operand:QI 0 "general_operand" "=d*a<Q>,d*am")
  > -       (match_operand:QI 1 "general_operand" "d*ami,d*a<Q>"))]
  > +  [(set (match_operand:QI 0 "general_operand" "=d*<Q>,d*m")
  > +       (match_operand:QI 1 "general_operand" "d*mi,d*<Q>"))]
  >    "TARGET_5200"
  >    "* return output_move_qimode (operands);")
These seem reasonable if we make them dependent on your target.

A very quick scan of m68k.md didn't show any other obvious cases where
we would do a QImode access to an address register.

jeff


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