public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* [named address] ice-on-valid: in postreload.c:reload_cse_simplify_operands
@ 2011-08-04 13:43 Georg-Johann Lay
  2011-08-04 16:20 ` Ulrich Weigand
  0 siblings, 1 reply; 21+ messages in thread
From: Georg-Johann Lay @ 2011-08-04 13:43 UTC (permalink / raw)
  To: gcc

Trying to make named address space support work for target AVR,
I am facing the following problem:

For generic AS, there are three valid base pointer registers
X , Y and Z.

For the new __pgm AS, only Z is available without offset.

The problem is now that addresses.h:base_reg_class() does not
pass down AS information, i.e. addr_space_t down to target hook
MODE_CODE_BASE_REG_CLASS.

Likewise for REGNO_MODE_CODE_OK_FOR_BASE_P.

The MODE argument that both of these get describe the mode of
the MEM but not the mode associated with the AS.

Thus, it is not possible to provide proper implementations of
these hooks.  IRA/reload choses the wrong hard register so
that in postreload no constraints match, i.e.
TARGET_ADDR_SPACE_LEGITIMATE_ADDRESS_P returns wrong for that
hard register (which is right) so that postreload busts.

I'd just like to reassure me that I didn't do something fundamentally
wrong and named address space support if not yet smoothly supported
in GCC.

FYI, the C source is

int read_from_pgm_2 (int * const __pgm * const addr)
{
    return **addr;
}

===== Prior to reload: PHI is attached to __pgm, i.e. AS1, looks fine:

(insn 2 4 3 2 (set (reg/v/f:PHI 45 [ addr ])
        (reg:PHI 24 r24 [ addr ])) pgm.c:42 8 {*movphi}
     (nil))

(note 3 2 6 2 NOTE_INSN_FUNCTION_BEG)

(insn 6 3 7 2 (set (reg/f:HI 47 [ *addr_1(D) ])
        (mem/f:HI (reg/v/f:PHI 45 [ addr ]) [2 *addr_1(D)+0 S2 A8 AS1])) pgm.c:43 7 {*movhi}
     (expr_list:REG_DEAD (reg/v/f:PHI 45 [ addr ])
        (nil)))

(note 7 6 12 2 NOTE_INSN_DELETED)

(insn 12 7 15 2 (set (reg/i:HI 24 r24)
        (mem:HI (reg/f:HI 47 [ *addr_1(D) ]) [3 *D.1949_2+0 S2 A8])) pgm.c:44 7 {*movhi}
     (expr_list:REG_DEAD (reg/f:HI 47 [ *addr_1(D) ])
        (nil)))

(insn 15 12 0 2 (use (reg/i:HI 24 r24)) pgm.c:44 -1
     (nil))


===== After reload

(insn 20 3 6 2 (set (reg:PHI 26 r26)
        (reg/v/f:PHI 24 r24 [orig:45 addr ] [45])) pgm.c:43 8 {*movphi}
     (nil))

(insn 6 20 7 2 (set (reg/f:HI 30 r30 [orig:47 *addr_1(D) ] [47])
        (mem/f:HI (reg:PHI 26 r26) [2 *addr_1(D)+0 S2 A8 AS1])) pgm.c:43 7 {*movhi}
     (nil))

(note 7 6 12 2 NOTE_INSN_DELETED)

(insn 12 7 15 2 (set (reg/i:HI 24 r24)
        (mem:HI (reg/f:HI 30 r30 [orig:47 *addr_1(D) ] [47]) [3 *D.1949_2+0 S2 A8])) pgm.c:44 7 {*movhi}
     (nil))

(insn 15 12 18 2 (use (reg/i:HI 24 r24)) pgm.c:44 -1
     (nil))

The register names are (X=r26, invalid to load from AS1 in insn 6).

Johann

^ permalink raw reply	[flat|nested] 21+ messages in thread

end of thread, other threads:[~2011-08-22 12:39 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-08-04 13:43 [named address] ice-on-valid: in postreload.c:reload_cse_simplify_operands Georg-Johann Lay
2011-08-04 16:20 ` Ulrich Weigand
2011-08-04 16:26   ` DJ Delorie
2011-08-04 16:33     ` Ulrich Weigand
2011-08-04 17:28   ` Georg-Johann Lay
2011-08-05 10:19     ` Ulrich Weigand
2011-08-05 12:47       ` Georg-Johann Lay
2011-08-05 13:24         ` Ulrich Weigand
2011-08-05 14:09           ` Michael Matz
2011-08-05 14:29             ` Ulrich Weigand
2011-08-05 20:43     ` Ulrich Weigand
2011-08-05 20:47       ` DJ Delorie
2011-08-05 21:01         ` Ulrich Weigand
2011-08-05 21:08           ` DJ Delorie
2011-08-08 11:38       ` Georg-Johann Lay
2011-08-09 17:16         ` Ulrich Weigand
2011-08-10 14:04           ` Georg-Johann Lay
2011-08-17 17:44             ` Georg-Johann Lay
2011-08-18 14:38               ` Ulrich Weigand
2011-08-21 16:43                 ` Georg-Johann Lay
2011-08-22 12:39                   ` Ulrich Weigand

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).