https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64810

--- Comment #15 from David Malcolm <dmalcolm at gcc dot gnu.org> ---
(In reply to David Malcolm from comment #13)
> Am investigating.

What appears to be happening is the 1st time through arm_option_override,
arm_selected_cpu is NULL, but is set to non-NULL at:
  arm_selected_cpu = arm_selected_arch;
The 2nd time through, arm_selected_cpu hasn't been reset, and so the condition:

  if (arm_selected_arch)
    {
      if (arm_selected_cpu)
    {
      /* Check for conflict between mcpu and march.  */

fires, and this clause fires:

        /* -mcpu wins.  */
        arm_selected_arch = NULL;

so we have a NULL arm_selected_arch and a non-NULL arm_selected_cpu.

Fix appears to be to simply set each of these to NULL at the top of
arm_option_override, to prevent state from previous in-process runs from
affecting things:

--- a/gcc/config/arm/arm.c
+++ b/gcc/config/arm/arm.c
@@ -2627,6 +2627,10 @@ arm_gimplify_va_arg_expr (tree valist, tree type,
gimple_seq *pre_p,
 static void
 arm_option_override (void)
 {
+  arm_selected_arch = NULL;
+  arm_selected_cpu = NULL;
+  arm_selected_tune = NULL;
+  
   if (global_options_set.x_arm_arch_option)
     arm_selected_arch = &all_architectures[arm_arch_option];

With this, and the previous patch, most of the jit testsuite passes.

I still see another failure in:
FAIL: test-expressions.c.exe killed: 12479 exp8 0 0 CHILDKILLED SIGSEGV
{segmentation violation}
which appears to be (yet) another issue.

Reply via email to