Blame SOURCES/gcc10-pr96939.patch

52d91f
2020-09-07  Jakub Jelinek  <jakub@redhat.com>
52d91f
52d91f
	PR target/96939
52d91f
	* config/arm/arm.c (arm_override_options_after_change): Don't call
52d91f
	arm_configure_build_target here.
52d91f
	(arm_set_current_function): Call arm_override_options_after_change_1
52d91f
	at the end.
52d91f
52d91f
	* gcc.target/arm/lto/pr96939_0.c: New test.
52d91f
	* gcc.target/arm/lto/pr96939_1.c: New file.
52d91f
52d91f
--- gcc/config/arm/arm.c.jj	2020-07-30 15:04:38.136293101 +0200
52d91f
+++ gcc/config/arm/arm.c	2020-09-07 10:43:54.809561852 +0200
52d91f
@@ -3037,10 +3037,6 @@ arm_override_options_after_change_1 (str
52d91f
 static void
52d91f
 arm_override_options_after_change (void)
52d91f
 {
52d91f
-  arm_configure_build_target (&arm_active_target,
52d91f
-			      TREE_TARGET_OPTION (target_option_default_node),
52d91f
-			      &global_options_set, false);
52d91f
-
52d91f
   arm_override_options_after_change_1 (&global_options);
52d91f
 }
52d91f
 
52d91f
@@ -32338,6 +32334,8 @@ arm_set_current_function (tree fndecl)
52d91f
   cl_target_option_restore (&global_options, TREE_TARGET_OPTION (new_tree));
52d91f
 
52d91f
   save_restore_target_globals (new_tree);
52d91f
+
52d91f
+  arm_override_options_after_change_1 (&global_options);
52d91f
 }
52d91f
 
52d91f
 /* Implement TARGET_OPTION_PRINT.  */
52d91f
--- gcc/testsuite/gcc.target/arm/lto/pr96939_0.c.jj	2020-09-07 11:26:45.909937609 +0200
52d91f
+++ gcc/testsuite/gcc.target/arm/lto/pr96939_0.c	2020-09-07 11:29:18.722706535 +0200
52d91f
@@ -0,0 +1,15 @@
52d91f
+/* PR target/96939 */
52d91f
+/* { dg-lto-do link } */
52d91f
+/* { dg-require-effective-target arm_arch_v8a_ok } */
52d91f
+/* { dg-lto-options { { -flto -O2 } } } */
52d91f
+
52d91f
+extern unsigned crc (unsigned, const void *);
52d91f
+typedef unsigned (*fnptr) (unsigned, const void *);
52d91f
+volatile fnptr fn;
52d91f
+
52d91f
+int
52d91f
+main ()
52d91f
+{
52d91f
+  fn = crc;
52d91f
+  return 0;
52d91f
+}
52d91f
--- gcc/testsuite/gcc.target/arm/lto/pr96939_1.c.jj	2020-09-07 11:26:49.365887153 +0200
52d91f
+++ gcc/testsuite/gcc.target/arm/lto/pr96939_1.c	2020-09-07 11:25:13.885281180 +0200
52d91f
@@ -0,0 +1,10 @@
52d91f
+/* PR target/96939 */
52d91f
+/* { dg-options "-march=armv8-a+crc" } */
52d91f
+
52d91f
+#include <arm_acle.h>
52d91f
+
52d91f
+unsigned
52d91f
+crc (unsigned x, const void *y)
52d91f
+{
52d91f
+  return __crc32cw (x, *(unsigned *) y);
52d91f
+}