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

Re: mips n64 eh failures


The bug is here:

revision 1.361
date: 2001/10/18 21:34:08;  author: kenner;  state: Exp;  lines: +85 -41
        * emit-rtl.c (gen_reg_rtx): Also reallocate reg_decl array.
        (offset_address): New function.
        (free_emit_status): Free regno_decl.
        (init_emit): Pass proper number of elements to xcalloc.
        Allocate regno_decl.
        (mark_emit_status): Mark regno_decl values.
        * expr.c (highest_pow2_factor): New function.
        (expand_assigment): Use it and offset_address.
        Properly handle ptr_mode vs. Pmode in offset calculation.
        (store_constructor, expand_expr_unaligned): Likewise.
        (expand_expr, case COMPONENT_EXPR): Likewise.

expr.c:3709:
        to_rtx = offset_address (to_rtx, offset_rtx,
                                 highest_pow2_factor (offset));

offset = 
 <plus_expr 0x401c2860
    type <integer_type 0x401bf708 long unsigned int ...>
    arg 0 <nop_expr 0x401dac6c type <integer_type 0x401bf708 long unsigned int>
       
        arg 0 <minus_expr 0x401c25c0 type <integer_type 0x4001d4b0 long int>
            arg 0 <parm_decl 0x401db4b0 probe>
	    arg 1 <parm_decl 0x401db5a0 linear>>>
    arg 1 <integer_cst 0x4001bbe0 ... constant 0>>

in that the two parm_decls have highest_pow2_factor == 1, which
forces the entire block of memory to have alignment 8.  Which
causes the mips backend to attempt an unaligned store, which 
fails for some reason.

So there is in fact a secondary bug in the mips backend.  Namely,
the movsi_usw and movdi_usd patterns are identical if the argument
is the constant zero.  Patch for that pending.

But the *primary* bug is that an unaligned store isn't necessary.

The following test case shows the bug on both mips and alpha.


r~



typedef long unsigned int size_t;
typedef int sword __attribute__ ((mode (SI)));
typedef unsigned int uword __attribute__ ((mode (SI)));
typedef unsigned int uaddr __attribute__ ((mode (pointer)));
typedef int saddr __attribute__ ((mode (pointer)));

struct fde_vector
{
  void *orig_data;
  size_t count;
  struct dwarf_fde *array[];
};

struct dwarf_fde
{
  uword length;
  sword CIE_delta;
  unsigned char pc_begin[];
} __attribute__ ((packed, aligned (__alignof__ (void *))));

typedef struct dwarf_fde fde;
struct object;

void
fde_split (fde **probe, struct fde_vector *linear, struct fde_vector *erratic)
{
  erratic->array[probe - linear->array] = 0;
}


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