This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] Fix PR target/10114 and PR target/10084
- From: Eric Botcazou <ebotcazou at libertysurf dot fr>
- To: gcc-patches at gcc dot gnu dot org
- Date: Thu, 27 Mar 2003 10:58:59 +0100
- Subject: [PATCH] Fix PR target/10114 and PR target/10084
Hi,
The attached testcase doesn't compile on any active branch (a regression from
2.95.3) on sparc-linux because dwarf2out.c:mem_loc_descriptor doesn't know
how to handle LO_SUM and thus aborts.
Compiled on i586-redhat-linux-gnu-x-sparc-sun-solaris2.9, the testcase now
compiles fine with -gdwarf-2. Ok everywhere?
--
Eric Botcazou
2003-03-27 Eric Botcazou <ebotcazou at libertysurf dot fr>
Richard Henderson <rth at redhat dot com>
PR target/10114 and PR target/10084
* dwarf2out.c (mem_loc_descriptor): Handle LO_SUM.
2003-03-27 Eric Botcazou <ebotcazou at libertysurf dot fr>
* gcc.dg/sparc-dwarf2.c: New test.Index: dwarf2out.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/dwarf2out.c,v
retrieving revision 1.390.2.3
diff -u -p -r1.390.2.3 dwarf2out.c
--- dwarf2out.c 15 Mar 2003 17:00:09 -0000 1.390.2.3
+++ dwarf2out.c 27 Mar 2003 07:37:21 -0000
@@ -8177,6 +8177,11 @@ mem_loc_descriptor (rtl, mode)
add_loc_descr (&mem_loc_result, new_loc_descr (DW_OP_deref, 0, 0));
break;
+ case LO_SUM:
+ rtl = XEXP (rtl, 1);
+
+ /* ... fall through ... */
+
case LABEL_REF:
/* Some ports can transform a symbol ref into a label ref, because
the symbol ref is too far away and has to be dumped into a constant
/* PR target/10114 */
/* Originator: James Troup <james at nocrew dot org> */
/* { dg-do compile { target sparc-*-linux* } } */
/* { dg-options "-g -O1" } */
extern __inline double sqrt (double __x)
{
register double __r;
__asm ("fsqrtd %1,%0" : "=f" (__r) : "f" (__x));
return __r;
}
static double our_skew, max_update_skew;
static double Sqr(double x)
{
return x*x;
}
void REF_SetReference(double skew)
{
double previous_skew, new_skew;
double old_weight, new_weight, sum_weight;
double delta_freq1, delta_freq2;
double skew1, skew2;
previous_skew = our_skew;
skew1 = sqrt((Sqr(delta_freq1) * old_weight + Sqr(delta_freq2) * new_weight) / sum_weight);
skew2 = (previous_skew * old_weight + new_skew * new_weight) / sum_weight;
our_skew = skew1 + skew2;
}