On 27/10/15 14:06, Bernd Schmidt wrote:
On 10/27/2015 11:54 AM, Renlin Li wrote:
Yes. In all of the related testcases, only -freorder-and-partition flag
is provided explicitly.
How about creating a new dg-add-options for freorder?

proc add_options_for_freorder { flags } {
     return "$flags -freorder-blocks-and-partition -fprofile-use"
}


proc check_effective_target_freorder {} {
     return [check_no_compiler_messages freorder object {
     void foo (void) { }
     } [add_options_for_freorder ""]]
}

I don't know that tcl syntax but apparently this is done already for a number of other cases. So, probably the right thing to do.

You might want to coordinate with Maxim ostapenko who's currently working on another -fprofile-use patch. Hopefully not one that disables -freorder-blocks-and-partition if it can't find .gcda files.

AFAU, adding -fprofile-use would lead to enabling a bunch of PGO-related optimizations wherever you have .gcda file or not. So, you can end up with a completely different optimization pipeline for your tests if you enable -fprofile-use for them. Is it desirable?

Anyway, disabling any compile options provided by user explicitly sounds like a bad idea for me, so disabling -freorder-blocks-and-partition if it can't find .gcda file seems to be not acceptable.

-Maxim


Bernd


Reply via email to