1
0
mirror of https://gitlab.com/camelot/kickc.git synced 2024-11-25 05:33:29 +00:00

main merged

This commit is contained in:
jespergravgaard 2023-05-21 19:16:51 +02:00
parent a20fd82d2d
commit 2ee4e5c14a
6 changed files with 110 additions and 118 deletions

View File

@ -286,14 +286,10 @@ public class Pass0GenerateStatementSequence extends KickCParserBaseVisitor<Objec
} catch(IllegalArgumentException e) {
throw new CompileError("Unknown string encoding " + encodingName, new StatementSource(ctx));
}
break;
case CParser.PRAGMA_CODE_SEG:
this.currentSegmentCode = pragmaParamName(pragmaParamSingle(ctx));
break;
case CParser.PRAGMA_DATA_SEG:
this.currentSegmentData = pragmaParamName(pragmaParamSingle(ctx));
break;
case CParser.PRAGMA_BANK:
}
case CParser.PRAGMA_CODE_SEG -> this.currentSegmentCode = pragmaParamName(pragmaParamSingle(ctx));
case CParser.PRAGMA_DATA_SEG -> this.currentSegmentData = pragmaParamName(pragmaParamSingle(ctx));
case CParser.PRAGMA_BANK -> {
if(ctx.pragmaParam().size() != 2)
throw new CompileError("#pragma expects two parameters!", new StatementSource(ctx));
try {
@ -303,10 +299,8 @@ public class Pass0GenerateStatementSequence extends KickCParserBaseVisitor<Objec
} catch(IllegalArgumentException e) {
throw new CompileError("Illegal bank parameter " + ctx.getText(), new StatementSource(ctx));
}
break;
case CParser.PRAGMA_NOBANK:
this.currentBank = Bank.COMMON; // When the current segment is null, the procedure will not be declared as far.
break;
}
case CParser.PRAGMA_NOBANK -> this.currentBank = Bank.COMMON; // When the current segment is null, the procedure will not be declared as far.
case CParser.PRAGMA_RESOURCE -> {
String resourceFileName = pragmaParamString(pragmaParamSingle(ctx));
addResourceFile(ctx, resourceFileName);
@ -502,10 +496,8 @@ public class Pass0GenerateStatementSequence extends KickCParserBaseVisitor<Objec
*/
private Procedure declareProcedure(boolean defineProcedure, ParserRuleContext ctx, StatementSource statementSource) {
Procedure procedure = new Procedure(varDecl.getVarName(), (SymbolTypeProcedure) varDecl.getEffectiveType(), program.getScope(), currentCodeSegment, currentDataSegment, currentCallingConvention);
addDirectives(procedure, varDecl.getDeclDirectives());
Procedure procedure = new Procedure(varDecl.getVarName(), (SymbolTypeProcedure) varDecl.getEffectiveType(), program.getScope(), currentSegmentCode, currentSegmentData, currentCallingConvention, currentBank);
addDirectives(procedure, varDecl.getDeclDirectives(), statementSource);
addDirectives(procedure, varDecl.getDeclDirectives());
// Check if the declaration matches any existing declaration!
final Symbol existingSymbol = program.getScope().getSymbol(procedure.getRef());
if(existingSymbol != null) {

View File

@ -21,7 +21,7 @@ public class Pass1FixProcedureParamSegment extends Pass2SsaOptimization {
@Override
public boolean step() {
final Collection<Variable> allVariables = getScope().getAllVariables(true);
final Collection<Variable> allVariables = getProgramScope().getAllVariables(true);
for(Variable variable : allVariables) {
if(variable.isKindLoadStore() || variable.isKindPhiMaster() || variable.isKindIntermediate()) {
if(variable.getRegister() instanceof Registers.RegisterMainMem registerMainMem && registerMainMem.isAddressHardcoded())

View File

@ -115,7 +115,7 @@ public class Pass4CodeGeneration {
currentScope = block.getScope();
if (program.isProcedureEntry(block)) {
Procedure procedure = program.getProcedure(block);
currentCodeSegmentName = procedure.getCodeSegment();
currentCodeSegmentName = procedure.getSegmentCode();
}
setCurrentSegment(currentCodeSegmentName, asm);
asm.startChunk(currentScope, null, block.getLabel().getFullName());
@ -857,7 +857,7 @@ public class Pass4CodeGeneration {
} else if (statement instanceof StatementCall) {
StatementCall call = (StatementCall) statement;
Procedure toProcedure = getScope().getProcedure(call.getProcedure());
Procedure fromProcedure = block.getProcedure(this.program); // We obtain from where the procedure is called, to validate the bank equality.
Procedure fromProcedure = program.getProcedure(block); // We obtain from where the procedure is called, to validate the bank equality.
if (toProcedure.isDeclaredIntrinsic()) {
if (Pass1ByteXIntrinsicRewrite.INTRINSIC_MAKELONG4.equals(toProcedure.getFullName())) {
AsmFragmentCodeGenerator.generateAsm(asm, AsmFragmentInstanceSpecBuilder.makelong4(call, program), program);
@ -896,7 +896,7 @@ public class Pass4CodeGeneration {
if(procedureRef != null) {
ProgramScope scope = getScope();
Procedure toProcedure = scope.getProcedure(procedureRef);
Procedure fromProcedure = block.getProcedure(this.program);
Procedure fromProcedure = program.getProcedure(block);
final Bank.CallingDistance callingDistance = Bank.CallingDistance.forCall(fromProcedure.getBank(), toProcedure.getBank());
if(Bank.CallingDistance.NEAR.equals(callingDistance)) {
AsmFragmentCodeGenerator.generateAsm(asm, AsmFragmentInstanceSpecBuilder.call(call, indirectCallCount++, program), program);

View File

@ -2440,10 +2440,10 @@ Successful SSA optimization Pass2ConditionalAndOrRewriting
Warning! Adding boolean cast to non-boolean condition utoa::started#2
Warning! Adding boolean cast to non-boolean condition printf_number_buffer::format_zero_padding#10
Warning! Adding boolean cast to non-boolean condition printf_number_buffer::format_justify_left#10
Warning! Adding boolean cast to non-boolean condition printf_number_buffer::padding#10
Warning! Adding boolean cast to non-boolean condition printf_number_buffer::padding#10
Warning! Adding boolean cast to non-boolean condition printf_number_buffer::padding#10
Warning! Adding boolean cast to non-boolean condition printf_string::format_justify_left#0
Warning! Adding boolean cast to non-boolean condition printf_number_buffer::padding#10
Warning! Adding boolean cast to non-boolean condition printf_number_buffer::padding#10
Warning! Adding boolean cast to non-boolean condition printf_number_buffer::padding#10
Warning! Adding boolean cast to non-boolean condition printf_string::padding#3
Warning! Adding boolean cast to non-boolean condition printf_string::padding#3
Constant right-side identified [105] conio_c64_init::line#1 = (unumber)$19-1
@ -2608,9 +2608,9 @@ Removing unused block printf_string::@7
Removing PHI-reference to removed block (printf_string::@4) in block printf_string::@1
Removing unused block printf_string::@4
Successful SSA optimization Pass2EliminateUnusedBlocks
Eliminating unused variable printf_number_buffer::format_sign_always#0 and assignment [95] printf_number_buffer::format_sign_always#0 = printf_sint::format_sign_always#2
Eliminating unused variable printf_number_buffer::format_radix#0 and assignment [98] printf_number_buffer::format_radix#0 = printf_sint::format_radix#2
Eliminating unused variable strupr::return#2 and assignment [145] strupr::return#2 = strupr::str#0
Eliminating unused variable printf_number_buffer::format_sign_always#0 and assignment [97] printf_number_buffer::format_sign_always#0 = printf_sint::format_sign_always#2
Eliminating unused variable printf_number_buffer::format_radix#0 and assignment [100] printf_number_buffer::format_radix#0 = printf_sint::format_radix#2
Eliminating unused variable strupr::return#2 and assignment [147] strupr::return#2 = strupr::str#0
Eliminating unused constant strlen::str#2
Eliminating unused constant utoa::max_digits#0
Eliminating unused constant utoa::digit_values#0
@ -2628,10 +2628,10 @@ Successful SSA optimization PassNEliminateUnusedVars
Adding number conversion cast (unumber) 0 in utoa::$12 = 0 != utoa::started#2
Adding number conversion cast (unumber) 0 in printf_number_buffer::$33 = 0 != printf_number_buffer::format_zero_padding#10
Adding number conversion cast (unumber) 0 in printf_number_buffer::$34 = 0 != printf_number_buffer::format_justify_left#10
Adding number conversion cast (unumber) 0 in printf_string::$16 = 0 != printf_string::format_justify_left#0
Adding number conversion cast (snumber) 0 in printf_number_buffer::$35 = 0 != printf_number_buffer::padding#10
Adding number conversion cast (snumber) 0 in printf_number_buffer::$36 = 0 != printf_number_buffer::padding#10
Adding number conversion cast (snumber) 0 in printf_number_buffer::$37 = 0 != printf_number_buffer::padding#10
Adding number conversion cast (unumber) 0 in printf_string::$16 = 0 != printf_string::format_justify_left#0
Adding number conversion cast (snumber) 0 in printf_string::$17 = 0 != printf_string::padding#3
Adding number conversion cast (snumber) 0 in printf_string::$18 = 0 != printf_string::padding#3
Successful SSA optimization PassNAddNumberTypeConversions
@ -2648,53 +2648,53 @@ Successful SSA optimization PassNCastSimplification
Finalized unsigned number type (char) 0
Finalized unsigned number type (char) 0
Finalized unsigned number type (char) 0
Finalized signed number type (signed char) 0
Finalized signed number type (signed char) 0
Finalized signed number type (signed char) 0
Finalized unsigned number type (char) 0
Finalized signed number type (signed char) 0
Finalized signed number type (signed char) 0
Finalized signed number type (signed char) 0
Finalized signed number type (signed char) 0
Finalized signed number type (signed char) 0
Successful SSA optimization PassNFinalizeNumberTypeConversions
Identical Phi Values strlen::str#5 strlen::str#1
Identical Phi Values printf_uint::$2 printf_uint::$0
Identical Phi Values printf_string::padding#3 printf_string::padding#0
Successful SSA optimization Pass2IdenticalPhiElimination
Simple Condition toupper::$0 [8] if(toupper::ch#0>='a') goto toupper::@3
Simple Condition utoa::$12 [42] if(0!=utoa::started#2) goto utoa::@14
Simple Condition printf_number_buffer::$1 [110] if(0==printf_number_buffer::format_justify_left#10) goto printf_number_buffer::@22
Simple Condition printf_number_buffer::$33 [127] if(0!=printf_number_buffer::format_zero_padding#10) goto printf_number_buffer::@23
Simple Condition printf_number_buffer::$34 [140] if(0!=printf_number_buffer::format_justify_left#10) goto printf_number_buffer::@25
Simple Condition printf_string::$1 [149] if(0==printf_string::format_justify_left#0) goto printf_string::@11
Simple Condition printf_string::$16 [152] if(0!=printf_string::format_justify_left#0) goto printf_string::@12
Simple Condition toupper::$1 [217] if(toupper::ch#0<='z') goto toupper::@1
Simple Condition utoa::$6 [218] if(utoa::value#3>=utoa::digit_value#0) goto utoa::@14
Simple Condition printf_number_buffer::$35 [220] if(0!=printf_number_buffer::padding#10) goto printf_number_buffer::@8
Simple Condition printf_number_buffer::$2 [221] if(0==printf_number_buffer::format_zero_padding#10) goto printf_number_buffer::@21
Simple Condition printf_number_buffer::$36 [223] if(0!=printf_number_buffer::padding#10) goto printf_number_buffer::@10
Simple Condition printf_number_buffer::$37 [225] if(0!=printf_number_buffer::padding#10) goto printf_number_buffer::@12
Simple Condition printf_number_buffer::$14 [226] if(0==printf_number_buffer::format_zero_padding#10) goto printf_number_buffer::@24
Simple Condition printf_string::$17 [228] if(0!=printf_string::padding#0) goto printf_string::@5
Simple Condition printf_string::$18 [230] if(0!=printf_string::padding#0) goto printf_string::@6
Simple Condition toupper::$1 [12] if(toupper::ch#0<='z') goto toupper::@1
Simple Condition utoa::$12 [43] if(0!=utoa::started#2) goto utoa::@14
Simple Condition utoa::$6 [57] if(utoa::value#3>=utoa::digit_value#0) goto utoa::@14
Simple Condition printf_number_buffer::$1 [112] if(0==printf_number_buffer::format_justify_left#10) goto printf_number_buffer::@22
Simple Condition printf_number_buffer::$33 [129] if(0!=printf_number_buffer::format_zero_padding#10) goto printf_number_buffer::@23
Simple Condition printf_number_buffer::$34 [142] if(0!=printf_number_buffer::format_justify_left#10) goto printf_number_buffer::@25
Simple Condition printf_number_buffer::$35 [150] if(0!=printf_number_buffer::padding#10) goto printf_number_buffer::@8
Simple Condition printf_number_buffer::$2 [151] if(0==printf_number_buffer::format_zero_padding#10) goto printf_number_buffer::@21
Simple Condition printf_number_buffer::$36 [153] if(0!=printf_number_buffer::padding#10) goto printf_number_buffer::@10
Simple Condition printf_number_buffer::$37 [155] if(0!=printf_number_buffer::padding#10) goto printf_number_buffer::@12
Simple Condition printf_number_buffer::$14 [156] if(0==printf_number_buffer::format_zero_padding#10) goto printf_number_buffer::@24
Simple Condition printf_string::$1 [159] if(0==printf_string::format_justify_left#0) goto printf_string::@11
Simple Condition printf_string::$16 [162] if(0!=printf_string::format_justify_left#0) goto printf_string::@12
Simple Condition printf_string::$17 [169] if(0!=printf_string::padding#0) goto printf_string::@5
Simple Condition printf_string::$18 [171] if(0!=printf_string::padding#0) goto printf_string::@6
Successful SSA optimization Pass2ConditionalJumpSimplification
Negating conditional jump and destination [8] if(toupper::ch#0<'a') goto toupper::@2
Negating conditional jump and destination [110] if(0!=printf_number_buffer::format_justify_left#10) goto printf_number_buffer::@2
Negating conditional jump and destination [127] if(0==printf_number_buffer::format_zero_padding#10) goto printf_number_buffer::@4
Negating conditional jump and destination [140] if(0==printf_number_buffer::format_justify_left#10) goto printf_number_buffer::@return
Negating conditional jump and destination [149] if(0!=printf_string::format_justify_left#0) goto printf_string::@2
Negating conditional jump and destination [152] if(0==printf_string::format_justify_left#0) goto printf_string::@return
Negating conditional jump and destination [221] if(0!=printf_number_buffer::format_zero_padding#10) goto printf_number_buffer::@2
Negating conditional jump and destination [226] if(0!=printf_number_buffer::format_zero_padding#10) goto printf_number_buffer::@return
Negating conditional jump and destination [112] if(0!=printf_number_buffer::format_justify_left#10) goto printf_number_buffer::@2
Negating conditional jump and destination [129] if(0==printf_number_buffer::format_zero_padding#10) goto printf_number_buffer::@4
Negating conditional jump and destination [142] if(0==printf_number_buffer::format_justify_left#10) goto printf_number_buffer::@return
Negating conditional jump and destination [151] if(0!=printf_number_buffer::format_zero_padding#10) goto printf_number_buffer::@2
Negating conditional jump and destination [156] if(0!=printf_number_buffer::format_zero_padding#10) goto printf_number_buffer::@return
Negating conditional jump and destination [159] if(0!=printf_string::format_justify_left#0) goto printf_string::@2
Negating conditional jump and destination [162] if(0==printf_string::format_justify_left#0) goto printf_string::@return
Successful SSA optimization Pass2ConditionalJumpSequenceImprovement
Constant right-side identified [153] printf_padding::length#3 = (char)printf_string::padding#0
Constant right-side identified [155] printf_padding::length#4 = (char)printf_string::padding#0
Constant right-side identified [163] printf_padding::length#3 = (char)printf_string::padding#0
Constant right-side identified [165] printf_padding::length#4 = (char)printf_string::padding#0
Successful SSA optimization Pass2ConstantRValueConsolidation
Constant printf_padding::length#3 = (char)printf_string::padding#0
Constant printf_padding::length#4 = (char)printf_string::padding#0
Successful SSA optimization Pass2ConstantIdentification
if() condition always false - eliminating [149] if(0!=printf_string::format_justify_left#0) goto printf_string::@2
if() condition always true - replacing block destination [152] if(0==printf_string::format_justify_left#0) goto printf_string::@return
if() condition always false - eliminating [228] if(0!=printf_string::padding#0) goto printf_string::@5
if() condition always false - eliminating [230] if(0!=printf_string::padding#0) goto printf_string::@6
if() condition always false - eliminating [159] if(0!=printf_string::format_justify_left#0) goto printf_string::@2
if() condition always true - replacing block destination [162] if(0==printf_string::format_justify_left#0) goto printf_string::@return
if() condition always false - eliminating [169] if(0!=printf_string::padding#0) goto printf_string::@5
if() condition always false - eliminating [171] if(0!=printf_string::padding#0) goto printf_string::@6
Successful SSA optimization Pass2ConstantIfs
Simplifying constant evaluating to zero (char)printf_string::padding#0 in
Simplifying constant evaluating to zero (char)printf_string::padding#0 in
@ -2720,10 +2720,10 @@ Eliminating unused constant printf_padding::length#4
Eliminating unused constant printf_string::padding#0
Eliminating unused constant printf_string::format_justify_left#0
Successful SSA optimization PassNEliminateUnusedVars
Inlining Noop Cast [82] printf_sint::uvalue#0 = (unsigned int)printf_sint::value#5 keeping printf_sint::value#5
Inlining Noop Cast [110] printf_number_buffer::$25 = (signed char)printf_number_buffer::format_min_length#2 keeping printf_number_buffer::format_min_length#2
Inlining Noop Cast [84] printf_sint::uvalue#0 = (unsigned int)printf_sint::value#5 keeping printf_sint::value#5
Inlining Noop Cast [112] printf_number_buffer::$25 = (signed char)printf_number_buffer::format_min_length#2 keeping printf_number_buffer::format_min_length#2
Successful SSA optimization Pass2NopCastInlining
Rewriting multiplication to use shift [35] utoa::$10 = utoa::digit#2 * SIZEOF_UNSIGNED_INT
Rewriting multiplication to use shift [36] utoa::$10 = utoa::digit#2 * SIZEOF_UNSIGNED_INT
Successful SSA optimization Pass2MultiplyToShiftRewriting
Inlining constant with var siblings strlen::len#0
Inlining constant with var siblings utoa::max_digits#1
@ -2899,7 +2899,7 @@ Identical Phi Values printf_number_buffer::buffer_digits#10 (char *)&printf_buff
Identical Phi Values snprintf_init::s#4 BUF
Identical Phi Values print::msg#7 BUF
Successful SSA optimization Pass2IdenticalPhiElimination
Constant right-side identified [24] utoa::buffer#0 = ++ (char *)&printf_buffer+OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_DIGITS
Constant right-side identified [25] utoa::buffer#0 = ++ (char *)&printf_buffer+OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_DIGITS
Successful SSA optimization Pass2ConstantRValueConsolidation
Constant utoa::buffer#0 = ++(char *)&printf_buffer+OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_DIGITS
Constant utoa::radix#0 = DECIMAL
@ -2912,7 +2912,7 @@ Constant strlen::str#1 = (char *)&printf_buffer+OFFSET_STRUCT_PRINTF_BUFFER_NUMB
Constant printf_str::s#1 = (char *)&printf_buffer+OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_DIGITS
Constant strupr::str#0 = (char *)&printf_buffer+OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_DIGITS
Successful SSA optimization Pass2ConstantIdentification
if() condition always true - replacing block destination [79] if(0==0) goto printf_sint::@2
if() condition always true - replacing block destination [81] if(0==0) goto printf_sint::@2
Successful SSA optimization Pass2ConstantIfs
Removing PHI-reference to removed block (printf_sint::@4) in block printf_sint::@2
Removing unused block printf_sint::@4
@ -2941,8 +2941,8 @@ Successful SSA optimization Pass2ConstantInlining
Simplifying constant integer increment ++(char *)&printf_buffer+OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_DIGITS
Simplifying constant integer increment ++(char *)&printf_buffer+OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_DIGITS
Successful SSA optimization Pass2ConstantSimplification
Adding number conversion cast (unumber) 1 in [24] *((char *)&printf_buffer+OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_DIGITS+1) = 'r'
Adding number conversion cast (unumber) 1 in [25] utoa::buffer#1 = ++ (char *)&printf_buffer+OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_DIGITS+1
Adding number conversion cast (unumber) 1 in [25] *((char *)&printf_buffer+OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_DIGITS+1) = 'r'
Adding number conversion cast (unumber) 1 in [26] utoa::buffer#1 = ++ (char *)&printf_buffer+OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_DIGITS+1
Successful SSA optimization PassNAddNumberTypeConversions
Simplifying constant integer cast 1
Simplifying constant integer cast 1
@ -2950,7 +2950,7 @@ Successful SSA optimization PassNCastSimplification
Finalized unsigned number type (char) 1
Finalized unsigned number type (char) 1
Successful SSA optimization PassNFinalizeNumberTypeConversions
Constant right-side identified [25] utoa::buffer#1 = ++ (char *)&printf_buffer+OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_DIGITS+1
Constant right-side identified [26] utoa::buffer#1 = ++ (char *)&printf_buffer+OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_DIGITS+1
Successful SSA optimization Pass2ConstantRValueConsolidation
Constant utoa::buffer#1 = ++(char *)&printf_buffer+OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_DIGITS+1
Successful SSA optimization Pass2ConstantIdentification
@ -2960,7 +2960,7 @@ Successful SSA optimization Pass2ConstantInlining
Simplifying constant integer increment ++(char *)&printf_buffer+OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_DIGITS+1
Simplifying constant integer increment ++(char *)&printf_buffer+OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_DIGITS+1
Successful SSA optimization Pass2ConstantSimplification
Constant right-side identified [26] utoa::buffer#2 = ++ (char *)&printf_buffer+OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_DIGITS+2
Constant right-side identified [27] utoa::buffer#2 = ++ (char *)&printf_buffer+OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_DIGITS+2
Successful SSA optimization Pass2ConstantRValueConsolidation
Constant utoa::buffer#2 = ++(char *)&printf_buffer+OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_DIGITS+2
Successful SSA optimization Pass2ConstantIdentification

View File

@ -1266,8 +1266,8 @@ Identical Phi Values gotoxy::x#3 gotoxy::x#2
Successful SSA optimization Pass2IdenticalPhiElimination
Simple Condition printf_string::$1 [91] if(0==printf_string::format_justify_left#10) goto printf_string::@11
Simple Condition printf_string::$16 [104] if(0!=printf_string::format_justify_left#10) goto printf_string::@12
Simple Condition printf_string::$17 [154] if(0!=printf_string::padding#3) goto printf_string::@5
Simple Condition printf_string::$18 [156] if(0!=printf_string::padding#3) goto printf_string::@6
Simple Condition printf_string::$17 [113] if(0!=printf_string::padding#3) goto printf_string::@5
Simple Condition printf_string::$18 [115] if(0!=printf_string::padding#3) goto printf_string::@6
Successful SSA optimization Pass2ConditionalJumpSimplification
Negating conditional jump and destination [91] if(0!=printf_string::format_justify_left#10) goto printf_string::@2
Negating conditional jump and destination [104] if(0==printf_string::format_justify_left#10) goto printf_string::@return
@ -1456,7 +1456,7 @@ Successful SSA optimization Pass2ConstantRValueConsolidation
Constant printf_padding::length#0 = (char)0
Successful SSA optimization Pass2ConstantIdentification
if() condition always false - eliminating [69] if(printf_padding::i#2<printf_padding::length#0) goto printf_padding::@2
if() condition always false - eliminating [125] if(0!=0) goto printf_string::@5
if() condition always false - eliminating [84] if(0!=0) goto printf_string::@5
Successful SSA optimization Pass2ConstantIfs
Simplifying constant evaluating to zero (char)0 in
Successful SSA optimization PassNSimplifyConstantZero

View File

@ -3025,10 +3025,10 @@ Warning! Adding boolean cast to non-boolean condition utoa::started#2
Warning! Adding boolean cast to non-boolean condition ultoa::started#2
Warning! Adding boolean cast to non-boolean condition printf_number_buffer::format_zero_padding#10
Warning! Adding boolean cast to non-boolean condition printf_number_buffer::format_justify_left#10
Warning! Adding boolean cast to non-boolean condition printf_number_buffer::padding#10
Warning! Adding boolean cast to non-boolean condition printf_number_buffer::padding#10
Warning! Adding boolean cast to non-boolean condition printf_number_buffer::padding#10
Warning! Adding boolean cast to non-boolean condition printf_string::format_justify_left#0
Warning! Adding boolean cast to non-boolean condition printf_number_buffer::padding#10
Warning! Adding boolean cast to non-boolean condition printf_number_buffer::padding#10
Warning! Adding boolean cast to non-boolean condition printf_number_buffer::padding#10
Warning! Adding boolean cast to non-boolean condition printf_string::padding#3
Warning! Adding boolean cast to non-boolean condition printf_string::padding#3
Constant right-side identified [168] conio_c64_init::line#1 = (unumber)$19-1
@ -3263,7 +3263,7 @@ Removing unused block printf_string::@7
Removing PHI-reference to removed block (printf_string::@4) in block printf_string::@1
Removing unused block printf_string::@4
Successful SSA optimization Pass2EliminateUnusedBlocks
Eliminating unused variable strupr::return#2 and assignment [168] strupr::return#2 = strupr::str#0
Eliminating unused variable strupr::return#2 and assignment [171] strupr::return#2 = strupr::str#0
Eliminating unused constant strlen::str#2
Eliminating unused constant utoa::max_digits#0
Eliminating unused constant utoa::digit_values#0
@ -3301,10 +3301,10 @@ Adding number conversion cast (unumber) 0 in utoa::$12 = 0 != utoa::started#2
Adding number conversion cast (unumber) 0 in ultoa::$12 = 0 != ultoa::started#2
Adding number conversion cast (unumber) 0 in printf_number_buffer::$33 = 0 != printf_number_buffer::format_zero_padding#10
Adding number conversion cast (unumber) 0 in printf_number_buffer::$34 = 0 != printf_number_buffer::format_justify_left#10
Adding number conversion cast (unumber) 0 in printf_string::$16 = 0 != printf_string::format_justify_left#0
Adding number conversion cast (snumber) 0 in printf_number_buffer::$35 = 0 != printf_number_buffer::padding#10
Adding number conversion cast (snumber) 0 in printf_number_buffer::$36 = 0 != printf_number_buffer::padding#10
Adding number conversion cast (snumber) 0 in printf_number_buffer::$37 = 0 != printf_number_buffer::padding#10
Adding number conversion cast (unumber) 0 in printf_string::$16 = 0 != printf_string::format_justify_left#0
Adding number conversion cast (snumber) 0 in printf_string::$17 = 0 != printf_string::padding#3
Adding number conversion cast (snumber) 0 in printf_string::$18 = 0 != printf_string::padding#3
Successful SSA optimization PassNAddNumberTypeConversions
@ -3323,12 +3323,12 @@ Finalized unsigned number type (char) 0
Finalized unsigned number type (char) 0
Finalized unsigned number type (char) 0
Finalized unsigned number type (char) 0
Finalized signed number type (signed char) 0
Finalized signed number type (signed char) 0
Finalized signed number type (signed char) 0
Finalized unsigned number type (char) 0
Finalized signed number type (signed char) 0
Finalized signed number type (signed char) 0
Finalized signed number type (signed char) 0
Finalized signed number type (signed char) 0
Finalized signed number type (signed char) 0
Successful SSA optimization PassNFinalizeNumberTypeConversions
Identical Phi Values strlen::str#5 strlen::str#1
Identical Phi Values ultoa::max_digits#7 ultoa::max_digits#1
@ -3339,38 +3339,38 @@ Identical Phi Values printf_uint::$2 printf_uint::$0
Identical Phi Values printf_string::padding#3 printf_string::padding#0
Successful SSA optimization Pass2IdenticalPhiElimination
Simple Condition toupper::$0 [8] if(toupper::ch#0>='a') goto toupper::@3
Simple Condition utoa::$12 [42] if(0!=utoa::started#2) goto utoa::@14
Simple Condition ultoa::$12 [65] if(0!=ultoa::started#2) goto ultoa::@14
Simple Condition printf_number_buffer::$1 [135] if(0==printf_number_buffer::format_justify_left#10) goto printf_number_buffer::@22
Simple Condition printf_number_buffer::$33 [152] if(0!=printf_number_buffer::format_zero_padding#10) goto printf_number_buffer::@23
Simple Condition printf_number_buffer::$34 [165] if(0!=printf_number_buffer::format_justify_left#10) goto printf_number_buffer::@25
Simple Condition printf_string::$1 [174] if(0==printf_string::format_justify_left#0) goto printf_string::@11
Simple Condition printf_string::$16 [177] if(0!=printf_string::format_justify_left#0) goto printf_string::@12
Simple Condition toupper::$1 [242] if(toupper::ch#0<='z') goto toupper::@1
Simple Condition utoa::$6 [243] if(utoa::value#3>=utoa::digit_value#0) goto utoa::@14
Simple Condition ultoa::$6 [244] if(ultoa::value#2>=ultoa::digit_value#0) goto ultoa::@14
Simple Condition printf_number_buffer::$35 [246] if(0!=printf_number_buffer::padding#10) goto printf_number_buffer::@8
Simple Condition printf_number_buffer::$2 [247] if(0==printf_number_buffer::format_zero_padding#10) goto printf_number_buffer::@21
Simple Condition printf_number_buffer::$36 [249] if(0!=printf_number_buffer::padding#10) goto printf_number_buffer::@10
Simple Condition printf_number_buffer::$37 [251] if(0!=printf_number_buffer::padding#10) goto printf_number_buffer::@12
Simple Condition printf_number_buffer::$14 [252] if(0==printf_number_buffer::format_zero_padding#10) goto printf_number_buffer::@24
Simple Condition printf_string::$17 [254] if(0!=printf_string::padding#0) goto printf_string::@5
Simple Condition printf_string::$18 [256] if(0!=printf_string::padding#0) goto printf_string::@6
Simple Condition toupper::$1 [12] if(toupper::ch#0<='z') goto toupper::@1
Simple Condition utoa::$12 [43] if(0!=utoa::started#2) goto utoa::@14
Simple Condition utoa::$6 [57] if(utoa::value#3>=utoa::digit_value#0) goto utoa::@14
Simple Condition ultoa::$12 [67] if(0!=ultoa::started#2) goto ultoa::@14
Simple Condition ultoa::$6 [81] if(ultoa::value#2>=ultoa::digit_value#0) goto ultoa::@14
Simple Condition printf_number_buffer::$1 [138] if(0==printf_number_buffer::format_justify_left#10) goto printf_number_buffer::@22
Simple Condition printf_number_buffer::$33 [155] if(0!=printf_number_buffer::format_zero_padding#10) goto printf_number_buffer::@23
Simple Condition printf_number_buffer::$34 [168] if(0!=printf_number_buffer::format_justify_left#10) goto printf_number_buffer::@25
Simple Condition printf_number_buffer::$35 [176] if(0!=printf_number_buffer::padding#10) goto printf_number_buffer::@8
Simple Condition printf_number_buffer::$2 [177] if(0==printf_number_buffer::format_zero_padding#10) goto printf_number_buffer::@21
Simple Condition printf_number_buffer::$36 [179] if(0!=printf_number_buffer::padding#10) goto printf_number_buffer::@10
Simple Condition printf_number_buffer::$37 [181] if(0!=printf_number_buffer::padding#10) goto printf_number_buffer::@12
Simple Condition printf_number_buffer::$14 [182] if(0==printf_number_buffer::format_zero_padding#10) goto printf_number_buffer::@24
Simple Condition printf_string::$1 [185] if(0==printf_string::format_justify_left#0) goto printf_string::@11
Simple Condition printf_string::$16 [188] if(0!=printf_string::format_justify_left#0) goto printf_string::@12
Simple Condition printf_string::$17 [195] if(0!=printf_string::padding#0) goto printf_string::@5
Simple Condition printf_string::$18 [197] if(0!=printf_string::padding#0) goto printf_string::@6
Successful SSA optimization Pass2ConditionalJumpSimplification
Negating conditional jump and destination [8] if(toupper::ch#0<'a') goto toupper::@2
Negating conditional jump and destination [135] if(0!=printf_number_buffer::format_justify_left#10) goto printf_number_buffer::@2
Negating conditional jump and destination [152] if(0==printf_number_buffer::format_zero_padding#10) goto printf_number_buffer::@4
Negating conditional jump and destination [165] if(0==printf_number_buffer::format_justify_left#10) goto printf_number_buffer::@return
Negating conditional jump and destination [174] if(0!=printf_string::format_justify_left#0) goto printf_string::@2
Negating conditional jump and destination [177] if(0==printf_string::format_justify_left#0) goto printf_string::@return
Negating conditional jump and destination [247] if(0!=printf_number_buffer::format_zero_padding#10) goto printf_number_buffer::@2
Negating conditional jump and destination [252] if(0!=printf_number_buffer::format_zero_padding#10) goto printf_number_buffer::@return
Negating conditional jump and destination [138] if(0!=printf_number_buffer::format_justify_left#10) goto printf_number_buffer::@2
Negating conditional jump and destination [155] if(0==printf_number_buffer::format_zero_padding#10) goto printf_number_buffer::@4
Negating conditional jump and destination [168] if(0==printf_number_buffer::format_justify_left#10) goto printf_number_buffer::@return
Negating conditional jump and destination [177] if(0!=printf_number_buffer::format_zero_padding#10) goto printf_number_buffer::@2
Negating conditional jump and destination [182] if(0!=printf_number_buffer::format_zero_padding#10) goto printf_number_buffer::@return
Negating conditional jump and destination [185] if(0!=printf_string::format_justify_left#0) goto printf_string::@2
Negating conditional jump and destination [188] if(0==printf_string::format_justify_left#0) goto printf_string::@return
Successful SSA optimization Pass2ConditionalJumpSequenceImprovement
Constant right-side identified [59] ultoa::$4 = ultoa::max_digits#1 - 1
Constant right-side identified [110] printf_slong::uvalue#0 = (unsigned long)printf_slong::value#1
Constant right-side identified [118] printf_sint::uvalue#0 = (unsigned int)printf_sint::value#1
Constant right-side identified [178] printf_padding::length#3 = (char)printf_string::padding#0
Constant right-side identified [180] printf_padding::length#4 = (char)printf_string::padding#0
Constant right-side identified [61] ultoa::$4 = ultoa::max_digits#1 - 1
Constant right-side identified [113] printf_slong::uvalue#0 = (unsigned long)printf_slong::value#1
Constant right-side identified [121] printf_sint::uvalue#0 = (unsigned int)printf_sint::value#1
Constant right-side identified [189] printf_padding::length#3 = (char)printf_string::padding#0
Constant right-side identified [191] printf_padding::length#4 = (char)printf_string::padding#0
Successful SSA optimization Pass2ConstantRValueConsolidation
Constant ultoa::$4 = ultoa::max_digits#1-1
Constant printf_slong::uvalue#0 = (unsigned long)printf_slong::value#1
@ -3381,10 +3381,10 @@ Successful SSA optimization Pass2ConstantIdentification
Constant ultoa::value#1 = printf_slong::uvalue#0
Constant utoa::value#1 = printf_sint::uvalue#0
Successful SSA optimization Pass2ConstantIdentification
if() condition always false - eliminating [174] if(0!=printf_string::format_justify_left#0) goto printf_string::@2
if() condition always true - replacing block destination [177] if(0==printf_string::format_justify_left#0) goto printf_string::@return
if() condition always false - eliminating [254] if(0!=printf_string::padding#0) goto printf_string::@5
if() condition always false - eliminating [256] if(0!=printf_string::padding#0) goto printf_string::@6
if() condition always false - eliminating [185] if(0!=printf_string::format_justify_left#0) goto printf_string::@2
if() condition always true - replacing block destination [188] if(0==printf_string::format_justify_left#0) goto printf_string::@return
if() condition always false - eliminating [195] if(0!=printf_string::padding#0) goto printf_string::@5
if() condition always false - eliminating [197] if(0!=printf_string::padding#0) goto printf_string::@6
Successful SSA optimization Pass2ConstantIfs
Simplifying constant evaluating to zero (char)printf_string::padding#0 in
Simplifying constant evaluating to zero (char)printf_string::padding#0 in
@ -3410,10 +3410,10 @@ Eliminating unused constant printf_padding::length#4
Eliminating unused constant printf_string::padding#0
Eliminating unused constant printf_string::format_justify_left#0
Successful SSA optimization PassNEliminateUnusedVars
Inlining Noop Cast [125] printf_number_buffer::$25 = (signed char)printf_number_buffer::format_min_length#3 keeping printf_number_buffer::format_min_length#3
Inlining Noop Cast [128] printf_number_buffer::$25 = (signed char)printf_number_buffer::format_min_length#3 keeping printf_number_buffer::format_min_length#3
Successful SSA optimization Pass2NopCastInlining
Rewriting multiplication to use shift [35] utoa::$10 = utoa::digit#2 * SIZEOF_UNSIGNED_INT
Rewriting multiplication to use shift [54] ultoa::$10 = ultoa::digit#2 * SIZEOF_UNSIGNED_LONG
Rewriting multiplication to use shift [36] utoa::$10 = utoa::digit#2 * SIZEOF_UNSIGNED_INT
Rewriting multiplication to use shift [56] ultoa::$10 = ultoa::digit#2 * SIZEOF_UNSIGNED_LONG
Successful SSA optimization Pass2MultiplyToShiftRewriting
Inlining constant with var siblings strlen::len#0
Inlining constant with var siblings utoa::max_digits#1
@ -3592,7 +3592,7 @@ Identical Phi Values snprintf_init::n#4 $ffff
Identical Phi Values snprintf_init::s#4 BUF
Identical Phi Values print::msg#7 BUF
Successful SSA optimization Pass2IdenticalPhiElimination
Constant right-side identified [24] utoa::buffer#0 = ++ (char *)&printf_buffer+OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_DIGITS
Constant right-side identified [25] utoa::buffer#0 = ++ (char *)&printf_buffer+OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_DIGITS
Successful SSA optimization Pass2ConstantRValueConsolidation
Constant utoa::buffer#0 = ++(char *)&printf_buffer+OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_DIGITS
Constant strlen::str#1 = (char *)&printf_buffer+OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_DIGITS
@ -3612,8 +3612,8 @@ Successful SSA optimization Pass2ConstantInlining
Simplifying constant integer increment ++(char *)&printf_buffer+OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_DIGITS
Simplifying constant integer increment ++(char *)&printf_buffer+OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_DIGITS
Successful SSA optimization Pass2ConstantSimplification
Adding number conversion cast (unumber) 1 in [24] *((char *)&printf_buffer+OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_DIGITS+1) = 'r'
Adding number conversion cast (unumber) 1 in [25] utoa::buffer#1 = ++ (char *)&printf_buffer+OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_DIGITS+1
Adding number conversion cast (unumber) 1 in [25] *((char *)&printf_buffer+OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_DIGITS+1) = 'r'
Adding number conversion cast (unumber) 1 in [26] utoa::buffer#1 = ++ (char *)&printf_buffer+OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_DIGITS+1
Successful SSA optimization PassNAddNumberTypeConversions
Simplifying constant integer cast 1
Simplifying constant integer cast 1
@ -3621,7 +3621,7 @@ Successful SSA optimization PassNCastSimplification
Finalized unsigned number type (char) 1
Finalized unsigned number type (char) 1
Successful SSA optimization PassNFinalizeNumberTypeConversions
Constant right-side identified [25] utoa::buffer#1 = ++ (char *)&printf_buffer+OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_DIGITS+1
Constant right-side identified [26] utoa::buffer#1 = ++ (char *)&printf_buffer+OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_DIGITS+1
Successful SSA optimization Pass2ConstantRValueConsolidation
Constant utoa::buffer#1 = ++(char *)&printf_buffer+OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_DIGITS+1
Successful SSA optimization Pass2ConstantIdentification
@ -3631,7 +3631,7 @@ Successful SSA optimization Pass2ConstantInlining
Simplifying constant integer increment ++(char *)&printf_buffer+OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_DIGITS+1
Simplifying constant integer increment ++(char *)&printf_buffer+OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_DIGITS+1
Successful SSA optimization Pass2ConstantSimplification
Constant right-side identified [26] utoa::buffer#2 = ++ (char *)&printf_buffer+OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_DIGITS+2
Constant right-side identified [27] utoa::buffer#2 = ++ (char *)&printf_buffer+OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_DIGITS+2
Successful SSA optimization Pass2ConstantRValueConsolidation
Constant utoa::buffer#2 = ++(char *)&printf_buffer+OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_DIGITS+2
Successful SSA optimization Pass2ConstantIdentification