diff --git a/src/ir.cpp b/src/ir.cpp index 9a5b79146c4435c59a31ed48ed0ffd88aa6f9ca3..acf9e0ca0056e69da7ff96425468ef73092c450b 100644 --- a/src/ir.cpp +++ b/src/ir.cpp @@ -4951,6 +4951,7 @@ static IrInstruction *ir_gen_builtin_fn_call(IrBuilder *irb, Scope *scope, AstNo ResultLocBitCast *result_loc_bit_cast = allocate(1); result_loc_bit_cast->base.id = ResultLocIdBitCast; result_loc_bit_cast->base.source_instruction = dest_type; + ir_ref_instruction(dest_type, irb->current_basic_block); result_loc_bit_cast->parent = result_loc; AstNode *arg1_node = node->data.fn_call_expr.params.at(1); @@ -24219,7 +24220,7 @@ static IrInstruction *ir_analyze_instruction_end_expr(IrAnalyze *ira, IrInstruct static IrInstruction *ir_analyze_instruction_bit_cast_src(IrAnalyze *ira, IrInstructionBitCastSrc *instruction) { IrInstruction *operand = instruction->operand->child; - if (type_is_invalid(operand->value.type) || instr_is_comptime(operand) || + if (type_is_invalid(operand->value.type) || instruction->result_loc_bit_cast->parent->gen_instruction == nullptr) { return operand; diff --git a/std/special/bootstrap.zig b/std/special/bootstrap.zig index f1286bd65969dbe2a76fe14cb24bde62898d4ffb..20f241797294ea2a1b7805069bf5f59de4f6f141 100644 --- a/std/special/bootstrap.zig +++ b/std/special/bootstrap.zig @@ -78,19 +78,19 @@ fn posixCallMainAndExit() noreturn { while (envp_optional[envp_count]) |_| : (envp_count += 1) {} const envp = @ptrCast([*][*]u8, envp_optional)[0..envp_count]; - if (builtin.os == .linux) { - // Find the beginning of the auxiliary vector - const auxv = @ptrCast([*]std.elf.Auxv, envp.ptr + envp_count + 1); - std.os.linux.elf_aux_maybe = auxv; - // Initialize the TLS area - std.os.linux.tls.initTLS(); + //if (builtin.os == .linux) { + // // Find the beginning of the auxiliary vector + // const auxv = @ptrCast([*]std.elf.Auxv, envp.ptr + envp_count + 1); + // std.os.linux.elf_aux_maybe = auxv; + // // Initialize the TLS area + // std.os.linux.tls.initTLS(); - if (std.os.linux.tls.tls_image) |tls_img| { - const tls_addr = std.os.linux.tls.allocateTLS(tls_img.alloc_size); - const tp = std.os.linux.tls.copyTLS(tls_addr); - std.os.linux.tls.setThreadPointer(tp); - } - } + // if (std.os.linux.tls.tls_image) |tls_img| { + // const tls_addr = std.os.linux.tls.allocateTLS(tls_img.alloc_size); + // const tp = std.os.linux.tls.copyTLS(tls_addr); + // std.os.linux.tls.setThreadPointer(tp); + // } + //} std.os.exit(callMainWithArgs(argc, argv, envp)); }