This is the mail archive of the ecos-patches@sources.redhat.com mailing list for the eCos 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]

RE: [openrisc] eCos & gcc bug


I have been looking at this a bit further and have further information which
may help.

The problem occurs when trying to return a cyg_ucount8 in a fn. which is
expecting to return a cyg_uint8 (or the equivalent signed types). These base
types are different by default (which is used by OpenRISC):

cyg_uint8 is unsigned char
cyg_ucount8 is unsigned int
cyg_int8 is signed char
cyg_count8 is signed int

The error occurs in emit_move_insn():

  if (mode == BLKmode || (GET_MODE (y) != mode && GET_MODE (y) != VOIDmode))
    abort ();

I admit I'm not an expert here but I presume that it is bombing out because
the 'modes' of the two input operands are wrong. I can't really help much
more than this.

I tried the following:

1) Changing the auto variable type into cyg_uint8. This made no difference
to the reported error.
2) Changing the return type into cyg_ucount8. This compiled without error.

I have 'attached' a couple of patches. Run 'patch -p0 < <patchfile>' in the
following directories for each respective <patchfile>. I haven't put MIME
attachments on as they can be rejected by mailing lists. Snip the code
between the <<patchfile>> and </<patchfile>> brackets to get the
'attachments':

packages/language/c/libc/time/current/include:
language_c_libc_time_include.patch
packages/language/c/libc/time/current/src:
language_c_libc_time_src.patch

There is an issue in that I have changed a header file. I did a look to see
if anything called cyg_libc_time_itoa() and AFAICT nothing did.

I am not suggesting that these patches should be permanent but they will get
a build going without resorting to knocking bits out and may help identify
the real problem in the toolset.

Robert Cragie, Design Engineer
_______________________________________________________________
Jennic Ltd, Furnival Street, Sheffield, S1 4QT,  UK
http://www.jennic.com  Tel: +44 (0) 114 281 2655
_______________________________________________________________

<language_c_libc_time_include.patch>
Index: timeutil.h
===================================================================
RCS file:
/cvs/ecos/ecos/packages/language/c/libc/time/current/include/timeutil.h,v
retrieving revision 1.3
diff -c -r1.3 timeutil.h
*** timeutil.h	23 May 2002 23:07:32 -0000	1.3
--- timeutil.h	23 Apr 2003 09:22:28 -0000
***************
*** 98,104 ****
  // The number of chars written to s is returned
  //

! extern cyg_uint8
  cyg_libc_time_itoa( cyg_uint8 *__s, cyg_int32 __num, cyg_uint8 __width,
                      cyg_bool __padzero );

--- 98,104 ----
  // The number of chars written to s is returned
  //

! extern cyg_ucount8
  cyg_libc_time_itoa( cyg_uint8 *__s, cyg_int32 __num, cyg_uint8 __width,
                      cyg_bool __padzero );
</language_c_libc_time_include.patch>

<language_c_libc_time_src.patch>
Index: strftime.cxx
===================================================================
RCS file:
/cvs/ecos/ecos/packages/language/c/libc/time/current/src/strftime.cxx,v
retrieving revision 1.4
diff -c -r1.4 strftime.cxx
*** strftime.cxx	23 May 2002 23:07:34 -0000	1.4
--- strftime.cxx	23 Apr 2003 09:00:39 -0000
***************
*** 77,83 ****
  // in buf. The number of bytes written is returned, or -1 if there was no
  // space

