This is the mail archive of the gcc@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]

Re: more simplify_subreg aborts


> Here is an example that is similar to dj's (voidmode issues)
> that is reproducible with the v850-elf port:
> 
> static unsigned int
> size_of_encoded_value (unsigned char encoding)
> {
>   switch (encoding)
>     {
>     case 0x00:
>       return 0;
>     case 0x02:
>       return 2;
>     case 0x03:
>       return 4;
>     case 0x04:
>       return 8;
>     }
> }
> 
> It needs to be compiled at -O2.  This patch allows
> me to workaround the issue for the v850, at least.
Hi,
first of all I apologize for late reply. Last weeks I was very busy by
the other project.

This problem seems to be bug in the machine description, that does computation
on VOIDmode LABEL_REF.  In the expressions (not jumps), the LABEL_REFs should
be IMO Pmode.

Fri Jul 20 14:07:19 CEST 2001  Jan Hubicka  <jh@suse.cz>
	* v850.md (casesi expander): Fix mode of label_ref.
Index: config/v850/v850.md
===================================================================
RCS file: /cvs/gcc/egcs/gcc/config/v850/v850.md,v
retrieving revision 1.16
diff -c -3 -p -r1.16 v850.md
*** v850.md	1999/11/08 15:40:38	1.16
--- v850.md	2001/07/20 12:04:10
***************
*** 944,950 ****
    emit_insn (gen_ashlsi3 (reg, reg, GEN_INT (TARGET_BIG_SWITCH ? 2 : 1)));
    /* Load the table address into a pseudo.  */
    emit_insn (gen_movsi (tableaddress,
! 			gen_rtx_LABEL_REF (VOIDmode, operands[3])));
    /* Add the table address to the index.  */
    emit_insn (gen_addsi3 (reg, reg, tableaddress));
    /* Load the table entry.  */
--- 944,950 ----
    emit_insn (gen_ashlsi3 (reg, reg, GEN_INT (TARGET_BIG_SWITCH ? 2 : 1)));
    /* Load the table address into a pseudo.  */
    emit_insn (gen_movsi (tableaddress,
! 			gen_rtx_LABEL_REF (SImode, operands[3])));
    /* Add the table address to the index.  */
    emit_insn (gen_addsi3 (reg, reg, tableaddress));
    /* Load the table entry.  */


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