Hi Christian,

On 21/01/16 10:36, Christian Bruel wrote:
The current arm_set_current_function was both awkward and buggy. For instance using partially set TARGET_OPTION set from pragma_parse, while restore_target_globalsnor arm_option_params_internal was not reset. Another issue is that in some paths, target_reinit was not called due to old cached target_option_current_node value. for instance with

foo{}
#pragma GCC target ...

foo was called with global_options set from old GCC target (which was wrong) 
and correct rtl values.

This is a reimplementation of the function. Hoping to be easier to read (and 
maintain). Solves the current issues seen so far.

regtested for arm-linux-gnueabi -mfpu=vfp, -mfpu=neon,-mfpu=neon-fp-armv8


Thanks for the patch, I'll try it out.
In the meantime there's a couple of style and typo nits...

+      /* Make sure that target_reinit is called for next function, since
+        TREE_TARGET_OPTION might change with the #pragma even if there are
+        no target attribute attached to the function.  */

s/attribute/attributes

-  arm_previous_fndecl = fndecl;
+  /* if no attribute, use the mode set by the current pragma target.  */
+  if (! new_tree)
+    new_tree = target_option_current_node;
+

s/if/If/

+      /* now target_reinit can save the state for later. */
+      TREE_TARGET_GLOBALS (new_tree)
+       = save_target_globals_default_opts ();

s/now/Now/

Reply via email to