Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 1995933

Summary: modulus with input and output set to a hard register
Product: Red Hat Enterprise Linux 9 Reporter: Jesus Checa <jchecahi>
Component: gccAssignee: Marek Polacek <mpolacek>
gcc sub component: system-version QA Contact: Václav Kadlčík <vkadlcik>
Status: CLOSED UPSTREAM Docs Contact:
Severity: unspecified    
Priority: unspecified CC: ahajkova, fweimer, ganandan, jakub, mnewsome, mpolacek, ohudlick, pgm-rhel-tools, pvlasin, vkadlcik
Version: 9.0Keywords: Bugfix, Triaged
Target Milestone: betaFlags: pm-rhel: mirror+
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: No Doc Update
Doc Text:
Story Points: ---
Clone Of:
: 2003137 (view as bug list) Environment:
Last Closed: 2022-03-07 18:59:22 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 2003137    
Attachments:
Description Flags
preprocessed source none

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.