public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* bootstrap/8538: real.h `test_real_width' assertion fails when sizeof(long) == sizeof(long long) == 8
@ 2002-11-19 12:46 rbrown64
  0 siblings, 0 replies; only message in thread
From: rbrown64 @ 2002-11-19 12:46 UTC (permalink / raw)
  To: gcc-gnats


>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 <stdio.h>
#include <stdlib.h>

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:


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2002-11-12  4:56 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-11-19 12:46 bootstrap/8538: real.h `test_real_width' assertion fails when sizeof(long) == sizeof(long long) == 8 rbrown64

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).