PR optimization/7153
* regmove.c (optimize_reg_copy_3): Don't optimize if the register
dies in more than one insn.
From-SVN: r55468
+2002-07-15 Eric Botcazou <ebotcazou@multimania.com>
+
+ PR optimization/7153
+ * regmove.c (optimize_reg_copy_3): Don't optimize if the register
+ dies in more than one insn.
+
2002-07-15 Jason Thorpe <thorpej@wasabisystems.com>
* config/sparc/netbsd-elf.h (TRANSFER_FROM_TRAMPOLINE): Remove.
if (src_no < FIRST_PSEUDO_REGISTER
|| dst_no < FIRST_PSEUDO_REGISTER
|| ! find_reg_note (insn, REG_DEAD, src_reg)
+ || REG_N_DEATHS (src_no) != 1
|| REG_N_SETS (src_no) != 1)
return;
for (p = PREV_INSN (insn); p && ! reg_set_p (src_reg, p); p = PREV_INSN (p))
--- /dev/null
+/* PR optimization/7153 */
+/* Verify that GCC doesn't promote a register when its
+ lifetime is not limited to one basic block. */
+
+void f(char);
+void g(void);
+
+void scale(void)
+{
+ int width;
+ char bytes;
+ char *src;
+
+ if (width)
+ {
+ bytes = *src;
+ g();
+ width *= bytes;
+ }
+
+ f(bytes);
+}