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]
Other format: [Raw text]

Re: [PATCH] S/390: Fix PR 36745: ICE in gen_reg_rtx,@emit-rtl.c:868


Andreas Krebbel wrote:

> 2008-07-11  Andreas Krebbel  <krebbel1@de.ibm.com>
> 
> 	PR target/36745
> 	* config/s390/s390.c: (s390_secondary_reload): Add a secondary
> 	reload for symbol refs moved to r0 with -fPIC.
> 	(legitimize_pic_address): Use the target register as temporary
> 	reg if possible.
> 	(emit_symbolic_move): Adjust comment.
> 	* config/s390/s390.md (reloadsi_PIC_addr, reloaddi_PIC_addr):
> 	New expanders.
> 
> 2008-07-11  Andreas Krebbel  <krebbel1@de.ibm.com>
> 
> 	PR target/36745
> 	* g++.dg/torture/pr36745.C: New testcase.

This looks good to me, except ...

> +  /* A scratch address register is needed when a SYMBOL_REF is copied
> +     to r0 compiling with -fPIC.  In other cases the target register
> +     might be used as temporary (see legitimize_pic_address).  */
> +  if (in_p && GET_CODE (x) == SYMBOL_REF && flag_pic == 2 && class != ADDR_REGS)
> +    sri->icode = (TARGET_64BIT ?
> +		  CODE_FOR_reloaddi_PIC_addr :
> +		  CODE_FOR_reloadsi_PIC_addr);

... I think we need this not just for SYMBOL_REFs, but for any symbolic
constant (SYMBOLIC_CONST).

Bye,
Ulrich

-- 
  Dr. Ulrich Weigand
  GNU Toolchain for Linux on System z and Cell BE
  Ulrich.Weigand@de.ibm.com


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