Igor Marnat wrote:
I've got the problem while tried to compile the program attached below with gpc of version "gpc version 20041218, based on gcc-3.3.4.". It is a bug, isn't it? Is it possible to do something to compile the program?
For a quick workaround, declare t as `0 .. 255'.
I compiled it with command line "gpc test.pas".
Compiler output: test.pas: In main program: test.pas:9: error: arithmetical overflow test.pas:9: error: size of variable `set_result_Test_0' is too large
Program:
program test; var s: set of byte; t:byte; begin s := []; t := 1; s := s + [t]; end.
I found that this is (indirectly) due to build_range_type (tree.c) not setting
TREE_UNSIGNED (itype) = TREE_UNSIGNED (type);
Waldek, do you think this should be changed in the backend, or should we work around it in the frontend?
Frank