This is the mail archive of the
gcc-prs@gcc.gnu.org
mailing list for the GCC project.
c/327: solaris gcc-2.95 does not handle union of ULL datatype
- To: gcc-gnats at gcc dot gnu dot org
- Subject: c/327: solaris gcc-2.95 does not handle union of ULL datatype
- From: dbowman at caspiannetworks dot com
- Date: 16 Jun 2000 02:34:10 -0000
- Cc: badgett at caspiannetworks dot com
- Reply-To: dbowman at caspiannetworks dot com
- Resent-Cc: gcc-prs at gcc dot gnu dot org, badgett at caspiannetworks dot com
- Resent-Reply-To: gcc-gnats@gcc.gnu.org, dbowman@caspiannetworks.com
>Number: 327
>Category: c
>Synopsis: solaris gcc-2.95 does not handle union of ULL datatype
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: unassigned
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Thu Jun 15 19:36:00 PDT 2000
>Closed-Date:
>Last-Modified:
>Originator: dbowman@caspiannetworks.com
>Release: gcc version 2.95.2 19991024 (release)
>Organization:
>Environment:
SunOS localhost 5.7 Generic_106541-10 sun4u sparc SUNW,Ultra-250
>Description:
we have a union of unsigned long long and unsigned int[2].
when we set this location using the int array, it is fine and
we can reference it using the ULL. however, when we try to do
a bitwise and ( opcode.ull & 0x03f0000000ULL ) it returns an incorrect value
under Linux x86 this same piece of code works properly.
typedef unsigned long long int TYPE_ULL;
typedef union big {
TYPE_ULL ull;
unsigned int i[2];
} TYPE_BIG;
TYPE_BIG opcode;
register unsigned int res, op1, op2, rd, r1, r2, addr ;
struct context *CC;
CC = &PP->con[PP->cc];
addr = CC->pc;
addr &= 0x3ff;
opcode.ull = iRAM[addr].ull;
sim_cycle_count++;
if( verbose ){ printf( "ppa_run1: %x %x %x\n", addr, opcode.i[1], opcode.i[0] ); }
switch( 0x03f0000000ULL & opcode.ull )
case()
...
this last piece of code produces 2 when opcode.ull is:
2 b3000006
it should produce
0x2b0000000
which it does under Linux x86 (gcc 2.91)
>How-To-Repeat:
>Fix:
break the code into if statements using high and low compares
>Release-Note:
>Audit-Trail:
>Unformatted: