This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Constant reg_names[] array breaks SunOS build.
- To: kenner at vlsi1 dot ultra dot nyu dot edu
- Subject: Constant reg_names[] array breaks SunOS build.
- From: Nick Clifton <nickc at cygnus dot com>
- Date: Fri, 26 May 2000 13:48:24 -0700
- CC: gcc-bugs at gcc dot gnu dot org
Hi Richard,
Your recent change to make the reg_names[] array constant:
Fri May 19 18:16:31 2000 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
...
* hard-reg-set.h (reg_names): Now constant.
* regs.h (reg_names): Likewise.
Appears to have broken a SunOS native build because of this
section in the definition of CONDITIONAL_REGISTER_USAGE in sparc.h:
if (TARGET_FLAT) \
{ \
/* Let the compiler believe the frame pointer is still \
%fp, but output it as %i7. */ \
fixed_regs[31] = 1; \
reg_names[FRAME_POINTER_REGNUM] = "%i7"; \
This causes the following failure when building regclass.o:
regclass.c", line 280: left operand must be modifiable lvalue: op "="
I am not sure what the correct fix for this should be. According to
the description of reg_names in tm.texi:
@findex reg_names
If @var{x} is a register, this macro should print the register's name.
The names can be found in an array @code{reg_names} whose type is
@code{char *[]}. @code{reg_names} is initialized from
@code{REGISTER_NAMES}.
Which implies that your type change was wrong, and that it should be
possible to modify the contents of the array. On the other hand, it
also says in tm.texi, when describing the CONDITIONAL_REGISTER_USAGE
macro:
@item CONDITIONAL_REGISTER_USAGE
Zero or more C statements that may conditionally modify four variables
@code{fixed_regs}, @code{call_used_regs}, @code{global_regs}
(these three are of type @code{char []}) and @code{reg_class_contents}
(of type @code{HARD_REG_SET}).
When would appear to suggest that the sparc port is wrong to try to
modify reg_names.
Do you have any ideas as to how this problem should be fixed ?
Cheers
Nick