[M3devel] m3cg 4.5 problem
Jay K
jay.krell at cornell.edu
Sun Jun 27 11:23:13 CEST 2010
I was a bit off. It is actually set of enum. Like this:
MODULE TypeCaseStmt;
TYPE T1 = {A,B};TYPE T2 = SET OF T1; PROCEDURE GetOutcomex (): T2 = VAR oc := T2 {}; BEGIN RETURN oc; END GetOutcomex;
BEGINEND TypeCaseStmt.
- Jay
From: jay.krell at cornell.edu
To: m3devel at elegosoft.com; hosking at cs.purdue.edu
Date: Sun, 27 Jun 2010 08:12:54 +0000
Subject: [M3devel] m3cg 4.5 problem
This tiny bit of code, which is cut down from m3front, causes an assertion failure in a 4.5 m3cg:
MODULE TypeCaseStmt;
IMPORT M3ID, CG, Expr, Stmt, StmtRep, Type, Variable, Scope;
PROCEDURE GetOutcomex (): Stmt.Outcomes = VAR oc := Stmt.Outcomes {}; line 6 BEGIN RETURN oc; END GetOutcomex;
BEGINEND TypeCaseStmt.
../src/stmts/TypeCaseStmt.m3:6:0: internal compiler error: in gimplify_expr, at gimplify.c:7315Please submit a full bug report,
(1) begin_unit(2) set_source_file(3) set_source_line source line 1(4) comment comment: `module global constants'(5) declare_segment segment L_1 typeid 0xffffffff(6) comment comment: `module global data'(7) declare_segment segment MM_TypeCaseStmt typeid 0xffffffff(8) set_source_line source line 11(9) declare_procedure type:addr procedure:TypeCaseStmt_M3 nparams:0x1 rettype:addr lev:0 exported:1(10) declare_param type:int64 param M3_AcxOUs_mode type:int64 typeid:0x195c2a74 bytesize:0x40 alignment:0x40 in_memory:0x0 up_level:0x0 mode 0x11 (DImode)(11) import_procedure type:addr procedure:TypeCaseStmt_I3 nparams:0x0 rettype:addr(12) export_unit(13) import_procedure type:addr procedure:Scope_I3 nparams:0x0 rettype:addr(14) import_unit(15) import_procedure type:addr procedure:Variable_I3 nparams:0x0 rettype:addr(16) import_unit(17) import_procedure type:addr procedure:Type_I3 nparams:0x0 rettype:addr(18) import_unit(19) import_procedure type:addr procedure:StmtRep_I3 nparams:0x0 rettype:addr(20) import_unit(21) import_procedure type:addr procedure:Stmt_I3 nparams:0x0 rettype:addr(22) import_unit(23) import_procedure type:addr procedure:Expr_I3 nparams:0x0 rettype:addr(24) import_unit(25) import_procedure type:addr procedure:CG_I3 nparams:0x0 rettype:addr(26) import_unit(27) import_procedure type:addr procedure:M3ID_I3 nparams:0x0 rettype:addr(28) import_unit(29) import_procedure type:addr procedure:RTHooks_I3 nparams:0x0 rettype:addr(30) import_unit(31) declare_procedure type:word64 procedure:TypeCaseStmt__GetOutcomex nparams:0x0 rettype:word64 lev:0 exported:0(32) declare_local type:word64 local var M3_EXQtd6_oc type:word64 size:0x40 alignment:0x40(33) declare_local type:word64 local var M3_EXQtd6__result type:word64 size:0x40 alignment:0x40(34) comment comment: `GetOutcomex'(35) set_source_line source line 5(36) begin_procedure procedure TypeCaseStmt__GetOutcomex TypeCaseStmt__GetOutcomex(37) set_source_line source line 6(38) load_integer type:int64 integer:0x0(39) store type:int64 type:int64 store (M3_EXQtd6_oc) offset:0x0 src_t:int64 dst_t:int64(40) set_source_line source line 8(41) load type:word64 type:int64 m3cg_load (M3_EXQtd6_oc): offset 0x0, convert word64 -> int64(42) exit_proc type:word64(43) end_procedure procedure TypeCaseStmt__GetOutcomex
Breakpoint 1, fancy_abort (file=0x1009f0c6f "../../gcc-4.5/gcc/gimplify.c", line=7315, function=0x1009f1242 "gimplify_expr") at ../../gcc-4.5/gcc/diagnostic.c:763763 internal_error ("in %s, at %s:%d", function, trim_filename (file), line);(gdb) bt#0 fancy_abort (file=0x1009f0c6f "../../gcc-4.5/gcc/gimplify.c", line=7315, function=0x1009f1242 "gimplify_expr") at ../../gcc-4.5/gcc/diagnostic.c:763#1 0x00000001004cc4d6 in gimplify_expr (expr_p=0x1410e2060, pre_p=0x7fff5fbff420, post_p=0x7fff5fbfeff8, gimple_test_f=0x1004aac7f <is_gimple_lvalue>, fallback=2) at ../../gcc-4.5/gcc/gimplify.c:7315#2 0x00000001004c5ad3 in gimplify_modify_expr (expr_p=0x1416a5f28, pre_p=0x7fff5fbff420, post_p=0x7fff5fbfeff8, want_value=0 '\0') at ../../gcc-4.5/gcc/gimplify.c:4444#3 0x00000001004caafc in gimplify_expr (expr_p=0x1416a5f28, pre_p=0x7fff5fbff420, post_p=0x7fff5fbfeff8, gimple_test_f=0x1004ab1a6 <is_gimple_stmt>, fallback=0) at ../../gcc-4.5/gcc/gimplify.c:6619#4 0x00000001004c7800 in gimplify_stmt (stmt_p=0x1416a5f28, seq_p=0x7fff5fbff420) at ../../gcc-4.5/gcc/gimplify.c:5264#5 0x00000001004be376 in gimplify_statement_list (expr_p=0x1416c4030, pre_p=0x7fff5fbff420) at ../../gcc-4.5/gcc/gimplify.c:1382#6 0x00000001004cb6f5 in gimplify_expr (expr_p=0x1416c4030, pre_p=0x7fff5fbff420, post_p=0x7fff5fbff2e8, gimple_test_f=0x1004ab1a6 <is_gimple_stmt>, fallback=0) at ../../gcc-4.5/gcc/gimplify.c:6935#7 0x00000001004c7800 in gimplify_stmt (stmt_p=0x1416c4030, seq_p=0x7fff5fbff420) at ../../gcc-4.5/gcc/gimplify.c:5264#8 0x00000001004bdb6c in gimplify_bind_expr (expr_p=0x1416c2298, pre_p=0x7fff5fbff778) at ../../gcc-4.5/gcc/gimplify.c:1127#9 0x00000001004cae2b in gimplify_expr (expr_p=0x1416c2298, pre_p=0x7fff5fbff778, post_p=0x7fff5fbff618, gimple_test_f=0x1004ab1a6 <is_gimple_stmt>, fallback=0) at ../../gcc-4.5/gcc/gimplify.c:6719#10 0x00000001004c7800 in gimplify_stmt (stmt_p=0x1416c2298, seq_p=0x7fff5fbff778) at ../../gcc-4.5/gcc/gimplify.c:5264#11 0x00000001004ccbe6 in gimplify_body (body_p=0x1416c2298, fndecl=0x1416c2200, do_parms=1 '\001') at ../../gcc-4.5/gcc/gimplify.c:7528#12 0x00000001004cceae in gimplify_function_tree (fndecl=0x1416c2200) at ../../gcc-4.5/gcc/gimplify.c:7624#13 0x00000001000069c7 in m3_gimplify_function (fndecl=0x1416c2200) at ../../gcc-4.5/gcc/m3cg/parse.c:2370#14 0x0000000100009cb4 in m3cg_end_procedure () at ../../gcc-4.5/gcc/m3cg/parse.c:3642#15 0x000000010000feb5 in m3_parse_file (xx=0) at ../../gcc-4.5/gcc/m3cg/parse.c:5550#16 0x00000001006be6a2 in compile_file () at ../../gcc-4.5/gcc/toplev.c:1053#17 0x00000001006c0e19 in do_compile () at ../../gcc-4.5/gcc/toplev.c:2415#18 0x00000001006c0ee0 in toplev_main (argc=3, argv=0x7fff5fbff930) at ../../gcc-4.5/gcc/toplev.c:2457#19 0x000000010001743b in main (argc=3, argv=0x7fff5fbff930) at ../../gcc-4.5/gcc/main.c:35(
Wierd, huh?
The only thing I can think of an int/word mismatch.I did change one instance of Integer to Word, after finding this.Stmt.Outcomes is an enumeration.So presumably Stmt.Outcomes { } is 0.Enumerations should work equally well as Integer or Word, right?Clearly above there is still a mix. I can try changing them all to Word.
I'll keep digging.
Maybe dump the entire function generic tree for this and similar C.
- Jay
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://m3lists.elegosoft.com/pipermail/m3devel/attachments/20100627/2ee35f81/attachment-0002.html>
More information about the M3devel
mailing list