This is the mail archive of the gcc-patches@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]

[AVR,committed]: ad PR45099: change error to warning


As proposed in PR45099, avr-gcc will now just print a warning instead of an
error when a fixed register is needed to pass a parameter to a function.

That way the user can inspect the source, and there are situation imaginable
where clobbering a fixed register is not a problem.

Committed as trunk r179040:

http://gcc.gnu.org/viewcvs?view=revision&revision=179040

Johann

	PR target/45099
	* config/avr/avr.c (avr_function_arg_advance): Change error to
	warning if a fixed register is needed as function argument.


Index: config/avr/avr.c
===================================================================
--- config/avr/avr.c    (revision 179038)
+++ config/avr/avr.c    (working copy)
@@ -1810,7 +1810,7 @@ avr_function_arg_advance (cumulative_arg

   /* Test if all registers needed by the ABI are actually available.  If the
      user has fixed a GPR needed to pass an argument, an (implicit) function
-     call would clobber that fixed register.  See PR45099 for an example.  */
+     call will clobber that fixed register.  See PR45099 for an example.  */

   if (cum->regno >= 8
       && cum->nregs >= 0)
@@ -1819,8 +1819,8 @@ avr_function_arg_advance (cumulative_arg

       for (regno = cum->regno; regno < cum->regno + bytes; regno++)
         if (fixed_regs[regno])
-          error ("Register %s is needed to pass a parameter but is fixed",
-                 reg_names[regno]);
+          warning (0, "fixed register %s used to pass parameter to function",
+                   reg_names[regno]);
     }

   if (cum->nregs <= 0)


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