This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Fix for regression due to SYMBOL_REF patch to dwarf2out.c


The following fix repairs a regression in branch and trunk due to this
dwarf2out.c SYMBOL_REF patch:

> 2001-04-20  Nick Clifton  <nickc@cambridge.redhat.com>

>         * dwarf2out.c (mem_loc_descriptor): Convert symbol refs in the
>         constant pool into their pool equivalents.

> Index: gcc/dwarf2out.c
> ===================================================================
> RCS file: /cvs/gcc/gcc/gcc/dwarf2out.c,v
> retrieving revision 1.263
> diff -p -r1.263 dwarf2out.c
> *** dwarf2out.c 2001/04/12 01:44:21     1.263
> --- dwarf2out.c 2001/04/20 08:29:03
> *************** mem_loc_descriptor (rtl, mode)
> *** 7117,7122 ****
> --- 7117,7128 ----
>          pool.  */
>       case CONST:
>       case SYMBOL_REF:
> +       /* Alternatively, the symbol in the constant pool can be referenced
> +        by a different symbol.  */
> +       if (GET_CODE (rtl) == SYMBOL_REF
> +          && CONSTANT_POOL_ADDRESS_P (rtl))
> +          rtl = get_pool_constant (rtl);
> + 
>         mem_loc_result = new_loc_descr (DW_OP_addr, 0, 0);
>         mem_loc_result->dw_loc_oprnd1.val_class = dw_val_class_addr;
>         mem_loc_result->dw_loc_oprnd1.v.val_addr = save_rtx (rtl);

The error exposes itself by testuite failure
g77.f-torture/compile/19990826-3.f on DWARF 2 enabled systems when using
optimization and -g:

output_operand: floating constant misused

Analysis: The above patch causes a failure in final.c, routine
output_addr_const, because a CONST_DOUBLE (non-VOIDmode) is passed.

So in the fix I specifically prohibit this from happening:

2001-05-05  Toon Moene  <toon@moene.indiv.nluug.nl>

	* dwarf2out.c (mem_loc_descriptor): Do not pass constant pool
	contents for a SYMBOL_REF in case of floating point constants.

*** dwarf2out.c.orig    Wed May  2 20:02:33 2001
--- dwarf2out.c Sat May  5 16:57:30 2001
*************** mem_loc_descriptor (rtl, mode)
*** 7832,7836 ****
        if (GET_CODE (rtl) == SYMBOL_REF
          && CONSTANT_POOL_ADDRESS_P (rtl))
!       rtl = get_pool_constant (rtl);
  
        mem_loc_result = new_loc_descr (DW_OP_addr, 0, 0);
--- 7832,7841 ----
        if (GET_CODE (rtl) == SYMBOL_REF
          && CONSTANT_POOL_ADDRESS_P (rtl))
!       {
!         rtx tmp = get_pool_constant (rtl);
!         /* Doesn't work for floating point constants.  */
!         if (! (GET_CODE (tmp) == CONST_DOUBLE && GET_MODE (tmp) !=
VOIDmode))
!           rtl = tmp;
!       }
  
        mem_loc_result = new_loc_descr (DW_OP_addr, 0, 0);

Bootstrapped 3.0 branch with this patch on alphaev6-unknown-linux-gnu.

Can I commit this to branch and trunk ?

TIA,

-- 
Toon Moene - mailto:toon@moene.indiv.nluug.nl - phoneto: +31 346 214290
Saturnushof 14, 3738 XG  Maartensdijk, The Netherlands
Maintainer, GNU Fortran 77: http://gcc.gnu.org/onlinedocs/g77_news.html
Join GNU Fortran 95: http://g95.sourceforge.net/ (under construction)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]