From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2783 invoked by alias); 12 Nov 2002 04:56:01 -0000 Mailing-List: contact gcc-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-prs-owner@gcc.gnu.org Received: (qmail 2727 invoked by uid 71); 12 Nov 2002 04:56:00 -0000 Resent-Date: 12 Nov 2002 04:56:00 -0000 Resent-Message-ID: <20021112045600.2725.qmail@sources.redhat.com> Resent-From: gcc-gnats@gcc.gnu.org (GNATS Filer) Resent-Cc: gcc-prs@gcc.gnu.org, gcc-bugs@gcc.gnu.org Resent-Reply-To: gcc-gnats@gcc.gnu.org, rbrown64@csc.com.au Received: (qmail 2685 invoked by uid 61); 12 Nov 2002 04:55:54 -0000 Message-Id: <20021112045554.2684.qmail@sources.redhat.com> Date: Tue, 19 Nov 2002 12:46:00 -0000 From: rbrown64@csc.com.au Reply-To: rbrown64@csc.com.au To: gcc-gnats@gcc.gnu.org X-Send-Pr-Version: gnatsweb-2.9.3 (1.1.1.1.2.31) Subject: bootstrap/8538: real.h `test_real_width' assertion fails when sizeof(long) == sizeof(long long) == 8 X-SW-Source: 2002-11/txt/msg00568.txt.bz2 List-Id: >Number: 8538 >Category: bootstrap >Synopsis: real.h `test_real_width' assertion fails when sizeof(long) == sizeof(long long) == 8 >Confidential: no >Severity: serious >Priority: medium >Responsible: unassigned >State: open >Class: sw-bug >Submitter-Id: net >Arrival-Date: Mon Nov 11 20:56:00 PST 2002 >Closed-Date: >Last-Modified: >Originator: rbrown64@csc.com.au >Release: 3.3 20021111 (experimental) >Organization: >Environment: sparcv9-sun-solaris2.8 >Description: gcc-20021111/gcc/real.h:67: error: size of array `test_real_width' is negative Reading specs from stage1/specs Configured with: ../gcc-20021111/configure --host=sparcv9-sun-solaris2.8 --exec-prefix=/usr/local/64-bit --with-gnu-as --with-as=/usr/local/64-bit/bin/as --with-gnu-ld --with-ld=/usr/local/64-bit/bin/ld Thread model: posix gcc version 3.3 20021111 (experimental) stage1/cc1 -E -quiet -v -I. -I. -I../../gcc-20021111/gcc -I../../gcc-20021111/gcc/. -I../../gcc-20021111/gcc/config -I../../gcc-20021111/gcc/../include -iprefix stage1/../lib/gcc-lib/sparcv9-sun-solaris2.8/3.3/ -isystem include -isystem stage1/include -isystem /usr/local/64-bit/sparcv9-sun-solaris2.8/bin/include -D__GNUC__=3 -D__GNUC_MINOR__=3 -D__GNUC_PATCHLEVEL__=0 -Dsparc -D__sparc__ -D__sparc -D__arch64__ -Acpu=sparc64 -Amachine=sparcv9 -D__sparcv9 -DIN_GCC -DHAVE_CONFIG_H -DGENERATOR_FILE ../../gcc-20021111/gcc/gengenrtl.c -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wtraditional -pedantic -Wno-long-long -fno-common -O2 gengenrtl.i #include "..." search starts here: #include <...> search starts here: . ../../gcc-20021111/gcc ../../gcc-20021111/gcc/config ../../gcc-20021111/include include /usr/local/include /usr/include End of search list. stage1/cc1 -fpreprocessed gengenrtl.i -quiet -dumpbase gengenrtl.c -auxbase-strip gengenrtl.o -g -O2 -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wtraditional -pedantic -Wno-long-long -version -fno-common -o gengenrtl.s GNU C version 3.3 20021111 (experimental) (sparcv9-sun-solaris2.8) compiled by GNU C version 3.1. In file included from ../../gcc-20021111/gcc/gengenrtl.c:29: ../../gcc-20021111/gcc/real.h:67: error: size of array `test_real_width' is negative $ grep -n -3 test_real_width ../../gcc-20021111/gcc/real.h 63- + (REAL_VALUE_TYPE_SIZE%HOST_BITS_PER_WIDE_INT ? 1 : 0)) /* round up */ 64- 65-/* Verify the guess. */ 66:extern char test_real_width 67- [sizeof(REAL_VALUE_TYPE) <= REAL_WIDTH*sizeof(HOST_WIDE_INT) ? 1 : -1]; 68- 69-/* Calculate the format for CONST_DOUBLE. We need as many slots as $ grep -n -B10 -A2 test_real_width ../../gcc-20021111/gcc/real.h 56-/* We store a REAL_VALUE_TYPE into an rtx, and we do this by putting it in 57- consecutive "w" slots. Moreover, we've got to compute the number of "w" 58- slots at preprocessor time, which means we can't use sizeof. Guess. */ 59- 60-#define REAL_VALUE_TYPE_SIZE (SIGNIFICAND_BITS + 32) 61-#define REAL_WIDTH \ 62- (REAL_VALUE_TYPE_SIZE/HOST_BITS_PER_WIDE_INT \ 63- + (REAL_VALUE_TYPE_SIZE%HOST_BITS_PER_WIDE_INT ? 1 : 0)) /* round up */ 64- 65-/* Verify the guess. */ 66:extern char test_real_width 67- [sizeof(REAL_VALUE_TYPE) <= REAL_WIDTH*sizeof(HOST_WIDE_INT) ? 1 : -1]; 68- $ grep -B15 -A2 test_real_width gen*.i struct real_value { enum real_value_class class : 2; unsigned int sign : 1; signed int exp : (32 - 3); unsigned long sig[((128 + (8 * 4)) / (8 * 4))]; }; # 66 "../../gcc-20021111/gcc/real.h" extern char test_real_width [sizeof(struct real_value) <= (((128 + (8 * 4)) + 32)/(8 * 8) + (((128 + (8 * 4)) + 32)%(8 * 8) ? 1 : 0))*sizeof(long long) ? 1 : -1]; # 104 "../../gcc-20021111/gcc/real.h" # Output of following test program $ ./rdb sizeof(long)=8 sizeof(long long)=8 sizeof(struct real_value)=48 (((128 + (8 * 4)) + 32)/(8 * 8) + (((128 + (8 * 4)) + 32)%(8 * 8) ? 1 : 0))=3 $ cat rdb.c #include #include enum real_value_class { rvc_zero, rvc_normal, rvc_inf, rvc_nan }; struct real_value { enum real_value_class class : 2; unsigned int sign : 1; signed int exp : (32 - 3); unsigned long sig[((128 + (8 * 4)) / (8 * 4))]; }; /* # 66 "../../gcc-20021104/gcc/real.h" */ /* extern char test_real_width [sizeof(struct real_value) <= (((128 + (8 * 4)) + 32)/(8 * 8) + (((128 + (8 * 4)) + 32)%(8 * 8) ? 1 : 0))*sizeof(long long) ? 1 : -1] */ int main() { printf("sizeof(long)=%d\n", sizeof(long)); printf("sizeof(long long)=%d\n", sizeof(long long)); printf("sizeof(struct real_value)=%d\n", sizeof(struct real_value)); printf("(((128 + (8 * 4)) + 32)/(8 * 8) + (((128 + (8 * 4)) + 32)%%(8 * 8) ? 1 : 0))=%d\n", (((128 + (8 * 4)) + 32)/(8 * 8) + (((128 + (8 * 4)) + 32)%(8 * 8) ? 1 : 0))); exit(0); } >How-To-Repeat: Bootstrap 20021111 snapshot on sparcv9-sun-solaris2.8 >Fix: >Release-Note: >Audit-Trail: >Unformatted: