Tested with GPC 2001/05/02 on Linux (i586), and GPC 2001/06/23 on DJGPP:
[pas]% cat bug.pas program testbug;
var t : packed array[0..1]of 0..32768; {non-packed is OK, <=32767 is OK} h : 0..1; {or integer or whatever}
begin h:=0; t[h]:=0 {t[0]:=0 is OK} end. [pas]% gpc bug.pas bug.pas: In main program: bug.pas:10: Internal compiler error in `build_modify_expr', at gpc-typeck.c:6846 Please submit a full bug report to the GPC mailing list gpc@gnu.de. See URL:http://home.pages.de/~GNU-Pascal/todo.html for details. [pas]%
Emil Jerabek wrote:
Tested with GPC 2001/05/02 on Linux (i586), and GPC 2001/06/23 on DJGPP:
[pas]% cat bug.pas program testbug;
var t : packed array[0..1]of 0..32768; {non-packed is OK, <=32767 is OK} h : 0..1; {or integer or whatever}
begin h:=0; t[h]:=0 {t[0]:=0 is OK} end. [pas]% gpc bug.pas bug.pas: In main program: bug.pas:10: Internal compiler error in `build_modify_expr', at gpc-typeck.c:6846 Please submit a full bug report to the GPC mailing list gpc@gnu.de. See URL:http://home.pages.de/~GNU-Pascal/todo.html for details. [pas]%
Thanks for the report. Fix attached (against the current GPC, though it's not impossible that it will fit on your version as well). (emil1.pas)
Frank