Hi!
As mentioned in the PR, the problem here is that the Ada FE needs to modify
global_options after toplevel.c (process_options), but as for LTO we now use
optimization_{default,current}_node for options of functions without
specifial optimization node, it means the changed options aren't reflected
in there.
Fixed thusly, bootstrapped/regtested on x86_64-linux, ok for trunk?
2015-02-06 Jakub Jelinek <[email protected]>
PR middle-end/64340
* gcc-interface/trans.c (gigi): Recreate optimization_default_node
and optimization_current_node after tweaking global_options.
--- gcc/ada/gcc-interface/trans.c.jj 2015-01-12 18:56:10.000000000 +0100
+++ gcc/ada/gcc-interface/trans.c 2015-02-06 16:39:04.353363393 +0100
@@ -678,6 +678,11 @@ gigi (Node_Id gnat_root,
if (No_Strict_Aliasing_CP)
flag_strict_aliasing = 0;
+ /* Save the current optimization options again after the above possible
+ global_options changes. */
+ optimization_default_node = build_optimization_node (&global_options);
+ optimization_current_node = optimization_default_node;
+
/* Now translate the compilation unit proper. */
Compilation_Unit_to_gnu (gnat_root);
Jakub