aboutsummaryrefslogtreecommitdiff
path: root/libgfortran/io/io.h
diff options
context:
space:
mode:
authorRoger Sayle <roger@nextmovesoftware.com>2023-12-11 17:30:20 +0000
committerRoger Sayle <roger@nextmovesoftware.com>2023-12-11 17:32:35 +0000
commit624e274ca3a4405a55662fa72d1163120df0e03d (patch)
tree0de4c3d22ea011aa0b425fc106bc65c0bd55755d /libgfortran/io/io.h
parent02f562484c17522d79a482ac702a5fa3c2dfdd10 (diff)
downloadgcc-624e274ca3a4405a55662fa72d1163120df0e03d.zip
gcc-624e274ca3a4405a55662fa72d1163120df0e03d.tar.gz
gcc-624e274ca3a4405a55662fa72d1163120df0e03d.tar.bz2
PR rtl-optimization/112380: Defend against CLOBBERs in combine.cc
This patch addresses PR rtl-optimization/112380, an ICE-on-valid regression where a (clobber (const_int 0)) encounters a sanity checking gcc_assert (at line 7554) in simplify-rtx.cc. These CLOBBERs are used internally by GCC's combine pass much like error_mark_node is used by various language front-ends. The solutions are either to handle/accept these CLOBBERs through-out (or in more places in) the middle-end's RTL optimizers, including functions in simplify-rtx.cc that are used by passes other than combine, and/or attempt to prevent these CLOBBERs escaping from try_combine into the RTX/RTL stream. The benefit of the second approach is that it actually allows for better optimization: when try_combine fails to simplify an expression instead of substituting a CLOBBER to avoid the instruction pattern being recognized, noticing the CLOBBER often allows combine to attempt alternate simplifications/transformations looking for those that can be recognized. This first alternative is the minimal fix to address the CLOBBER encountered in the bugzilla PR. 2023-12-11 Roger Sayle <roger@nextmovesoftware.com> gcc/ChangeLog PR rtl-optimization/112380 * combine.cc (expand_field_assignment): Check if gen_lowpart returned a CLOBBER, and avoid calling gen_simplify_binary with it if so. gcc/testsuite/ChangeLog PR rtl-optimization/112380 * gcc.dg/pr112380.c: New test case.
Diffstat (limited to 'libgfortran/io/io.h')
0 files changed, 0 insertions, 0 deletions