gcc/gcc47-pr52132.patch

48 lines
1.1 KiB
Diff
Raw Normal View History

2012-02-06 23:21:35 +00:00
2012-02-06 Jakub Jelinek <jakub@redhat.com>
PR debug/52132
* reg-stack.c (subst_stack_regs_in_debug_insn): Don't use
get_true_reg.
* gcc.dg/pr52132.c: New test.
--- gcc/reg-stack.c.jj 2011-12-01 11:45:06.000000000 +0100
+++ gcc/reg-stack.c 2012-02-06 11:13:28.777795938 +0100
@@ -1323,14 +1323,10 @@ compare_for_stack_reg (rtx insn, stack r
static int
subst_stack_regs_in_debug_insn (rtx *loc, void *data)
{
- rtx *tloc = get_true_reg (loc);
stack regstack = (stack)data;
int hard_regno;
- if (!STACK_REG_P (*tloc))
- return 0;
-
- if (tloc != loc)
+ if (!STACK_REG_P (*loc))
return 0;
hard_regno = get_hard_regnum (regstack, *loc);
--- gcc/testsuite/gcc.dg/pr52132.c.jj 2012-02-06 11:14:23.572547529 +0100
+++ gcc/testsuite/gcc.dg/pr52132.c 2012-02-06 11:14:46.656442861 +0100
@@ -0,0 +1,18 @@
+/* PR debug/52132 */
+/* { dg-do compile } */
+/* { dg-options "-std=c99 -O2 -g" } */
+
+int l;
+void bar (void);
+
+void
+foo (int *x, float y)
+{
+ float b;
+ union { float f; int i; } u = { .f = y };
+ u.i += 127 << 23;
+ u.f = ((-1.0f / 3) * u.f + 2) * u.f - 2.0f / 3;
+ b = 0.5 * (u.f + l);
+ if (b >= *x)
+ bar ();
+}