View Issue Details

IDProjectCategoryView StatusLast Update
0018561FPCCompilerpublic2011-01-20 11:39 Assigned To 
Status newResolutionopen 
Product Version2.5.1 
Summary0018561: Codegen warnings with EXTDEBUG
DescriptionThe following sample program causes two internal compiler warnings:
    Warning: Location not equal to expectloc: calln
    Warning: tgobj: (ResetTempgen) temp at pos -24 with size 8 and type normal from pos 5:21 not freed at the end of the procedure
Steps To Reproduce{$warnings on}

function foo(const x: real): integer;
    foo := trunc(x) + trunc(frac(x) * 2)

    writeln( foo(1.49) )
Fixed in Revision
Attached Files


Jonas Maebe

2011-01-20 00:07

manager   ~0045315

You can find an large amount of such warnings by compiling the compiler and the RTL with -dEXTDEBUG. I don't think it's really worthwhile to file bugs on this until someone has spent at least some time on making the default FPC sources free of such warnings.

Jonas Maebe

2011-01-20 00:08

manager   ~0045317

> until someone has spent at least some time on making
> the default FPC sources free of such warnings.

To clarify: with that I mean "until someone has fixed the compiler bugs that cause such warnings while compiling the default FPC sources".

2011-01-20 01:20

reporter   ~0045319

Thanks. I'm trying to make a large amount of code that uses the Delphi language features quite extensively to be compatible with FPC, and while I seek to deal with front-end's bugs by myself, the back-end is definitely out of my expertise =)
Here is the part that is unclear to me: these messages are qualified as warnings; does that mean they are not evidences of invalid codegen, but merely diagnostics and, thus, can be safely ignored?

Jonas Maebe

2011-01-20 11:39

manager   ~0045326

The "not freed temp" warnings indicate that the generated code *might* use more stack space than strictly required (but that's not always the case).

The wrong expectloc can in some situations lead to internal compiler errors, or to slightly suboptimal code generation. Never to wrong code generation, afaik.

Issue History

Date Modified Username Field Change
2011-01-19 23:48 New Issue
2011-01-19 23:48 Tag Attached: EXTDEBUG
2011-01-20 00:07 Jonas Maebe Note Added: 0045315
2011-01-20 00:08 Jonas Maebe Note Added: 0045317
2011-01-20 01:20 Note Added: 0045319
2011-01-20 11:39 Jonas Maebe Note Added: 0045326