------- Comment #6 from laurent at guerby dot net 2006-03-27 20:12 ------- c35507m tests an enumeration with representation clause in Ada, here the enum has two values, one assigned the representation 4 ('a') and the other the representation 5 (b)
At one point the test asks what's the enum value associated with 2, in Ada an exception must be raised so the front-end inserts a few convertions as shown by gcc -c -gnatdg : before FE expansion: IF CHAR'VAL (IDENT_INT(2)) = B THEN FAILED ( "NO EXCEPTION RAISED FOR " & "CHAR'VAL (IDENT_INT(2)) - 1" ); ELSE FAILED ( "NO EXCEPTION RAISED FOR " & "CHAR'VAL (IDENT_INT(2)) - 2" ); END IF; after: function c35507m__charRP (A : c35507m__char; F : boolean) return integer is begin if system__unsigned_types__unsigned!(A) in 4 .. 5 then return integer(system__unsigned_types__unsigned!(A) - 4); else [constraint_error when F "invalid data"] return -1; end if; end c35507m__charRP; ] B_4 : begin if c35507m__char!(4 + c35507m__charRP (c35507m__char!(4 + { report__ident_int (2)}), true)) = b then report__failed ( "NO EXCEPTION RAISED FOR CHAR'VAL (IDENT_INT(2)) - 1"); else report__failed ( "NO EXCEPTION RAISED FOR CHAR'VAL (IDENT_INT(2)) - 2"); end if; I don't know how it goes through gigi and the BE but the check system__unsigned_types__unsigned!(A) in 4 .. 5 must not go away. May be the front-end is wrong in using function c35507m__char as input type for the parameter though. Richard? -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26797