Jakub Jelinek e4473d7cf8 ree: Fix -fcompare-debug issues in combine_reaching_defs [PR108573]
The PR78437 r7-4871 changes made combine_reaching_defs punt on
WORD_REGISTER_OPERATIONS targets if a setter of smaller than word
register has wider uses.  This unfortunately breaks -fcompare-debug,
because if such a use appears only in DEBUG_INSN(s), while all other
uses aren't wider than the setter, we can REE optimize it without -g
and not with -g.

Such decisions shouldn't be based on debug instructions.  We could try
to reset them or adjust in some other way after we decide to perform the
change, but at least on the testcase which used to fail on riscv64-linux
the
(debug_insn 8 7 9 2 (var_location:HI s (minus:HI (subreg:HI (and:DI (reg:DI 10 a0 [160])
                (const_int 1 [0x1])) 0)
        (subreg:HI (ashiftrt:DI (reg/v:DI 9 s1 [orig:151 l ] [151])
                (debug_expr:SI D#1)) 0))) "pr108573.c":12:5 -1
     (nil))
clearly doesn't care about the upper bits and I have hard time imaging how
could one end up with DEBUG_INSN which actually cares about those upper
bits.

So, the following patch just ignores uses on DEBUG_INSNs in this case,
if we run into something where we'd need to do something further later on,
let's deal with it when we have a testcase for it.

2023-02-01  Jakub Jelinek  <jakub@redhat.com>

	PR debug/108573
	* ree.cc (combine_reaching_defs): Don't return false for paradoxical
	subregs in DEBUG_INSNs.

	* gcc.dg/pr108573.c: New test.
2023-02-01 12:52:52 +01:00
2023-01-10 00:18:07 +00:00
2022-11-15 08:32:29 +00:00
2023-01-20 00:17:40 +00:00
2023-01-22 00:17:27 +00:00
2022-09-01 00:17:39 +00:00
2022-08-31 00:16:45 +00:00
2023-01-16 11:52:17 +01:00
2022-11-24 00:17:47 +00:00
2023-01-16 11:52:17 +01:00
2023-01-17 00:18:06 +00:00
2023-01-21 00:16:20 +00:00
2023-01-16 11:52:17 +01:00
2023-01-17 00:18:06 +00:00
2023-01-16 11:52:17 +01:00
2023-01-23 00:16:34 +00:00
2023-01-31 00:18:44 +00:00
2023-01-19 00:17:35 +00:00
2023-02-01 00:18:50 +00:00
2023-01-16 11:52:17 +01:00
2023-01-16 11:52:17 +01:00
2023-01-16 11:52:17 +01:00
2023-01-18 00:17:21 +00:00
2023-01-03 00:17:09 +00:00
2023-02-01 00:18:50 +00:00
2023-01-16 11:52:17 +01:00
2023-01-31 00:18:44 +00:00
2023-01-16 11:52:17 +01:00
2023-01-16 11:52:17 +01:00
2022-12-01 00:17:51 +00:00
2022-11-24 00:17:47 +00:00
2022-07-19 17:07:04 +03:00
2023-01-11 00:17:56 +00:00
2021-12-21 09:10:57 +01:00

This directory contains the GNU Compiler Collection (GCC).

The GNU Compiler Collection is free software.  See the files whose
names start with COPYING for copying permission.  The manuals, and
some of the runtime libraries, are under different terms; see the
individual source files for details.

The directory INSTALL contains copies of the installation information
as HTML and plain text.  The source of this information is
gcc/doc/install.texi.  The installation information includes details
of what is included in the GCC sources and what files GCC installs.

See the file gcc/doc/gcc.texi (together with other files that it
includes) for usage and porting information.  An online readable
version of the manual is in the files gcc/doc/gcc.info*.

See http://gcc.gnu.org/bugs/ for how to report bugs usefully.

Copyright years on GCC source files may be listed using range
notation, e.g., 1987-2012, indicating that every year in the range,
inclusive, is a copyrightable year that could otherwise be listed
individually.
Description
No description provided
Readme 1.5 GiB
Languages
C++ 30.7%
C 30%
Ada 14.5%
D 6.1%
Go 5.7%
Other 12.5%