This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] Update optimization_default_node in ada (PR middle-end/64340)
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Eric Botcazou <ebotcazou at adacore dot com>, Richard Biener <rguenther at suse dot de>, Jan Hubicka <hubicka at ucw dot cz>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Fri, 6 Feb 2015 21:26:29 +0100
- Subject: [PATCH] Update optimization_default_node in ada (PR middle-end/64340)
- Authentication-results: sourceware.org; auth=none
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
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 <jakub@redhat.com>
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