Tagged articles
2 articles
Page 1 of 1
Amap Tech
Amap Tech
Jan 26, 2024 · Fundamentals

Debugging a GCC O3 Loop Vectorization Crash: Analysis, Root Cause, and Fix

A segmentation fault in a simple tile‑index copy loop was traced to GCC 9.2’s -O3 loop‑vectorization pass miscalculating structure offsets, and the issue was resolved by disabling -ftree-loop-vectorize or upgrading the compiler, as newer GCC versions and Clang handle the code correctly.

AssemblyNEONcompiler-bug
0 likes · 26 min read
Debugging a GCC O3 Loop Vectorization Crash: Analysis, Root Cause, and Fix
Alibaba Cloud Developer
Alibaba Cloud Developer
Dec 12, 2023 · Backend Development

Why GCC’s Loop Vectorization Crashed My Code and How to Fix It

A client‑reported segmentation fault was traced to changing GCC’s optimization level from -O2 to -O3, revealing a bug in the -ftree-loop-vectorize option that miscalculates struct sizes, and the article explains the analysis, assembly inspection, NEON details, and a practical workaround.

AssemblyNEONdebugging
0 likes · 28 min read
Why GCC’s Loop Vectorization Crashed My Code and How to Fix It