* common.opt (flag_gcse_after_reload): Don't initialize to 2.
(flag_rerun_cse_after_loop): Initialize this to 2 instead.
* postreload-gcse.c (hash_scan_set): Do not consider stack regs.
testsuite/
PR target/23095
* gfortran.dg/pr23095.f: New test.
PR c++/22003
* g++.dg/other/pr22003.C: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@102610
138bc75d-0d04-0410-961f-
82ee72b054a4
+2005-07-31 Steven Bosscher <stevenb@suse.de>
+
+ PR target/23095
+ * common.opt (flag_gcse_after_reload): Don't initialize to 2.
+ (flag_rerun_cse_after_loop): Initialize this to 2 instead.
+ * postreload-gcse.c (hash_scan_set): Do not consider stack regs.
+
2005-07-31 Jan Hubicka <jh@suse.cz>
* pretty-print.h (pp_widest_integer): New macro.
elimination
fgcse-after-reload
-Common Report Var(flag_gcse_after_reload) Init(2)
+Common Report Var(flag_gcse_after_reload)
Perform global common subexpression elimination after register allocation
has finished
Reorder functions to improve code placement
frerun-cse-after-loop
-Common Report Var(flag_rerun_cse_after_loop)
+Common Report Var(flag_rerun_cse_after_loop) Init(2)
Add a common subexpression elimination pass after loop optimizations
frerun-loop-opt
can_copy_p (GET_MODE (dest))
/* Is SET_SRC something we want to gcse? */
&& general_operand (src, GET_MODE (src))
+#ifdef STACK_REGS
+ /* Never consider insns touching the register stack. It may
+ create situations that reg-stack cannot handle (e.g. a stack
+ register live across an abnormal edge). */
+ && (REGNO (dest) < FIRST_STACK_REG || REGNO (dest) > LAST_STACK_REG)
+#endif
/* An expression is not available if its operands are
subsequently modified, including this insn. */
&& oprs_unchanged_p (src, insn, true))
can_copy_p (GET_MODE (src))
/* Is SET_DEST something we want to gcse? */
&& general_operand (dest, GET_MODE (dest))
+#ifdef STACK_REGS
+ /* As above for STACK_REGS. */
+ && (REGNO (src) < FIRST_STACK_REG || REGNO (src) > LAST_STACK_REG)
+#endif
&& ! (flag_float_store && FLOAT_MODE_P (GET_MODE (dest)))
/* Check if the memory expression is killed after insn. */
&& ! load_killed_in_block_p (INSN_CUID (insn) + 1, dest, true)
+2005-07-31 Steven Bosscher <stevenb@suse.de>
+
+ PR target/23095
+ * gfortran.dg/pr23095.f: New test.
+
+ PR c++/22003
+ * g++.dg/other/pr22003.C: New test.
+
2005-07-31 Richard Sandiford <richard@codesourcery.com>
PR target/20621
--- /dev/null
+/* PR rtl-optimization/22003 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -fno-exceptions -freorder-blocks-and-partition" } */
+
+struct c1
+{
+ virtual ~c1();
+};
+class c4;
+
+struct c2
+{
+ virtual c4* func();
+};
+
+struct c3 : c1, c2
+{
+ c4* func();
+};
+
+c4* c3::func()
+{
+}
+
--- /dev/null
+ ! { dg-do compile { target i?86-*-* x86_64-*-* } }
+ ! { dg-options "-w -m32 -O2 -ffloat-store -fgcse-after-reload" }
+ !
+ ! GCSE after reload made a stack register live across an abnormal
+ ! edges for one of the computed jumps. This bombed in reg-stack.
+ function foo(n)
+ real*8 foo
+ integer ix, n, next
+ real*8 xmax, absx
+ foo = 0.0d0
+ assign 20 to next
+ do ix = 1,n
+ go to next,(10, 30)
+ 10 assign 40 to next
+ go to 40
+ 20 if (absx .gt. 8.232d-11) go to 40
+ 30 if (absx .le. xmax) go to 40
+ xmax = absx
+ 40 go to next,(10, 30)
+ end do
+ return
+ end