AdaCore / Ada_Drivers_Library

Ada source code and complete sample GNAT projects for selected bare-board platforms supported by GNAT.
BSD 3-Clause "New" or "Revised" License
236 stars 141 forks source link

Reduce optimization opportunities in Semihosting. #353

Closed simonjwright closed 4 years ago

simonjwright commented 4 years ago

This problem didn’t show up with GNAT CE 2019, but it does with FSF GCC 9.1.0 & 10.1.0: the output of semihosting is garbled if semihosting.adb is compiled with -O3, OK if compiled with -O0.

What should have been

One_Wire.Get_Info:
  13  46  71  31  0  0  0  135
Flow & ToF both initialized
Flow_Sensor_Task started
ToF_Sensor_Task started

came out as

??

P?
?? 

q

Setup: GDB 8.3 & 9.1 rsp, SEGGER J-Link Edu, SEGGER J-Link GDB Server V6.42 Command Line Version, macOS Catalina

Fabien-Chouteau commented 4 years ago

Thank you @simonjwright