! static cyg_int8
  do_format(cyg_uint8 fmtchar, cyg_ucount32 sizeleft, char *buf,
            const struct tm *timeptr)
  {
--- 77,83 ----
  // in buf. The number of bytes written is returned, or -1 if there was no
  // space

! static cyg_count8
  do_format(cyg_uint8 fmtchar, cyg_ucount32 sizeleft, char *buf,
            const struct tm *timeptr)
  {
***************
*** 303,309 ****
      --maxsize;

      cyg_ucount32 i, spos;
!     cyg_int8 dof_ret;

      for (i=0, spos=0; (spos<maxsize) && (format[i] != '\0'); ++i) {
          if (format[i] == '%') {
--- 303,309 ----
      --maxsize;

      cyg_ucount32 i, spos;
!     cyg_count8 dof_ret;

      for (i=0, spos=0; (spos<maxsize) && (format[i] != '\0'); ++i) {
          if (format[i] == '%') {
Index: timeutil.cxx
===================================================================
RCS file:
/cvs/ecos/ecos/packages/language/c/libc/time/current/src/timeutil.cxx,v
retrieving revision 1.3
diff -c -r1.3 timeutil.cxx
*** timeutil.cxx	23 May 2002 23:07:34 -0000	1.3
--- timeutil.cxx	23 Apr 2003 09:00:39 -0000
***************
*** 229,235 ****
  // but there wouldn't be much in it with only 11 chars max to convert :-/.
  // Actually FIXME: what if someone passes a width >11

! externC cyg_uint8
  cyg_libc_time_itoa( cyg_uint8 *s, cyg_int32 num, cyg_uint8 width,
                      cyg_bool padzero )
  {
--- 229,235 ----
  // but there wouldn't be much in it with only 11 chars max to convert :-/.
  // Actually FIXME: what if someone passes a width >11

! externC cyg_ucount8
  cyg_libc_time_itoa( cyg_uint8 *s, cyg_int32 num, cyg_uint8 width,
                      cyg_bool padzero )
  {
***************
*** 252,258 ****
      }

      // return value
!     cyg_uint8 ret=0;

      // Pre-fiddle for negative numbers
      if ((num < 0) && (width > 0)) {
--- 252,258 ----
      }

      // return value
!     cyg_ucount8 ret=0;

      // Pre-fiddle for negative numbers
      if ((num < 0) && (width > 0)) {
</language_c_libc_time_include.patch>

> -----Original Message-----
> From: owner-openrisc at opencores dot org
> [mailto:owner-openrisc at opencores dot org]On Behalf Of phoenix
> Sent: 17 April 2003 11:04
> To: openrisc at opencores dot org
> Subject: [openrisc] eCos & gcc bug
>
>
> hi!
>
> while trying to compile ecos for or1k reference platform i've stumbled
> accreoss this gcc bug. did anyone else see this or has any ideas ?
>
> regards,
> p.
>
> or32-elf-gcc
> -c
> -I/home/matjazb/projects/or1k/eCos/exports/or1k-reference-0_instal
> l/include
> -I/home/matjazb/projects/or1k/eCos/exports/ecos/packages/language/
> c/libc/time/current
> -I/home/matjazb/projects/or1k/eCos/exports/ecos/packages/language/
> c/libc/time/current/src
> -I/home/matjazb/projects/or1k/eCos/exports/ecos/packages/language/
> c/libc/time/current/tests
> -I.
> -I/home/matjazb/projects/or1k/eCos/exports/ecos/packages/language/
> c/libc/time/current/src/
> -msoft-float -Wall -Wpointer-arith -Wstrict-prototypes
> -Winline -Wundef -Woverloaded-virtual
> -g -O2 -fno-omit-frame-pointer
> -fno-rtti -fno-exceptions -fvtable-gc -finit-priority -Wno-format
> -Wp,-MD,src/strftime.tmp
> -o src/language_c_libc_time_strftime.o
>
> /home/matjazb/projects/or1k/eCos/exports/ecos/packages/language/c/
> libc/time/current/src/strftime.cxx
> /home/matjazb/projects/or1k/eCos/exports/ecos/packages/language/c/
> libc/time/current/src/strftime.cxx:
> In
> make[1]: Leaving directory
> /home/matjazb/projects/or1k/eCos/exports/or1k-reference-0_build/la
> nguage/c/libc/time/current'
>    function yg_int8 do_format(unsigned char, unsigned int,
> char*, const
> make: Leaving directory
> /home/matjazb/projects/or1k/eCos/exports/or1k-reference-0_build'
>
> tm*)':
> /home/matjazb/projects/or1k/eCos/exports/ecos/packages/language/c/
> libc/time/current/src/strftime.cxx:99:
> Internal
>    compiler error in emit_move_insn, at expr.c:2746
> Please submit a full bug report,
> with preprocessed source if appropriate.
> See <URL:http://www.gnu.org/software/gcc/bugs.html> for instructions.
> make[1]: *** [src/strftime.o.d] Error 1
> --
> To unsubscribe from openrisc mailing list please visit
http://www.opencores.org/mailinglists.shtml


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