? .DS_Store ? 1.txt ? 2.txt ? gcc/1.txt ? gcc/2.txt ? gcc/m3cg Index: gcc/calls.c =================================================================== RCS file: /usr/cvs/cm3/m3-sys/m3cc/gcc-4.5/gcc/calls.c,v retrieving revision 1.1.1.1 diff -u -w -r1.1.1.1 calls.c --- gcc/calls.c 28 May 2010 05:43:02 -0000 1.1.1.1 +++ gcc/calls.c 29 Jun 2010 20:56:05 -0000 @@ -190,7 +190,7 @@ { rtx chain; - gcc_assert (fndecl); + /*gcc_assert (fndecl); removed for Modula-3 */ chain = targetm.calls.static_chain (fndecl, false); static_chain_value = convert_memory_address (Pmode, static_chain_value); Index: gcc/fold-const.c =================================================================== RCS file: /usr/cvs/cm3/m3-sys/m3cc/gcc-4.5/gcc/fold-const.c,v retrieving revision 1.1.1.1 diff -u -w -r1.1.1.1 fold-const.c --- gcc/fold-const.c 28 May 2010 05:44:16 -0000 1.1.1.1 +++ gcc/fold-const.c 29 Jun 2010 20:56:07 -0000 @@ -14044,13 +14044,13 @@ return fold_convert_loc (loc, type, integer_zero_node); } } - +#if 0 /* temporarily removed for Modula-3 */ /* A bit-field-ref that referenced the full argument can be stripped. */ if (INTEGRAL_TYPE_P (TREE_TYPE (arg0)) && TYPE_PRECISION (TREE_TYPE (arg0)) == tree_low_cst (arg1, 1) && integer_zerop (op2)) return fold_convert_loc (loc, type, arg0); - +#endif return NULL_TREE; default: Index: gcc/gimple.c =================================================================== RCS file: /usr/cvs/cm3/m3-sys/m3cc/gcc-4.5/gcc/gimple.c,v retrieving revision 1.1.1.1 diff -u -w -r1.1.1.1 gimple.c --- gcc/gimple.c 28 May 2010 05:44:29 -0000 1.1.1.1 +++ gcc/gimple.c 29 Jun 2010 20:56:07 -0000 @@ -2400,6 +2400,7 @@ || (SYM) == POLYNOMIAL_CHREC \ || (SYM) == DOT_PROD_EXPR \ || (SYM) == VEC_COND_EXPR \ + || (SYM) == STATIC_CHAIN_EXPR \ || (SYM) == REALIGN_LOAD_EXPR) ? GIMPLE_SINGLE_RHS \ : GIMPLE_INVALID_RHS), #define END_OF_BASE_TREE_CODES (unsigned char) GIMPLE_INVALID_RHS, Index: gcc/gimplify.c =================================================================== RCS file: /usr/cvs/cm3/m3-sys/m3cc/gcc-4.5/gcc/gimplify.c,v retrieving revision 1.1.1.1 diff -u -w -r1.1.1.1 gimplify.c --- gcc/gimplify.c 28 May 2010 05:44:31 -0000 1.1.1.1 +++ gcc/gimplify.c 29 Jun 2010 20:56:08 -0000 @@ -1658,7 +1658,7 @@ adjustment would be needed. */ if (TREE_TYPE (expr) != type) { -#ifdef ENABLE_TYPES_CHECKING +#if 1 tree old_type = TREE_TYPE (expr); #endif int type_quals; @@ -1673,7 +1673,7 @@ /* Set the type of the COMPONENT_REF to the underlying type. */ TREE_TYPE (expr) = type; -#ifdef ENABLE_TYPES_CHECKING +#if 1 /* It is now a FE error, if the conversion from the canonical type to the original expression type is not useless. */ gcc_assert (useless_type_conversion_p (old_type, type)); @@ -6584,6 +6584,11 @@ } break; + case STATIC_CHAIN_EXPR: + /* This gets converted fairly early, in tree-nested.c */ + ret = GS_ALL_DONE; + break; + case CALL_EXPR: ret = gimplify_call_expr (expr_p, pre_p, fallback != fb_none); @@ -7565,7 +7570,7 @@ pop_gimplify_context (outer_bind); gcc_assert (gimplify_ctxp == NULL); -#ifdef ENABLE_TYPES_CHECKING +#if 1 if (!errorcount && !sorrycount) verify_types_in_gimple_seq (gimple_bind_body (outer_bind)); #endif Index: gcc/tree-cfg.c =================================================================== RCS file: /usr/cvs/cm3/m3-sys/m3cc/gcc-4.5/gcc/tree-cfg.c,v retrieving revision 1.1.1.1 diff -u -w -r1.1.1.1 tree-cfg.c --- gcc/tree-cfg.c 28 May 2010 05:45:03 -0000 1.1.1.1 +++ gcc/tree-cfg.c 29 Jun 2010 20:56:09 -0000 @@ -2785,7 +2785,7 @@ if (!useless_type_conversion_p (TREE_TYPE (expr), TREE_TYPE (TREE_TYPE (op)))) { - error ("type mismatch in indirect reference"); + warning_at (UNKNOWN_LOCATION, 0, "type mismatch in indirect reference"); debug_generic_stmt (TREE_TYPE (expr)); debug_generic_stmt (TREE_TYPE (TREE_TYPE (op))); return true; @@ -2969,7 +2969,7 @@ && !(POINTER_TYPE_P (TREE_TYPE (gimple_call_lhs (stmt))) && POINTER_TYPE_P (TREE_TYPE (fntype)))) { - error ("invalid conversion in gimple call"); + warning_at (UNKNOWN_LOCATION, 0, "invalid conversion in gimple call"); debug_generic_stmt (TREE_TYPE (gimple_call_lhs (stmt))); debug_generic_stmt (TREE_TYPE (fntype)); return true; @@ -2978,7 +2978,7 @@ if (gimple_call_chain (stmt) && !is_gimple_val (gimple_call_chain (stmt))) { - error ("invalid static chain in gimple call"); + warning_at (UNKNOWN_LOCATION, 0, "invalid static chain in gimple call"); debug_generic_stmt (gimple_call_chain (stmt)); return true; } @@ -3049,7 +3049,7 @@ || TYPE_MODE (op0_type) != TYPE_MODE (op1_type))) || !INTEGRAL_TYPE_P (type)) { - error ("type mismatch in comparison expression"); + warning_at (UNKNOWN_LOCATION, 0, "type mismatch in comparison expression"); debug_generic_expr (type); debug_generic_expr (op0_type); debug_generic_expr (op1_type); @@ -3206,7 +3206,7 @@ /* For the remaining codes assert there is no conversion involved. */ if (!useless_type_conversion_p (lhs_type, rhs1_type)) { - error ("non-trivial conversion in unary operation"); + warning_at (UNKNOWN_LOCATION, 0, "non-trivial conversion in unary operation"); debug_generic_expr (lhs_type); debug_generic_expr (rhs1_type); return true; @@ -3284,7 +3284,7 @@ && INTEGRAL_TYPE_P (TREE_TYPE (rhs2_type)))) || !useless_type_conversion_p (lhs_type, rhs1_type)) { - error ("type mismatch in shift expression"); + warning_at (UNKNOWN_LOCATION, 0, "type mismatch in shift expression"); debug_generic_expr (lhs_type); debug_generic_expr (rhs1_type); debug_generic_expr (rhs2_type); @@ -3467,7 +3467,7 @@ if (!useless_type_conversion_p (lhs_type, rhs1_type) || !useless_type_conversion_p (lhs_type, rhs2_type)) { - error ("type mismatch in binary expression"); + warning_at (UNKNOWN_LOCATION, 0, "type mismatch in binary expression"); debug_generic_stmt (lhs_type); debug_generic_stmt (rhs1_type); debug_generic_stmt (rhs2_type); @@ -3492,7 +3492,7 @@ if (!useless_type_conversion_p (lhs_type, rhs1_type)) { - error ("non-trivial conversion at assignment"); + warning_at (UNKNOWN_LOCATION, 0, "non-trivial conversion at assignment"); debug_generic_expr (lhs_type); debug_generic_expr (rhs1_type); return true; @@ -3874,7 +3874,7 @@ verify_types_in_gimple_seq (gimple_seq stmts) { if (verify_types_in_gimple_seq_2 (stmts)) - internal_error ("verify_gimple failed"); + warning_at (UNKNOWN_LOCATION, 0, "verify_gimple failed"); } Index: gcc/tree-nested.c =================================================================== RCS file: /usr/cvs/cm3/m3-sys/m3cc/gcc-4.5/gcc/tree-nested.c,v retrieving revision 1.2 diff -u -w -r1.2 tree-nested.c --- gcc/tree-nested.c 30 May 2010 14:42:04 -0000 1.2 +++ gcc/tree-nested.c 29 Jun 2010 20:56:09 -0000 @@ -2063,6 +2063,35 @@ return NULL_TREE; } +static tree +convert_gimple_call_op (tree *tp, int *walk_subtrees, void *data) +{ + struct walk_stmt_info *wi = (struct walk_stmt_info *) data; + struct nesting_info *const info = (struct nesting_info *) wi->info; + tree t = *tp, decl, target_context; + + *walk_subtrees = 0; + switch (TREE_CODE (t)) + { + case STATIC_CHAIN_EXPR: + decl = TREE_OPERAND (t, 0); + target_context = decl_function_context (decl); + gcc_assert (target_context); + if (info->context == target_context) + { + /* Make sure frame_decl gets created. */ + (void) get_frame_type (info); + } + *tp = get_static_chain (info, target_context, &wi->gsi); + break; + + default: + break; + } + + return NULL_TREE; +} + /* Walk the nesting tree starting with ROOT. Convert all trampolines and call expressions. At the same time, determine if a nested function actually uses its static chain; if not, remember that. */ @@ -2113,7 +2142,7 @@ walk_function (convert_tramp_reference_stmt, convert_tramp_reference_op, n); - walk_function (convert_gimple_call, NULL, n); + walk_function (convert_gimple_call, convert_gimple_call_op, n); /* If a call to another function created the use of a chain within this function, we'll have to continue iteration. */ Index: gcc/config/i386/i386.c =================================================================== RCS file: /usr/cvs/cm3/m3-sys/m3cc/gcc-4.5/gcc/config/i386/i386.c,v retrieving revision 1.2 diff -u -w -r1.2 i386.c --- gcc/config/i386/i386.c 28 May 2010 08:19:07 -0000 1.2 +++ gcc/config/i386/i386.c 29 Jun 2010 20:56:12 -0000 @@ -20138,7 +20138,7 @@ { unsigned regno; - if (!DECL_STATIC_CHAIN (fndecl)) + if (fndecl && !DECL_STATIC_CHAIN (fndecl)) return NULL; if (TARGET_64BIT) @@ -20148,11 +20148,11 @@ } else { - tree fntype; /* By default in 32-bit mode we use ECX to pass the static chain. */ regno = CX_REG; - - fntype = TREE_TYPE (fndecl); + if (fndecl) /* Modula-3 can pass NULL */ + { + tree fntype = TREE_TYPE (fndecl); if (lookup_attribute ("fastcall", TYPE_ATTRIBUTES (fntype))) { /* Fastcall functions use ecx/edx for arguments, which leaves @@ -20179,6 +20179,7 @@ regno = SI_REG; } } + } return gen_rtx_REG (Pmode, regno); }