Hi!
And here are 3 backported patches plus one testcase to 4.4 branch,
committed after bootstrap/regtest on x86_64-linux and i686-linux.
Jakub
2011-04-07 Jakub Jelinek <[email protected]>
PR tree-optimization/46491
Backported from mainline
2010-05-14 Jan Hubicka <[email protected]>
* ipa-pure-const.c (check_stmt): Do not use memory_identifier_string.
2011-04-07 Jakub Jelinek <[email protected]>
Backported from mainline
2010-11-15 Jakub Jelinek <[email protected]>
PR tree-optimization/46491
* gcc.target/i386/pr46491.c: New test.
--- gcc/ipa-pure-const.c (revision 166773)
+++ gcc/ipa-pure-const.c (revision 166774)
@@ -360,7 +360,7 @@ get_asm_expr_operands (funct_state local
for (i = 0; i < gimple_asm_nclobbers (stmt); i++)
{
op = gimple_asm_clobber_op (stmt, i);
- if (simple_cst_equal(TREE_VALUE (op), memory_identifier_string) == 1)
+ if (strcmp (TREE_STRING_POINTER (TREE_VALUE (op)), "memory") == 0)
/* Abandon all hope, ye who enter here. */
local->pure_const_state = IPA_NEITHER;
}
--- gcc/testsuite/gcc.target/i386/pr46491.c (revision 0)
+++ gcc/testsuite/gcc.target/i386/pr46491.c (revision 166774)
@@ -0,0 +1,22 @@
+/* PR tree-optimization/46491 */
+/* { dg-do run } */
+/* { dg-options "-O2 -fno-ipa-reference" } */
+
+extern void abort (void);
+
+__attribute__((noinline)) int
+foo (int *p)
+{
+ int r;
+ asm ("movl $6, (%1)\n\txorl %0, %0" : "=r" (r) : "r" (p) : "memory");
+ return r;
+}
+
+int
+main (void)
+{
+ int p = 8;
+ if ((foo (&p) ? : p) != 6)
+ abort ();
+ return 0;
+}
2011-04-07 Jakub Jelinek <[email protected]>
Backported from mainline
2011-03-17 Jakub Jelinek <[email protected]>
PR rtl-optimization/48141
* dse.c (record_store): If no positions are needed in an insn
that cannot be deleted, at least unchain it from active_local_stores.
* gcc.dg/pr48141.c: New test.
--- gcc/dse.c (revision 171088)
+++ gcc/dse.c (revision 171089)
@@ -1588,8 +1588,7 @@ record_store (rtx body, bb_info_t bb_inf
/* An insn can be deleted if every position of every one of
its s_infos is zero. */
- if (any_positions_needed_p (s_info)
- || ptr->cannot_delete)
+ if (any_positions_needed_p (s_info))
del = false;
if (del)
@@ -1600,8 +1599,9 @@ record_store (rtx body, bb_info_t bb_inf
last->next_local_store = ptr->next_local_store;
else
active_local_stores = ptr->next_local_store;
-
- delete_dead_store_insn (insn_to_delete);
+
+ if (!insn_to_delete->cannot_delete)
+ delete_dead_store_insn (insn_to_delete);
}
else
last = ptr;
--- gcc/testsuite/gcc.dg/pr48141.c (revision 0)
+++ gcc/testsuite/gcc.dg/pr48141.c (revision 171089)
@@ -0,0 +1,17 @@
+/* PR rtl-optimization/48141 */
+/* { dg-do compile } */
+/* { dg-options "-O -fno-tree-fre" } */
+
+#define A i = 0;
+#define B A A A A A A A A A A
+#define C B B B B B B B B B B
+#define D C C C C C C C C C C
+#define E D D D D D D D D D D
+
+int
+foo (void)
+{
+ volatile int i = 0;
+ E E E E E E E E E E E
+ return 0;
+}
2011-04-07 Jakub Jelinek <[email protected]>
Backported from mainline
2011-04-06 Jakub Jelinek <[email protected]>
PR debug/48466
* dwarf2out.c (based_loc_descr): If drap_reg is INVALID_REGNUM, use
as base_reg whatever register reg has been eliminated to, instead
of hardcoding STACK_POINTER_REGNUM.
--- gcc/dwarf2out.c (revision 172063)
+++ gcc/dwarf2out.c (revision 172064)
@@ -13545,7 +13545,7 @@ based_loc_descr (rtx reg, HOST_WIDE_INT
int base_reg
= DWARF_FRAME_REGNUM ((fde && fde->drap_reg != INVALID_REGNUM)
? HARD_FRAME_POINTER_REGNUM
- : STACK_POINTER_REGNUM);
+ : REGNO (elim));
return new_reg_loc_descr (base_reg, offset);
}
2011-04-07 Jakub Jelinek <[email protected]>
PR fortran/48117
* gfortran.dg/gomp/pr48117.f90: New test.
--- gcc/testsuite/gfortran.dg/gomp/pr48117.f90.jj 2011-01-16
05:42:39.626675592 +0100
+++ gcc/testsuite/gfortran.dg/gomp/pr48117.f90 2011-04-07 16:43:20.902808325
+0200
@@ -0,0 +1,11 @@
+! PR fortran/48117
+! { dg-do compile }
+! { dg-options "-O2 -fopenmp" }
+
+subroutine foo(x)
+ character(len=*), optional :: x
+ character(len=80) :: v
+ !$omp master
+ if (present(x)) v = adjustl(x)
+ !$omp end master
+end subroutine foo