Changed between 20210502 and 20210509. (gcc configured with --enable-checking=yes) Affects a bunch of testsuite files at -O1+, e.g. pr36373*.c, pr39120.c, pr50444.c : $ cat pr39120.c struct X { int *p; } x; struct X __attribute__((noinline)) foo(int *p) { struct X x; x.p = p; return x; } void __attribute((noinline)) bar() { *x.p = 1; } extern void abort (void); int main() { int i = 0; x = foo(&i); bar(); if (i != 1) abort (); return 0; } $ gcc-12-20210725 -c pr39120.c -O2 -fsso-struct=big-endian during GIMPLE pass: esra pr39120.c: In function 'foo': pr39120.c:18:1: internal compiler error: in verify_sra_access_forest, at tree-sra.c:2376 18 | } | ^ 0xee585c verify_sra_access_forest(access*) ../../gcc/tree-sra.c:2376 0xee5af1 verify_all_sra_access_forests() ../../gcc/tree-sra.c:2420 0xee9d45 analyze_all_variable_accesses ../../gcc/tree-sra.c:3480 0xeea7c6 perform_intra_sra ../../gcc/tree-sra.c:4564
Confirmed. I will have a look (although probably unfortunately only later in August).
Started with r12-622-ge2bc5b6c04df8200.
Fixing.
The master branch has been updated by Eric Botcazou <ebotcazou@gcc.gnu.org>: https://gcc.gnu.org/g:4e3129b0caceec008a940aa5eada253cd0f0b3ec commit r12-2755-g4e3129b0caceec008a940aa5eada253cd0f0b3ec Author: Eric Botcazou <ebotcazou@gcc.gnu.org> Date: Thu Aug 5 10:21:30 2021 +0200 Fix oversight in handling of reverse SSO in SRA pass The scalar storage order does not apply to pointer and vector components. gcc/ PR tree-optimization/101626 * tree-sra.c (propagate_subaccesses_from_rhs): Do not set the reverse scalar storage order on a pointer or vector component. gcc/testsuite/ * gcc.dg/sso-15.c: New test.
Thanks for reporting the problem.