Internal compiler error

I’m having a go with this project:

and the code/sketch is not compiling.

lto1: internal compiler error: in lto_output_varpool_node, at lto-cgraph.c:624
Please submit a full bug report,
with preprocessed source if appropriate.
See http://gcc.gnu.org/bugs.html for instructions.
lto-wrapper: fatal error: /home/rob/.arduino15/packages/arduino/tools/avr-gcc/5.4.0-atmel3.6.1-arduino2/bin/avr-gcc returned 1 exit status
compilation terminated.
/home/rob/.arduino15/packages/arduino/tools/avr-gcc/5.4.0-atmel3.6.1-arduino2/bin/…/lib/gcc/avr/5.4.0/…/…/…/…/avr/bin/ld: error: lto-wrapper failed
collect2: error: ld returned 1 exit status
Used: /home/rob/sketchbook/libraries/DHT
Used: /home/rob/sketchbook/libraries/MD_MAX72XX
Used: /home/rob/.arduino15/packages/arduino/hardware/avr/1.6.23/libraries/Wire

Using library DHT in folder: /home/rob/sketchbook/libraries/DHT (legacy)
Using library MD_DS1307 at version 1.3.5 in folder: /home/rob/sketchbook/libraries/MD_DS1307
Using library MD_Parola-master at version 3.1.0 in folder: /home/rob/sketchbook/libraries/MD_Parola-master
Using library MD_MAX72XX at version 3.0.2 in folder: /home/rob/sketchbook/libraries/MD_MAX72XX
Using library SPI at version 1.0 in folder: /home/rob/.arduino15/packages/arduino/hardware/avr/1.6.23/libraries/SPI
Using library MAX7219_RTC_dht11 in folder: /home/rob/sketchbook/libraries/MAX7219_RTC_dht11 (legacy)
Using library Wire at version 1.0 in folder: /home/rob/.arduino15/packages/arduino/hardware/avr/1.6.23/libraries/Wire
exit status 1
Error compiling for board Arduino/Genuino Uno

#include <DHT.h>
#include <MD_DS1307.h>
#include <MD_Parola.h>
#include <MD_MAX72xx.h>
#include <SPI.h>
#include <Font_Data.h>

// Header file includes
#include <MD_Parola.h>
#include <MD_MAX72xx.h>
#include <SPI.h>
#include <Wire.h>
#include <MD_DS1307.h>
#include "DHT.h"
DHT dht;
#include "Font_Data.h"

#define HARDWARE_TYPE MD_MAX72XX::FC16_HW
#define MAX_DEVICES 4
#define CLK_PIN   13
#define DATA_PIN  11
#define CS_PIN    10

// HARDWARE SPI
MD_Parola P = MD_Parola(HARDWARE_TYPE, CS_PIN, MAX_DEVICES);
// SOFTWARE SPI
//MD_Parola P = MD_Parola(HARDWARE_TYPE, DATA_PIN, CLK_PIN, CS_PIN, MAX_DEVICES);

The whole code is over 9000 characters so this is only the staqrt of it.

if all the code is needed, can I just post as a separate message.

This bug is specific to the 5.4.0-atmel3.6.1-arduino2 version of avr-gcc used by Arduino AVR Boards 1.6.22 and newer. It has been reported here:

Here's the easiest workaround

  • Tools > Board > Boards Manager
  • Wait for downloads to finish.
  • When you move the mouse pointer over "Arduino AVR Boards", you will see a "Select version" dropdown menu appear. Select "1.6.21".
  • Click "Install".
  • Wait for installation to finish.
  • Click "Close".

Due to a bug, this alternative workaround doesn't work with Arduino IDE 1.8.6, but it will work with any other version of the Arduino IDE.

If you have File > Preferences > Check for updates on startup checked, the Arduino IDE may occasionally notify you that a new version of Arduino AVR Boards is available, you'll need to refrain from updating back to the new Arduino AVR Boards version, otherwise you'll be back to seeing the segmentation fault error again.

Another workaround is described at AVR core 1.6.22 (IDE 1.8.6) crashes avr-gcc compiler (5.4.0) when F() string is assigned to a static variable · Issue #39 · arduino/ArduinoCore-avr · GitHub

Thanks for the reply and information, and doing the easist workaround to install 1.6.21 fixed the compiler error.
Version 1.6.3 was installed, but not now.

Maybe the said workaround could be a sticky post incase anyone else comes across the compiler error.

You're welcome. I'm glad to hear it's working now.

This specific error has not been all that common. However, there is another related issue (segmentation fault) with avr-gcc 5.4.0 that has caused problems with a lot of people which has the same workaround of rolling back to Arduino AVR Boards 1.6.21.