Bug 1995933 - modulus with input and output set to a hard register
Summary: modulus with input and output set to a hard register
Keywords:
Status: CLOSED UPSTREAM
Alias: None
Product: Red Hat Enterprise Linux 9
Classification: Red Hat
Component: gcc
Version: 9.0
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: beta
: ---
Assignee: Marek Polacek
QA Contact: Václav Kadlčík
URL:
Whiteboard:
: 2003137 (view as bug list)
Depends On:
Blocks: 2003137
TreeView+ depends on / blocked
 
Reported: 2021-08-20 08:24 UTC by Jesus Checa
Modified: 2023-07-18 14:25 UTC (History)
10 users (show)

Fixed In Version:
Doc Type: No Doc Update
Doc Text:
Clone Of:
: 2003137 (view as bug list)
Environment:
Last Closed: 2022-03-07 18:59:22 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
preprocessed source (2.26 KB, text/x-csrc)
2021-08-20 08:24 UTC, Jesus Checa
no flags Details


Links
System ID Private Priority Status Summary Last Updated
GNU Compiler Collection 101882 0 None None None 2021-08-20 19:05:05 UTC
Red Hat Issue Tracker RHELPLAN-94247 0 None None None 2021-08-20 08:26:19 UTC
Red Hat Issue Tracker RHELPLAN-94248 0 None None None 2021-08-20 08:26:20 UTC

Internal Links: 1870001

Description Jesus Checa 2021-08-20 08:24:25 UTC
Created attachment 1815931 [details]
preprocessed source

Description of problem:
Modulus operation with input and output being a hard register will cause a internal compiler error when building with -O and -mcpu=power9 or power10.
There is already an upstream gcc12/git bug filed here: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101882

We found out that this bug is also reproducing in our gcc (gcc-11.2.1-2.2.el9.ppc64le).

Version-Release number of selected component (if applicable):
gcc-11.2.1-2.2.el9.ppc64le

How reproducible:
100%

Steps to Reproduce:

foofoo9.c:
  register a __asm__("r20");
  b() { a = a % 9 ; }
# does not occur with -O0, or with -mcpu=power8.
$ gcc  -O -mcpu=power9 foofoo9.c 

Actual results:
foo.c: In function ‘b’:
foo.c:2:23: error: unable to generate reloads for impossible constraints:
    2 |     b() { a = a % 9 ; }
      |                       ^
(insn 8 7 11 2 (set (reg/v:SI 20 20 [ a ])
        (mod:SI (reg/v:SI 20 20 [ a ])
            (reg:SI 121))) "foo.c":2:17 194 {*modsi3}
     (expr_list:REG_DEAD (reg:SI 121)
        (nil)))
during RTL pass: reload
foo.c:2:23: internal compiler error: in process_alt_operands, at lra-constraints.c:3108
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://bugzilla.redhat.com/bugzilla> for instructions.
Preprocessed source stored into /tmp/ccZWfCCO.out file, please attach this to your bugreport.


Expected results:
No internal compiler error.

Comment 1 Marek Polacek 2021-08-20 19:08:27 UTC
I think this breaks the build of valgrind so will merit exception+ when we have a fix.

Comment 7 Marek Polacek 2021-09-15 17:04:51 UTC
No progress upstream, moving ITM.  I no longer think there will be a fix available for 9-Beta.

Comment 10 Marek Polacek 2021-09-27 17:05:50 UTC
*** Bug 2003137 has been marked as a duplicate of this bug. ***

Comment 14 Marek Polacek 2022-03-07 18:59:22 UTC
No progress upstream.  It may not even make RHEL 9.1.  Perhaps we should track the problem in the upstream PR then.


Note You need to log in before you can comment on or make changes to this bug.