This is the mail archive of the gcc-help@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: Constrainst for individual registers


Hi,
I'm doing some modifections to the avr backend to suit my needs.

I would like to add new constrainst for individual registers to use in
inline assembly blocks and i was wondering what is the correct way of
doing this?

Not on topic: You can have a look at GCC's "Specifying Registers for Local Variables" feature:
http://gcc.gnu.org/onlinedocs/gcc/Local-Reg-Vars.html#Local-Reg-Vars


For example, this enables you to interface non-ABI assembler functions with C code without patching the compiler.

Moreover, introducing individual register classes will result in a zoo of constraints for 8-bit, 16-bit, 32-bit registers.

in gcc-4.5, i've added a new class for each register to reg_class,
REG_CLASS_NAMES and REG_CLASS_CONTENTS, made a need constrainst for
each register using its class and it worked as expected.

i tried to do the same in gcc-4.7 and i got:
internal compiler error: in find_costs_and_classes, at ira-costs.c:1704.

You will have to debug the compiler proper.


Notice that hooks like HARD_REGNO_MODE_OK put additional restrictions on registers/mode combinations.

So i was wondering whether i did the wrong thing or just forgot to
update some target hook.

Thanks,
Ilya.


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