------- Comment #16 from ebotcazou at gcc dot gnu dot org 2006-01-22 10:19 ------- > Any ideas why this would be the case?
The types are not supposed to alias each other. The lines in the .dg file are: R8b : fdd2a00__write__A7b__2 := ada__streams__Tstream_element_offsetB?( system__arith_64__add_with_ovflo_check (interfaces__integer_64 ?(stream.last), interfaces__integer_64?( ada__streams__Tstream_element_offsetB(item'length))))'reference; [constraint_error when R8b.all >= R5b.all and then (R5b.all < 1 or else R8b.all > ada__streams__Tstream_element_offsetB(R3b)) "range check failed"] ada/trans.c:3053 case N_Reference: /* Like 'Access as far as we are concerned. */ gnu_result = gnat_to_gnu (Prefix (gnat_node)); gnu_result = build_unary_op (ADDR_EXPR, NULL_TREE, gnu_result); gnu_result_type = get_unpadded_type (Etype (gnat_node)); break; These N_Reference nodes are an endless source of problems because they cause gigi to take the address of objects that are not aliased. We have been working towards eliminating them as much as possible by using renaming instead; this case (check on the result of a function call) is probably the most delicate one. No real solution as of this writing, only a poor workaround: not compiling the support files with -gnato (overflow checks). -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18819