https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112530
Bug ID: 112530 Summary: [14 Regression] New ICE in gimple->rtl expansion after recent change Product: gcc Version: 14.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: tree-optimization Assignee: unassigned at gcc dot gnu.org Reporter: law at gcc dot gnu.org Target Milestone: --- This change: commit a5922427c29fad177251d89cc946d1c5bfc135eb Author: Andrew Stubbs <a...@codesourcery.com> Date: Fri Oct 20 16:26:51 2023 +0100 vect: Don't set excess bits in unform masks AVX ignores any excess bits in the mask (at least for vector sizes >=8), but AMD GCN magically uses a larger vector than was intended (the smaller sizes are "fake"), leading to wrong-code. This patch fixes amdgcn execution failures in gcc.dg/vect/pr81740-1.c, gfortran.dg/c-interop/contiguous-1.f90, gfortran.dg/c-interop/ff-descriptor-7.f90, and others. gcc/ChangeLog: * expr.cc (store_constructor): Add "and" operation to uniform mask generation. Causes regressions on the alpha port (these can be seen with a simple cross compiler, a full toolchain is not necessary): gcc.c-torture/execute/pr110817-3.c -O1 (test for excess errors) gcc.c-torture/execute/pr110817-3.c -O2 (test for excess errors) gcc.c-torture/execute/pr110817-3.c -O2 -flto -fno-use-linker-plugin -flto-partition=none (test for excess errors) gcc.c-torture/execute/pr110817-3.c -O3 -g (test for excess errors) gcc.c-torture/execute/pr110817-3.c -Os (test for excess errors) dump file: j.c.262r.expand j.c: In function ‘main’: j.c:10:28: internal compiler error: Segmentation fault 10 | volatile signed int t = x[0]; | ~^~~ 0x1510fc4 crash_signal /home/jlaw/test/gcc/gcc/toplev.cc:316 0x7fcfa388efcf ??? ./signal/../sysdeps/unix/sysv/linux/x86_64/libc_sigaction.c:0 0xf81369 emit_move_insn(rtx_def*, rtx_def*) /home/jlaw/test/gcc/gcc/expr.cc:4249 0xf8d86c store_constructor(tree_node*, rtx_def*, int, poly_int<1u, long>, bool) /home/jlaw/test/gcc/gcc/expr.cc:7494 0xf93de0 expand_constructor /home/jlaw/test/gcc/gcc/expr.cc:8970 0xf9de14 expand_expr_real_1(tree_node*, rtx_def*, machine_mode, expand_modifier, rtx_def**, bool) /home/jlaw/test/gcc/gcc/expr.cc:11245 0xf93e9f expand_expr_real(tree_node*, rtx_def*, machine_mode, expand_modifier, rtx_def**, bool) /home/jlaw/test/gcc/gcc/expr.cc:9049 0xf9bd72 expand_expr_real_1(tree_node*, rtx_def*, machine_mode, expand_modifier, rtx_def**, bool) /home/jlaw/test/gcc/gcc/expr.cc:10860 0xf93e9f expand_expr_real(tree_node*, rtx_def*, machine_mode, expand_modifier, rtx_def**, bool) /home/jlaw/test/gcc/gcc/expr.cc:9049 0xdc48ba expand_expr(tree_node*, rtx_def*, machine_mode, expand_modifier) /home/jlaw/test/gcc/gcc/expr.h:310 [ ... ]