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: Second patch for HP-UX IA64 bootstrap failure


> On Thu, Sep 09, 2004 at 11:06:29AM -0700, Steve Ellcey wrote:
> > ! 	if (args[i].mode != GET_MODE (args[i].value))
> 
> Which is going to fail for const_int, which is VOIDmode.
> 
> What, exactly, is wrong with the previous check?
> 
> 
> r~

HP-UX IA64 could not compile eprintf in 32 bit mode.  A cut down
test case is:

  extern int __iob[];
  void
  __eprintf ()
  {
    foo ((&__iob[2]));
  }

When I compile this with -O2 I get:

  c.c: In function `__eprintf':
  c.c:6: internal compiler error: in copy_to_mode_reg, at explow.c:635
  Please submit a full bug report,
  with preprocessed source if appropriate.
  See <URL:http://gcc.gnu.org/bugs.html> for instructions.

The value of args[i].value is:

(const:DI (plus:DI (symbol_ref:DI ("__iob") [flags 0x40] <var_decl 7adfc280 __iob>)
        (const_int 8 [0x8])))

And args[i].mode is:

SImode

And args[i].tree_value is:

 <addr_expr 7ae03260
    type <pointer_type 7ae85e80
        type <integer_type 7ae9a580 int public SI
            size <integer_cst 7ae94560 constant invariant 32>
            unit size <integer_cst 7ae941a0 constant invariant 4>
            align 32 symtab 0 alias set 3 precision 32 min <integer_cst 7ae94520 -2147483648> max <integer_cst 7ae94540 2147483647>
            pointer_to_this <pointer_type 7ae85e80>>
        unsigned SI size <integer_cst 7ae94560 32> unit size <integer_cst 7ae941a0 4>
        align 32 symtab 0 alias set -1>
    constant invariant
    arg 0 <array_ref 7adfe810 type <integer_type 7ae9a580 int>

        arg 0 <var_decl 7adfc280 __iob type <array_type 7adfc200>
            addressable used public common external BLK file c.c line 1
            align 32
            (mem/s:BLK (symbol_ref:DI ("__iob") [flags 0x40] <var_decl 7adfc280 __iob>) [2 __iob+0 A32]) chain <function_decl 7adfc380 __eprintf>>
        arg 1 <integer_cst 7ae03280 constant invariant 2>
        arg 2 <integer_cst 7ae032a0 constant invariant 0>
        arg 3 <integer_cst 7ae032c0 constant invariant 1>>>


So the TREE is correctly showing this as a 32 bit pointer and the mode I
want is a 32 bit pointer but expand_expr returned a 64 bit address
constant.  I think it is legal for expand_expr to do that since it
doesn't gaurentee the mode of the return expression.

Steve Ellcey
sje@cup.hp.com


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