diff options
author | Gavin Romig-Koch <gavin@cygnus.com> | 1998-10-20 08:03:37 +0000 |
---|---|---|
committer | Gavin Romig-Koch <gavin@gcc.gnu.org> | 1998-10-20 08:03:37 +0000 |
commit | cb2fdc843bcf2d552617effd1eac292d498f6728 (patch) | |
tree | 5eba030480cb280d271f97b3b1653791f1de3428 /gcc | |
parent | 0ca3fb0a168e9db2bd5405855d3932f62b08b7c9 (diff) | |
download | gcc-cb2fdc843bcf2d552617effd1eac292d498f6728.zip gcc-cb2fdc843bcf2d552617effd1eac292d498f6728.tar.gz gcc-cb2fdc843bcf2d552617effd1eac292d498f6728.tar.bz2 |
regclass.c (fix_register): Add error message.
* regclass.c (fix_register): Add error message.
* invoke.texi (-fcall-used-REG,-fcall-saved-REG): Note the
new error message
From-SVN: r23198
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/invoke.texi | 12 | ||||
-rw-r--r-- | gcc/regclass.c | 23 |
3 files changed, 33 insertions, 8 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 6a6280d..89bdf96 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +Tue Oct 20 10:59:02 1998 Gavin Romig-Koch <gavin@cygnus.com> + + * regclass.c (fix_register): Add error message. + * invoke.texi (-fcall-used-REG,-fcall-saved-REG): Note the + new error message. + Tue Oct 20 10:12:17 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu> * c-decl.c (warn_missing_noreturn): New global variable. diff --git a/gcc/invoke.texi b/gcc/invoke.texi index f6ecd64..6bc075c 100644 --- a/gcc/invoke.texi +++ b/gcc/invoke.texi @@ -5819,9 +5819,9 @@ clobbered by function calls. It may be allocated for temporaries or variables that do not live across a call. Functions compiled this way will not save and restore the register @var{reg}. -Use of this flag for a register that has a fixed pervasive role in the -machine's execution model, such as the stack pointer or frame pointer, -will produce disastrous results. +It is an error to used this flag with the frame pointer or stack pointer. +Use of this flag for other registers that have fixed pervasive roles in +the machine's execution model will produce disastrous results. This flag does not have a negative form, because it specifies a three-way choice. @@ -5832,9 +5832,9 @@ functions. It may be allocated even for temporaries or variables that live across a call. Functions compiled this way will save and restore the register @var{reg} if they use it. -Use of this flag for a register that has a fixed pervasive role in the -machine's execution model, such as the stack pointer or frame pointer, -will produce disastrous results. +It is an error to used this flag with the frame pointer or stack pointer. +Use of this flag for other registers that have fixed pervasive roles in +the machine's execution model will produce disastrous results. A different sort of disaster will result from the use of this flag for a register in which function values may be returned. diff --git a/gcc/regclass.c b/gcc/regclass.c index bfb5fe6..73960c8 100644 --- a/gcc/regclass.c +++ b/gcc/regclass.c @@ -574,8 +574,27 @@ fix_register (name, fixed, call_used) if ((i = decode_reg_name (name)) >= 0) { - fixed_regs[i] = fixed; - call_used_regs[i] = call_used; + if ((i == STACK_POINTER_REGNUM +#ifdef HARD_FRAME_POINTER_REGNUM + || i == HARD_FRAME_POINTER_REGNUM +#else + || i == FRAME_POINTER_REGNUM +#endif + ) + && (fixed == 0 || call_used == 0)) + { + static char* what_option[2][2] = { + "call-saved", "call-used", + "no-such-option", "fixed" }; + + error ("can't use '%s' as a %s register", name, + what_option[fixed][call_used]); + } + else + { + fixed_regs[i] = fixed; + call_used_regs[i] = call_used; + } } else { |