The patch attached to this message allows the building of the gcc-avr package against GCC 11.

It simply changes the type of member x_spill_indirect_levels of structure target_reload, defined in file gcc/gcc/reload.h, from bool to int. This member is only used in file gcc/gcc/reload1.c, where it is incremented as a integer with the operator ++. In GCC 11, use of this operator on variables with type bool is forbiden.

At any rate, this member seems to be intended to behave like an integer elsewhere in the code. For instance, it is passed as the third argument of the function find_reloads, defined in file gcc/gcc/reload.c, which accepts an integer as third argument.

Caveat: I did not do extensive tests to check for side effects of this
change.

Best,

Rafael Laboissière
--- gcc-avr-5.4.0+Atmel3.6.2.orig/gcc/gcc/reload.h
+++ gcc-avr-5.4.0+Atmel3.6.2/gcc/gcc/reload.h
@@ -168,7 +168,7 @@ struct target_reload {
      value indicates the level of indirect addressing supported, e.g., two
      means that (MEM (MEM (REG n))) is also valid if (REG n) does not get
      a hard register.  */
-  bool x_spill_indirect_levels;
+  int x_spill_indirect_levels;
 
   /* True if caller-save has been reinitialized.  */
   bool x_caller_save_initialized_p;

Reply via email to