[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: fw: gcc v4 interworking patch

On Wednesday 10 October 2007, Wookey wrote:
> OK. here is an update for gcc 4.1.2 that actually compiles. updated
> by Laurence Withers.

gcc compiles; but it doesn't work. When running the crosscompiler, gcc 
fails with the message "instruction never exectued".

> http://www.guralp.net/private/gcc-4.1-arm-eabi-on-armv4.patch

I've updated the patches a little bit, adding in a couple of extra 
things, and placed the whole lot in a more permanent location at:


There are three patches, each with some (hopefully detailed) explanatory 
comments at the top.

> Comments from people who actually understand GCC are very welcome -
> so far we haven't got this to actually work.

Yes, I'm afraid I'm totally stuck. I would certainly appreciate some 
help from anyone who understands gcc's code generation on arm. The bit 
that's failing is (much code snipped for brevity):

arm_print_operand (FILE *stream, rtx x, int code)
  switch (code)
    case 'D':
      /* CONST_TRUE_RTX means not always -- i.e. never.  We shouldn't
         ever want to do that.  */
      if (x == const_true_rtx)
          output_operand_lossage ("instruction never exectued");
      if (!COMPARISON_P (x))
          output_operand_lossage ("invalid operand for code '%c'", 

      fputs (arm_condition_codes[ARM_INVERSE_CONDITION_CODE
                                 (get_arm_condition_code (x))],

If I comment out the first test (x == const_true_rtx), the second gets 
triggered as well.

> I gather from some comments Paul Brook made a while back that the
> above code is only part of the solution and that something similar is
> needed for library code too (or something like that). Clues welcome.

There is some library code included in the gcc/gcc/config/arm directory, 
which is written in assembler and probably needs to be patched to use 
Richard's original tricks. There are also two places in glibc (the NPTL 
code, again ARM-specific bits written in assembler) which need patching 
in this manner as well.

Bye for now,
Laurence Withers, <l@lwithers.me.uk>

Reply to: