This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

PATCH: PR target/37394: [4.4 Regression] Segfault in ia64_variable_issue with -O -fschedule-insns2


We used to check and set flag_schedule_insns_after_reload and
ia64_flag_schedule_insns2 in ia64_override_options after all command
line options have been processed. It was moved to
ia64_optimization_options to support #pragma GCC optimize and
attribute((optimize(...))).  But it breaks "-O -fschedule-insns2".
Also #pragma GCC optimize and attribute((optimize(...))) don't
work correctly:

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37565

since OPTIMIZATION_OPTIONS is executed before -fschedule-insns2
is processed when it is used in #pragma GCC optimize.

OK for trunk if it passes on Linux/ia64?

Thanks.


H.J.
---
gcc/

2008-09-17  H.J. Lu  <hongjiu.lu@intel.com>

	PR target/37394
	* config/ia64/ia64.c (ia64_optimization_options): Move
	checking and setting flag_schedule_insns_after_reload and
	ia64_flag_schedule_insns2 back to ...
	(ia64_override_options): Here.

gcc/testsuite/

2008-09-17  H.J. Lu  <hongjiu.lu@intel.com>

	PR target/37394
	* g++.dg/other/pr37394.C: New.

--- gcc/config/ia64/ia64.c.over	2008-09-17 11:18:10.000000000 -0700
+++ gcc/config/ia64/ia64.c	2008-09-17 21:57:41.000000000 -0700
@@ -5235,6 +5235,9 @@ ia64_override_options (void)
       TARGET_INLINE_SQRT = INL_MAX_THR;
     }
 
+  ia64_flag_schedule_insns2 = flag_schedule_insns_after_reload;
+  flag_schedule_insns_after_reload = 0;
+
   ia64_section_threshold = g_switch_set ? g_switch_value : IA64_DEFAULT_GVALUE;
 
   init_machine_status = ia64_init_machine_status;
@@ -9980,13 +9983,6 @@ void
 ia64_optimization_options (int level ATTRIBUTE_UNUSED,
                            int size ATTRIBUTE_UNUSED)
 {
-  /* Disable the second machine independent scheduling pass and use one for the
-     IA-64.  This needs to be here instead of in OVERRIDE_OPTIONS because this
-     is done whenever the optimization is changed via #pragma GCC optimize or
-     attribute((optimize(...))).  */
-  ia64_flag_schedule_insns2 = flag_schedule_insns_after_reload;
-  flag_schedule_insns_after_reload = 0;
-
   /* Let the scheduler form additional regions.  */
   set_param_value ("max-sched-extend-regions-iters", 2);
 
--- gcc/testsuite/g++.dg/other/pr37394.C.over	2008-09-17 21:56:30.000000000 -0700
+++ gcc/testsuite/g++.dg/other/pr37394.C	2008-09-17 21:55:19.000000000 -0700
@@ -0,0 +1,12 @@
+// Origin: Martin Michlmayr <tbm@cyrius.com>
+// { dg-do compile { target ia64-*-* } }
+// { dg-options "-O -fschedule-insns2" }
+
+struct _Words
+{
+  void *_M_pword;
+  _Words ():
+   _M_pword (0)
+  {
+  }
+} _M_word_zero;


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]