aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2009-10-16 16:27:02 +0000
committerJakub Jelinek <jakub@redhat.com>2009-10-16 16:27:02 +0000
commitf996b4c6866eff70afeade186c62895a31fc9303 (patch)
treecdd85022fb9d7ff8e57e16e606c9351d62684d12
parentd7bd33820e4519743a4dbaae5549996860d6af90 (diff)
svn merge -r152895:152897 svn+ssh://gcc.gnu.org/svn/gcc/trunk
git-svn-id: https://gcc.gnu.org/svn/gcc/branches/redhat/gcc-4_4-branch@152908 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ChangeLog14
-rw-r--r--gcc/cfgexpand.c40
-rw-r--r--gcc/config/s390/s390.c4
-rw-r--r--gcc/dwarf2out.c30
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/gcc.dg/debug/pr41717.c10
6 files changed, 90 insertions, 13 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index f26d2019314..e7e30cf071a 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,17 @@
+2009-10-15 Jakub Jelinek <jakub@redhat.com>
+
+ PR debug/41717
+ * cfgexpand.c (expand_debug_expr): Handle CONJ_EXPR.
+ * dwarf2out.c (mem_loc_descriptor): Don't handle
+ POST_INT/POST_DEC/POST_MODIFY like SUBREG. For SUBREG
+ punt if it is not lowpart subreg or if inner mode isn't
+ MODE_INT.
+
+2009-10-16 Andreas Krebbel <Andreas.Krebbel@de.ibm.com>
+
+ * config/s390/s390.c (s390_z10_optimize_cmp): Skip notes when
+ investigating previous or next insns.
+
2009-10-15 Uros Bizjak <ubizjak@gmail.com>
Backport from mainline:
diff --git a/gcc/cfgexpand.c b/gcc/cfgexpand.c
index 8b632baca83..a72c7106232 100644
--- a/gcc/cfgexpand.c
+++ b/gcc/cfgexpand.c
@@ -2621,6 +2621,46 @@ expand_debug_expr (tree exp)
op1 = gen_rtx_CONST (GET_MODE_INNER (mode), op1);
return gen_rtx_CONCAT (mode, op0, op1);
+ case CONJ_EXPR:
+ if (GET_CODE (op0) == CONCAT)
+ return gen_rtx_CONCAT (mode, XEXP (op0, 0),
+ gen_rtx_NEG (GET_MODE_INNER (mode),
+ XEXP (op0, 1)));
+ else
+ {
+ enum machine_mode imode = GET_MODE_INNER (mode);
+ rtx re, im;
+
+ if (MEM_P (op0))
+ {
+ re = adjust_address_nv (op0, imode, 0);
+ im = adjust_address_nv (op0, imode, GET_MODE_SIZE (imode));
+ }
+ else
+ {
+ enum machine_mode ifmode = int_mode_for_mode (mode);
+ enum machine_mode ihmode = int_mode_for_mode (imode);
+ rtx halfsize;
+ if (ifmode == BLKmode || ihmode == BLKmode)
+ return NULL;
+ halfsize = GEN_INT (GET_MODE_BITSIZE (ihmode));
+ re = op0;
+ if (mode != ifmode)
+ re = gen_rtx_SUBREG (ifmode, re, 0);
+ re = gen_rtx_ZERO_EXTRACT (ihmode, re, halfsize, const0_rtx);
+ if (imode != ihmode)
+ re = gen_rtx_SUBREG (imode, re, 0);
+ im = copy_rtx (op0);
+ if (mode != ifmode)
+ im = gen_rtx_SUBREG (ifmode, im, 0);
+ im = gen_rtx_ZERO_EXTRACT (ihmode, im, halfsize, halfsize);
+ if (imode != ihmode)
+ im = gen_rtx_SUBREG (imode, im, 0);
+ }
+ im = gen_rtx_NEG (imode, im);
+ return gen_rtx_CONCAT (mode, re, im);
+ }
+
case ADDR_EXPR:
op0 = expand_debug_expr (TREE_OPERAND (exp, 0));
if (!op0 || !MEM_P (op0))
diff --git a/gcc/config/s390/s390.c b/gcc/config/s390/s390.c
index 4eb609629fb..f5c73dff3e9 100644
--- a/gcc/config/s390/s390.c
+++ b/gcc/config/s390/s390.c
@@ -9838,7 +9838,7 @@ s390_z10_optimize_cmp (rtx insn)
/* Swap the COMPARE arguments and its mask if there is a
conflicting access in the previous insn. */
- prev_insn = PREV_INSN (insn);
+ prev_insn = prev_nonnote_insn (insn);
if (prev_insn != NULL_RTX && INSN_P (prev_insn)
&& reg_referenced_p (*op1, PATTERN (prev_insn)))
s390_swap_cmp (cond, op0, op1, insn);
@@ -9849,7 +9849,7 @@ s390_z10_optimize_cmp (rtx insn)
the operands, or if swapping them would cause a conflict
with the previous insn, issue a NOP after the COMPARE in
order to separate the two instuctions. */
- next_insn = NEXT_INSN (insn);
+ next_insn = next_nonnote_insn (insn);
if (next_insn != NULL_RTX && INSN_P (next_insn)
&& s390_non_addr_reg_read_p (*op1, next_insn))
{
diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c
index 2bf806fcfc6..1efb3ad2469 100644
--- a/gcc/dwarf2out.c
+++ b/gcc/dwarf2out.c
@@ -10971,10 +10971,7 @@ mem_loc_descriptor (rtx rtl, enum machine_mode mode,
case POST_INC:
case POST_DEC:
case POST_MODIFY:
- /* POST_INC and POST_DEC can be handled just like a SUBREG. So we
- just fall into the SUBREG code. */
-
- /* ... fall through ... */
+ return mem_loc_descriptor (XEXP (rtl, 0), mode, initialized);
case SUBREG:
/* The case of a subreg may arise when we have a local (register)
@@ -10982,9 +10979,13 @@ mem_loc_descriptor (rtx rtl, enum machine_mode mode,
up an entire register. For now, just assume that it is
legitimate to make the Dwarf info refer to the whole register which
contains the given subreg. */
- rtl = XEXP (rtl, 0);
+ if (!subreg_lowpart_p (rtl))
+ break;
+ rtl = SUBREG_REG (rtl);
if (GET_MODE_SIZE (GET_MODE (rtl)) > DWARF2_ADDR_SIZE)
break;
+ if (GET_MODE_CLASS (GET_MODE (rtl)) != MODE_INT)
+ break;
mem_loc_result = mem_loc_descriptor (rtl, mode, initialized);
break;
@@ -11468,12 +11469,19 @@ mem_loc_descriptor (rtx rtl, enum machine_mode mode,
if (BITS_BIG_ENDIAN)
shift = GET_MODE_BITSIZE (GET_MODE (XEXP (rtl, 0)))
- shift - size;
- add_loc_descr (&mem_loc_result,
- int_loc_descriptor (DWARF2_ADDR_SIZE - shift - size));
- add_loc_descr (&mem_loc_result, new_loc_descr (DW_OP_shl, 0, 0));
- add_loc_descr (&mem_loc_result,
- int_loc_descriptor (DWARF2_ADDR_SIZE - size));
- add_loc_descr (&mem_loc_result, new_loc_descr (op, 0, 0));
+ if (shift + size != DWARF2_ADDR_SIZE)
+ {
+ add_loc_descr (&mem_loc_result,
+ int_loc_descriptor (DWARF2_ADDR_SIZE
+ - shift - size));
+ add_loc_descr (&mem_loc_result, new_loc_descr (DW_OP_shl, 0, 0));
+ }
+ if (size != DWARF2_ADDR_SIZE)
+ {
+ add_loc_descr (&mem_loc_result,
+ int_loc_descriptor (DWARF2_ADDR_SIZE - size));
+ add_loc_descr (&mem_loc_result, new_loc_descr (op, 0, 0));
+ }
}
break;
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 4cce4fa7206..ede94c6da65 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2009-10-15 Jakub Jelinek <jakub@redhat.com>
+
+ PR debug/41717
+ * gcc.dg/debug/pr41717.c: New test.
+
2009-10-15 Release Manager
* GCC 4.4.2 released.
diff --git a/gcc/testsuite/gcc.dg/debug/pr41717.c b/gcc/testsuite/gcc.dg/debug/pr41717.c
new file mode 100644
index 00000000000..21250883a11
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/debug/pr41717.c
@@ -0,0 +1,10 @@
+/* PR debug/41717 */
+/* { dg-do compile } */
+
+void
+foo (void)
+{
+ _Complex float v[1], w;
+ v[1] = 0.0f + 0.8fi;
+ w = __builtin_conjf (v[1] * v[1]);
+}