> Date: Thu, 10 Mar 2011 17:55:38 +0100
> From: Paolo Bonzini <bonz...@gnu.org>

> On 03/10/2011 04:47 PM, Nathan Froyd wrote:
> > [moving to gcc@ to get input from a wider audience]
> >
> > On Thu, Mar 10, 2011 at 06:47:20AM +0100, Hans-Peter Nilsson wrote:
> >>> From: Nathan Froyd<froy...@codesourcery.com>
> >>> On Thu, Mar 10, 2011 at 04:02:27AM +0100, Hans-Peter Nilsson wrote:
> >> Hm.  Speaking of macros with semantics different depending on
> >> REG_OK_STRICT being defined (should be just register and address
> >> constraints), how do you do that in constraints.md?

> > ... knowing how to deal with strictness would help a great deal.
> 
> I guess you can leave everything in the target header and use a macro. 
> This basically depends on the constraint checks being always in a header 
> (tm_constrs.h).

Yah, I'd already tried that, defining constraints like

+(define_constraint "R"
+  "An operand to BDAP or BIAP"
+  (match_test "EXTRA_CONSTRAINT_R (op)"))

with the definition of EXTRA_CONSTRAINT_R still in cris.h, but I
get what seems to be a strict-related fallout (the inner mem
should have been a register):

/tmp/constrmd/gccobj/./gcc/xgcc -B/tmp/constrmd/gccobj/./gcc/ -nostdinc 
-B/tmp/constrmd/gccobj/cris-elf/v10/newlib/ -isystem 
/tmp/constrmd/gccobj/cris-elf/v10/newlib/targ-include -isystem 
/tmp/constrmd/gcc/newlib/libc/include 
-B/tmp/constrmd/gccobj/cris-elf/v10/libgloss/cris 
-L/tmp/constrmd/gccobj/cris-elf/v10/libgloss/libnosys 
-L/tmp/constrmd/gcc/libgloss/cris -B/tmp/constrmd/pre/cris-elf/bin/ 
-B/tmp/constrmd/pre/cris-elf/lib/ -isystem /tmp/constrmd/pre/cris-elf/include 
-isystem /tmp/constrmd/pre/cris-elf/sys-include  -march=v10 -mbest-lib-options 
-DPACKAGE_NAME=\"newlib\" -DPACKAGE_TARNAME=\"newlib\" 
-DPACKAGE_VERSION=\"1.18.0\" -DPACKAGE_STRING=\"newlib\ 1.18.0\" 
-DPACKAGE_BUGREPORT=\"\" -I. -I/tmp/constrmd/gcc/newlib/libc/stdlib 
-DHAVE_RENAME -D_USE_WRITE -DCOMPACT_CTYPE -fno-builtin      -g -O2  -march=v10 
-mbest-lib-options -c -o lib_a-gdtoa-gethex.o `test -f 'gdtoa-gethex.c' || echo 
'/tmp/constrmd/gcc/newlib/libc/stdlib/'`gdtoa-gethex.c
/tmp/constrmd/gcc/newlib/libc/stdlib/gdtoa-gethex.c: In function '__gethex':
/tmp/constrmd/gcc/newlib/libc/stdlib/gdtoa-gethex.c:353:1: error: insn does not 
satisfy its constraints:
(insn 171 170 172 14 (parallel [
            (set (reg:QI 9 r9 [orig:283 prephitmp.192 ] [283])
                (mem:QI (plus:SI (reg/v/f:SI 1 r1 [orig:65 s0 ] [65])
                        (mem/c:SI (plus:SI (reg/f:SI 14 sp)
                                (const_int 40 [0x28])) [9 %sfp+-32 S4 A8])) [0 
*s_81+0 S1 A8]))
            (set (reg/v/f:SI 0 r0 [orig:34 s ] [34])
                (plus:SI (reg/v/f:SI 1 r1 [orig:65 s0 ] [65])
                    (mem/c:SI (plus:SI (reg/f:SI 14 sp)
                            (const_int 40 [0x28])) [9 %sfp+-32 S4 A8])))
        ]) /tmp/constrmd/gcc/newlib/libc/stdlib/gdtoa-gethex.c:173 21 
{*mov_sideqi}
     (nil))
/tmp/constrmd/gcc/newlib/libc/stdlib/gdtoa-gethex.c:353:1: internal compiler 
error: in reload_cse_simplify_operands, at postreload.c:403

and even if it had worked, a happens-to-work solution like this
seems a bit brittle, but worth trying.

I think I'll have to rework the macros used in the constraints
to not depend on REG_OK_STRICT or something.  Anyway, postponed
for now, revisit in 4.7.

brgds, H-P

Reply via email to