/Users/dave/gnu/gcc/objdir/./prev-gcc/xgcc -B/Users/dave/gnu/gcc/objdir/./prev-g cc/ -B/opt/gnu/gcc/gcc-4.4.0/i686-apple-darwin9/bin/ -c -g -O2 -fomit-frame-poin ter -gnatpg -gnata -nostdinc -I- -I. -Iada -I../../gcc/gcc/ada ../../gcc/gc c/ada/ada.ads -o ada/ada.o +===========================GNAT BUG DETECTED==============================+ | 4.4.0 20080307 (experimental) [trunk revision 132999] (i686-apple-darwin9) | | Assert_Failure uintp.adb:1593 | | No source file position information available | This occurs in stage3. Build yesterday was ok.
This was caused by this change: 2008-03-06 Andrew Pinski <andrew_pinski@playstation.sony.com> PR tree-opt/35402 * tree-ssa-ccp.c (get_symbol_constant_value): Handle integral and scalar float variables which have a NULL DECL_INITIAL.
This has to be a bug in the Ada front-end because all the rest of the middle-end assumes that if DECL_INITIAL is NULL, the value is going to be zero. I might be the case where TREE_READONLY is being set and it should not be as the variable is not readonly.
I think the Ada front-end has TREE_CONSTANT and TREE_READONLY definition swapped around: /* Whether we will make TREE_CONSTANT the DECL we produce here, in which case the initializer may be used in-lieu of the DECL node (as done in Identifier_to_gnu). This is useful to prevent the need of elaboration code when an identifier for which such a decl is made is in turn used as an initializer. We used to rely on CONST vs VAR_DECL for this purpose, but extra constraints apply to this choice (see below) and are not relevant to the distinction we wish to make. */ bool constant_p = const_flag && init_const; TREE_READONLY (var_decl) = const_flag; DECL_EXTERNAL (var_decl) = extern_flag; TREE_PUBLIC (var_decl) = public_flag || extern_flag; TREE_CONSTANT (var_decl) = constant_p; READ_ONLY means it is only read and not written to at all and the initializer is valid.
The patch in <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35494#c6> works here as well.
Based on Andreas' latest comment. The Ada FE may need inspection though.
> I think the Ada front-end has TREE_CONSTANT and TREE_READONLY definition > swapped around: > > /* Whether we will make TREE_CONSTANT the DECL we produce here, in which > case the initializer may be used in-lieu of the DECL node (as done in > Identifier_to_gnu). This is useful to prevent the need of elaboration > code when an identifier for which such a decl is made is in turn used > an initializer. We used to rely on CONST vs VAR_DECL for this purpose, > but extra constraints apply to this choice (see below) and are not > relevant to the distinction we wish to make. */ > bool constant_p = const_flag && init_const; > > TREE_READONLY (var_decl) = const_flag; > DECL_EXTERNAL (var_decl) = extern_flag; > TREE_PUBLIC (var_decl) = public_flag || extern_flag; > TREE_CONSTANT (var_decl) = constant_p; This doesn't seem to be the case according to http://gcc.gnu.org/ml/gcc/2005-08/msg00686.html
For reference H. J. Lu proposed patch (for C++): http://gcc.gnu.org/ml/gcc-patches/2008-03/msg00466.html
Patch for bug 35494 was committed, so this PR should be fixed now too.