Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-devel / 2015-03

What means -Oodfa ?

7 messages · 4 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Juha Manninen

Referring to this old issue :
http://bugs.freepascal.org/view.php?id=20907
I was told that compiling with -Oodfa reports uninitialized String result values.
Indeed it does, I spotted many of them in Lazarus sources.

However "fpc -h" does not mention these options. What do they mean? There is :

-Oo[NO]<x> Enable or disable optimizations; see fpc -i or fpc -io for possible values

then

$ fpc -io
REGVAR
STACKFRAME
PEEPHOLE
LOOPUNROLL
TAILREC
CSE
DFA
USERBP
ORDERFIELDS
FASTMATH
REMOVEEMPTYPROCS
CONSTPROP

Nothing about 'd', 'f' or 'a'.
This also affects the "All Options" GUI in Lazarus. It can nicely read and show options using the new improved fpc -h and fpc -i output.

Regards,
Juha

Reply by email

Florian Klämpfl
to Juha Manninen
Juha Manninen wrote 22 lines
Referring to this old issue : http://bugs.freepascal.org/view.php?id=20907 I was told that compiling with -Oodfa reports uninitialized String result values. Indeed it does, I spotted many of them in Lazarus sources. However "fpc -h" does not mention these options. What do they mean? There is : -Oo[NO]<x> Enable or disable optimizations; see fpc -i or fpc -io for possible values then $ fpc -io REGVAR STACKFRAME PEEPHOLE LOOPUNROLL TAILREC CSE DFA

^---- ?

See the svn version of the docs for its meaning ;)

Show quoted text 5 lines
USERBP ORDERFIELDS FASTMATH REMOVEEMPTYPROCS CONSTPROP

Reply by email

Juha Manninen
to Florian Klämpfl
Florian Klämpfl wrote
> DFA ^---- ? See the svn version of the docs for its meaning ;)

Damn right, it is there! I think I was looking for 3 separate one-letter options.

It means:
Enable Data Flow Analysis. (normally included -O3)

Very useful also without -O3 for spotting errors.

Juha

Reply by email

Juha Manninen
to Juha Manninen

There are some false positive warnings.
For example this construct can be found in Lazarus IDE code frequently.

 function IDEDirectiveNameToDirective(const DirectiveName: string):
TIDEDirective;
 begin
   for Result:=Low(TIDEDirective) to High(TIDEDirective) do
     if CompareText(IDEDirectiveNames[Result],DirectiveName)=0 then exit;
   Result:=idedNone;
 end;

Compiled with -Oodfa gives :
buildfiledlg.pas(406,44) Warning: Function result variable does not seem to initialized
which is wrong.

There are also thousands of hints about variable "$self" that make no sense to me, like :
initialsetupdlgs.pas(563,27) Hint: Variable "$self" does not seem to be initialized
How does the compiler come to that conclusion?

Juha

Reply by email

Florian Klaempfl
to Juha Manninen
Juha Manninen wrote
There are some false positive warnings.

Trunk or fixes?

Show quoted text 20 lines
For example this construct can be found in Lazarus IDE code frequently. function IDEDirectiveNameToDirective(const DirectiveName: string): TIDEDirective; begin for Result:=Low(TIDEDirective) to High(TIDEDirective) do if CompareText(IDEDirectiveNames[Result],DirectiveName)=0 then exit; Result:=idedNone; end; Compiled with -Oodfa gives : buildfiledlg.pas(406,44) Warning: Function result variable does not seem to initialized which is wrong. There are also thousands of hints about variable "$self" that make no sense to me, like : initialsetupdlgs.pas(563,27) Hint: Variable "$self" does not seem to be initialized How does the compiler come to that conclusion?

This should be fixed in trunk.

Reply by email