This is the mail archive of the
mailing list for the GCC project.
(not) building gpc 19991030 on /alpha [patch]
- From: levi at localhost dot nc3a dot nato dot int
- To: levi at localhost dot nc3a dot nato dot int
- Cc: gcc at gcc dot gnu dot org
- Date: 08 Nov 1999 06:05:13 -0200
- Subject: (not) building gpc 19991030 on /alpha [patch]
- Mail-from: email@example.com Mon Nov 8 15:32:28 1999
I'd never been able to build gpc on any alpha host: gpc1 would ICE
while building a couple of files within gcc/p/rts, for example,
error.pas. Tonight, I decided to try to track the problem down.
First, I tried to come up with a minimal testcase that reproduced the
var e : array [0 .. 0] of CString;
i : Integer;
e [i] := '';
The problem was that, while expanding the ARRAY_REF,
get_inner_reference() would build a MULT_EXPR with type ssizetype
(SImode), but the index type was sizetype (DImode). Since there was
no intervening convert(), expand_mult would call
copy_to_mode_reg(SImode, a_DImode_register), that would abort().
The problem was that ssizetype was not being properly initialized so
as to match sizetype, and it's fixed with the following patch, that
matches the corresponding section of c-decl.c as of gcc 2.95.2 and
from Alexandre Oliva <firstname.lastname@example.org>
* gpc-decl.c (init_decl_processing): Use set_sizetype instead of
assigning to sizetype.
--- gcc/p/gpc-decl.c Sat Oct 30 17:23:45 1999
+++ gcc/p/gpc-decl.c Mon Nov 8 05:32:46 1999
@@ -4265,10 +4265,10 @@
Traditionally, use a signed type.
Note that stddef.h uses `unsigned long',
and this must agree, even of long and int are the same size. */
- = TREE_TYPE (IDENTIFIER_GLOBAL_VALUE (GET_IDENTIFIER (SIZE_TYPE)));
+ (TREE_TYPE (IDENTIFIER_GLOBAL_VALUE (GET_IDENTIFIER (SIZE_TYPE))));
if (flag_traditional && TREE_UNSIGNED (sizetype))
- sizetype = signed_type (sizetype);
+ set_sizetype (signed_type (sizetype));
= TREE_TYPE (IDENTIFIER_GLOBAL_VALUE (GET_IDENTIFIER (PTRDIFF_TYPE)));
I'm Cc:ing the gcc mailing list because I thought we could have
helped avoid this problem:
- we could arrange that sizetype is no longer an lvalue, so that only
set_sizetype would assign to it, and misuses would get a compile-time
error instead of a run-time crash only on platforms with
ssize_t == long == DImode and int == SImode.
- in the code snippet below, from expr.c:get_inner_reference(), we
could explicitly convert index to ssizetype. AFAICT, fold would drop
the conversion if it found it needless.
/* Either the bit offset calculated above is not constant, or
it overflowed. In either case, redo the multiplication
against the size in units. This is especially important
in the non-constant case to avoid a division at runtime. */
xindex = fold (build (MULT_EXPR, ssizetype, index,
TYPE_SIZE_UNIT (TREE_TYPE (exp)))));
Alexandre Oliva http://www.ic.unicamp.br/~oliva IC-Unicamp, Bra[sz]il
** I may forward mail about projects to mailing lists; please use them