Error/Warning during LTO constant propagation - get more helpful output

Joel Linn jl@conductive.de
Sat May 22 23:19:20 GMT 2021


Hello,

we are in the process of making our project GCC compatible.
With LTO enabled, linking takes remarkably long and these warnings show:

> ../src/xenia/base/memory.h: In function ‘copy_and_swap.constprop’:
> ../src/xenia/base/memory.cc:105: warning: iteration 4611686018427387903 
> invokes undefined behavior [-Waggressive-loop-optimizations]
>   105 |     dest[i] = byte_swap(src[i]);
>       |
> ../src/xenia/base/memory.cc:104: note: within this loop
>   104 |   for (; i < count; ++i) {  // handle residual elements
>       |
> ../src/xenia/base/memory.cc:124: warning: iteration 4611686018427387903 
> invokes undefined behavior [-Waggressive-loop-optimizations]
>   124 |     dest[i] = byte_swap(src[i]);
>       |
> ../src/xenia/base/memory.cc:123: note: within this loop
>   123 |   for (; i < count; ++i) {  // handle residual elements
>       |

It's the first time we see an issue with these functions. They include 
vector intrinsics.

How can I debug this issue? How to get the stack trace of the call GCC 
is trying to optimize?

Yours sincerely,
Joel Linn


More information about the Gcc-help mailing list