public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* Two additional errors of GCC 2.96
@ 2004-08-21 11:52 jiayu 33576
  2004-08-21 19:28 ` Eljay Love-Jensen
  2004-08-24  5:23 ` Iain Woolf
  0 siblings, 2 replies; 4+ messages in thread
From: jiayu 33576 @ 2004-08-21 11:52 UTC (permalink / raw)
  To: gcc-help, Ian Lance Taylor

[-- Attachment #1: Type: text/plain, Size: 1858 bytes --]

The problem we meeted last have not solved. The code is so large and I am trying to simplify it. We meeted two additional problems.All the errors took place when we were compiling C or C++ using Tornado 2.2 for MIPS. The compiler is GCC 2.96 suppiled by WindRiver. Please help us! Thanks a lot

1. The compiler can't compare an element of enum and an unsigned short variable
Error information:
../../../src/momu/src/mnt/cmnt_int.cpp:3736: Internal compiler error in `copy_to_mode_reg', at explow.c:710

cmnt_int.cpp:3736:
    if ( LID_OMU != g_uwLogicBoardType )   /* Error occurs here */
    {
        vos_printf("error");
    }

The related defination:
typedef enum 
{
    LID_OMU = 0x0100,  /*256 MOMU,FOMU*/
    ...
}
VOS_UINT16         g_uwLogicalBoardNo = VOS_NULL_WORD;
typedef unsigned short VOS_UINT16;
#define VOS_NULL_WORD 0xFFFF


2. The compiler can't assign by structure
../../../src/momu/src/mnt/cmnt_int.cpp:3751: Internal compiler error in `move_by_pieces', at expr.c:1505

cmnt_int.cpp:3751
    struct tmp a,b;

    a.time = b.time;    /* Error occurs here */

The related defination:
    #pragma pack(1)
    struct tmp
    {
        VOS_UINT32 a;
        SYS_T time;
    };
    #pragma pack(4)


name:   jiayu 
email:   jiayu@huawei.com

**************************************************************
This e-mail and its attachments contain confidential information from HUAWEI, which is intended only for the person or entity whose address is listed above. Any use of the information contained herein in any way (including, but not limited to, total or partial disclosure, reproduction, or dissemination) by persons other than the intended recipient(s) is prohibited. If you receive this e-mail in error, please notify the sender by phone or email immediately and delete it!
**************************************************************

[-- Attachment #2: Card for jiayu 33576 <jiayu@huawei.com> --]
[-- Type: text/x-vcard, Size: 86 bytes --]

begin:vcard
n:Jia;Yu
fn:Jia Yu
version:2.1
email;internet:jiayu@huawei.com
end:vcard


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Two additional errors of GCC 2.96
  2004-08-21 11:52 Two additional errors of GCC 2.96 jiayu 33576
@ 2004-08-21 19:28 ` Eljay Love-Jensen
  2004-08-24  5:23 ` Iain Woolf
  1 sibling, 0 replies; 4+ messages in thread
From: Eljay Love-Jensen @ 2004-08-21 19:28 UTC (permalink / raw)
  To: jiayu 33576, gcc-help

Jiayu,

I recommend upgrading to the most current version of GCC.  Either GCC 3.4.1 
(latest and greatest), or GCC 3.3.4 (yesterday's tried and true).

There is no "GCC 2.96".  It's an unofficial, maverick release of GCC by Red 
Hat.  It's not supported on this forum (although we do give some general 
advice).

Your code snippets are incomplete.

Is your enum supposed to be missing the terminating semicolon (and thus 
typedefing to VOS_UINT16)?  If so,  have you tried separating out 
g_uwLogicalBoardNo variable from the typedef?

Is your VOS_NULL_WORD define supposed to come AFTER it is being used?

Is your typedef of VOS_UINT16 supposed to come AFTER it is being used?

For your "compiler can't assign by structure"...

Is there a good reason to override the platform recommended packing, which 
can cause errors such as "Internal compiler error in 'move_by_pieces'"?

HTH,
--Eljay

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Two additional errors of GCC 2.96
  2004-08-21 11:52 Two additional errors of GCC 2.96 jiayu 33576
  2004-08-21 19:28 ` Eljay Love-Jensen
@ 2004-08-24  5:23 ` Iain Woolf
  1 sibling, 0 replies; 4+ messages in thread
From: Iain Woolf @ 2004-08-24  5:23 UTC (permalink / raw)
  To: jiayu 33576; +Cc: gcc-help


jiayu 33576 wrote:
> 
> The problem we meeted last have not solved. The code is so large and I
> am trying to simplify it. We meeted two additional problems.All the
> errors took place when we were compiling C or C++ using Tornado 2.2
> for MIPS. The compiler is GCC 2.96 suppiled by WindRiver. Please help
> us! Thanks a lot
> 
> 1. The compiler can't compare an element of enum and an unsigned short
> variable
> Error information:
> ../../../src/momu/src/mnt/cmnt_int.cpp:3736: Internal compiler error
> in `copy_to_mode_reg', at explow.c:710
> 
> cmnt_int.cpp:3736:
>     if ( LID_OMU != g_uwLogicBoardType )   /* Error occurs here */
>     {
>         vos_printf("error");
>     }
> 
> The related defination:
> typedef enum
> {
>     LID_OMU = 0x0100,  /*256 MOMU,FOMU*/
>     ...
> }
> VOS_UINT16         g_uwLogicalBoardNo = VOS_NULL_WORD;
> typedef unsigned short VOS_UINT16;
> #define VOS_NULL_WORD 0xFFFF

You say the error occurs on the line with g_uwLogicBoardType, but you
supply a definition for g_uwLogicalBoardNo.

I have the same compiler and tried the following sample code. It
compiled fine

//------------------------------------------------------

#include <stdio.h>

#define VOS_NULL_WORD 0xFFFF
typedef unsigned short VOS_UINT16; 
VOS_UINT16         g_uwLogicalBoardNo = VOS_NULL_WORD; 

typedef enum 
{ 
    LID_OMU = 0x0100,  /*256 MOMU,FOMU*/ 
}; 

void somefn(void)
{
   if ( LID_OMU != g_uwLogicalBoardNo )   /* No error here */ 
   { 
      printf("error"); 
   } 
}

//------------------------------------------------------


> 2. The compiler can't assign by structure
> ../../../src/momu/src/mnt/cmnt_int.cpp:3751: Internal compiler error
> in `move_by_pieces', at expr.c:1505

I don't see why it would give you an internal compiler error, but
gcc2.96 (Windriver's compiler based on GNU's gcc2.95) is more ANSI
compliant than the previous version of the Windriver compiler (gcc2.72).

One of the restrictions is not being able to assign one structure to
another. Presumably this is why you have a function called
"move_by_pieces". You didn't provide the definition for SYS_T, but I'm
guessing this is a structure itself.

Cheers,

 Iain

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Two additional errors of GCC 2.96
@ 2004-08-22  4:50 jiayu 33576
  0 siblings, 0 replies; 4+ messages in thread
From: jiayu 33576 @ 2004-08-22  4:50 UTC (permalink / raw)
  To: Eljay Love-Jensen; +Cc: gcc-help

[-- Attachment #1: Type: text/plain, Size: 2117 bytes --]


The Gcc 2.96 is provided by WindRiver with it's tool Tornado, which is GUI tool for vxworks. I don't how the version number 2.96 come from. It's just the result of "gcc -v". I have contact with Wind River. I am not very familiar with gcc. Is it easy to change my gcc to 3.3.4? Does it perform just like the one provided by WindRiver?
Thanks a lot!

name:   jiayu 
email:   jiayu@huawei.com

**************************************************************
This e-mail and its attachments contain confidential information from HUAWEI, which is intended only for the person or entity whose address is listed above. Any use of the information contained herein in any way (including, but not limited to, total or partial disclosure, reproduction, or dissemination) by persons other than the intended recipient(s) is prohibited. If you receive this e-mail in error, please notify the sender by phone or email immediately and delete it!
**************************************************************

----- Original Message -----
From: Eljay Love-Jensen <eljay@adobe.com>
Date: Saturday, August 21, 2004 7:52 pm
Subject: Re: Two additional errors of GCC 2.96

> Jiayu,
> 
> I recommend upgrading to the most current version of GCC.  Either 
> GCC 3.4.1 
> (latest and greatest), or GCC 3.3.4 (yesterday's tried and true).
> 
> There is no "GCC 2.96".  It's an unofficial, maverick release of 
> GCC by Red 
> Hat.  It's not supported on this forum (although we do give some 
> general 
> advice).
> 
> Your code snippets are incomplete.
> 
> Is your enum supposed to be missing the terminating semicolon (and 
> thus 
> typedefing to VOS_UINT16)?  If so,  have you tried separating out 
> g_uwLogicalBoardNo variable from the typedef?
> 
> Is your VOS_NULL_WORD define supposed to come AFTER it is being used?
> 
> Is your typedef of VOS_UINT16 supposed to come AFTER it is being used?
> 
> For your "compiler can't assign by structure"...
> 
> Is there a good reason to override the platform recommended 
> packing, which 
> can cause errors such as "Internal compiler error in 
> 'move_by_pieces'"?
> HTH,
> --Eljay
> 
> 

[-- Attachment #2: Card for jiayu 33576 <jiayu@huawei.com> --]
[-- Type: text/x-vcard, Size: 86 bytes --]

begin:vcard
n:Jia;Yu
fn:Jia Yu
version:2.1
email;internet:jiayu@huawei.com
end:vcard


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2004-08-23 16:48 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-08-21 11:52 Two additional errors of GCC 2.96 jiayu 33576
2004-08-21 19:28 ` Eljay Love-Jensen
2004-08-24  5:23 ` Iain Woolf
2004-08-22  4:50 jiayu 33576

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).