From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 53FAF385841A; Mon, 10 Jan 2022 21:27:14 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 53FAF385841A From: "k.even-mendoza at imperial dot ac.uk" To: gcc-bugs@gcc.gnu.org Subject: [Bug middle-end/100536] ICE: in expand_call with large union (1GB) argument Date: Mon, 10 Jan 2022 21:27:14 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: middle-end X-Bugzilla-Version: 12.0 X-Bugzilla-Keywords: error-recovery, ice-on-invalid-code X-Bugzilla-Severity: normal X-Bugzilla-Who: k.even-mendoza at imperial dot ac.uk X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: cc Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Jan 2022 21:27:14 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D100536 Karine EM changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |k.even-mendoza at imperial= dot ac. | |uk --- Comment #5 from Karine EM --- With GCC-11 and GCC-10, the compiler does not crash but returns: "confused = by earlier errors, bailing out" and ends gracefully. But with GCC-12, I got a similar crash, with a flat array, a bit over 1GB: 1 struct a { 2 char arr[1100000000]; 3 } b[1]; 4 void c(struct a e) { 5 if (__builtin_memcmp(e.arr, b, 6)) 6 __builtin_abort(); 7 } 8 int main() { 9 struct a d; 10 d.arr; 11 c(d); 12 return 0; 13 } However, the compiler does recognize the huge stack and gives: "sorry, unimplemented: passing too large argument on stack", but still crash. If th= ere is already an error printed, what is the problem to terminate the compilati= on gracefully as GCC-11 and GCC-10 used to do? =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D With GCC-11 and GCC-10 (at least for this case): gcc-10 -O2 2c8efdb591d9739d4434f1c216106706c62bd78f_v2.c 2c8efdb591d9739d4434f1c216106706c62bd78f_v2.c: In function =E2=80=98main=E2= =80=99: 2c8efdb591d9739d4434f1c216106706c62bd78f_v2.c:11:3: sorry, unimplemented: passing too large argument on stack 11 | c(d); | ^~~~ 2c8efdb591d9739d4434f1c216106706c62bd78f_v2.c:11: confused by earlier error= s, bailing out =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D With GCC-12 ((GCC) 12.0.0 20211216 (experimental)), this is the trace: 2c8efdb591d9739d4434f1c216106706c62bd78f.c:11:3: sorry, unimplemented: pass= ing too large argument on stack 11 | c(d); | ^~~~ during RTL pass: expand 2c8efdb591d9739d4434f1c216106706c62bd78f.c:11:3: internal compiler error: in expand_call, at calls.c:3905 0x6cced7 expand_call(tree_node*, rtx_def*, int) .././../gcc-source/gcc/calls.c:3905 0xb43a3f expand_expr_real_1(tree_node*, rtx_def*, machine_mode, expand_modifier, rtx_def**, bool) .././../gcc-source/gcc/expr.c:11536 0xa14b41 expand_expr .././../gcc-source/gcc/expr.h:301 0xa14b41 expand_call_stmt .././../gcc-source/gcc/cfgexpand.c:2831 0xa14b41 expand_gimple_stmt_1 .././../gcc-source/gcc/cfgexpand.c:3864 0xa14b41 expand_gimple_stmt .././../gcc-source/gcc/cfgexpand.c:4028 0xa1a67e expand_gimple_basic_block .././../gcc-source/gcc/cfgexpand.c:6069 0xa1c527 execute .././../gcc-source/gcc/cfgexpand.c:6795 Please submit a full bug report, with preprocessed source if appropriate. Please include the complete backtrace with any bug report.=