Landing: 8bfaf339d53e

Project / Subsystem

gcc / s390

Date

2026-07-29

Author

Stefan Schulze Frielinghaus

Commit

8bfaf339d53e6cc2d78a36c0014161e55cafbd5a

Source

github

Perf win

No

Breaking

No

All attributes

project
gcc
subsystem
s390
patch_id
—
commit_hash
8bfaf339d53e6cc2d78a36c0014161e55cafbd5a
source_type
github
headline
s390: Fix s390_canonicalize_comparison
tldr
Fixes s390 canonicalization of comparisons involving non-register operands for CC_TO_INT.
author
Stefan Schulze Frielinghaus
outcome
committed
performance_win
false
breaking_change
false
series_id
—
series_parts
[]
tags
  • • s390
  • • comparison
  • • compiler bug
  • • instruction selection
discussion_id_link
—
bugzilla_pr
—
date
2026-07-29T00:00:00.000Z

This commit corrects the s390_canonicalize_comparison function to properly handle comparisons where the operand for UNSPEC_CC_TO_INT might not be a register. Previously, the function assumed this operand was always a register, which could lead to issues when dealing with instructions like TDC_INSN followed by CC_TO_INT. The update ensures that the function verifies this operand is indeed a register, preventing incorrect code generation. Additionally, the change standardizes the check for register types from GET_CODE (x) == REG to the more robust REG_P (x).