reginfo.c (fix_register): Avoid inserting English word in diagnostic sentence.

* reginfo.c (fix_register): Avoid inserting English word in
	diagnostic sentence.  Use %qs for quoting and %'.

From-SVN: r166610
This commit is contained in:
Joseph Myers 2010-11-11 18:28:46 +00:00 committed by Joseph Myers
parent 12bbb78f64
commit 658bd5ca00
2 changed files with 38 additions and 5 deletions

View File

@ -1,3 +1,8 @@
2010-11-11 Joseph Myers <joseph@codesourcery.com>
* reginfo.c (fix_register): Avoid inserting English word in
diagnostic sentence. Use %qs for quoting and %'.
2010-11-11 H.J. Lu <hongjiu.lu@intel.com>
* config/i386/driver-i386.c (host_detect_local_cpu): Support

View File

@ -770,12 +770,40 @@ fix_register (const char *name, int fixed, int call_used)
)
&& (fixed == 0 || call_used == 0))
{
static const char * const what_option[2][2] = {
{ "call-saved", "call-used" },
{ "no-such-option", "fixed" }};
switch (fixed)
{
case 0:
switch (call_used)
{
case 0:
error ("can%'t use %qs as a call-saved register", name);
break;
error ("can't use '%s' as a %s register", name,
what_option[fixed][call_used]);
case 1:
error ("can%'t use %qs as a call-used register", name);
break;
default:
gcc_unreachable ();
}
break;
case 1:
switch (call_used)
{
case 1:
error ("can%'t use %qs as a fixed register", name);
break;
case 0:
default:
gcc_unreachable ();
}
break;
default:
gcc_unreachable ();
}
}
else
{