Landing: 13040879a854

Project / Subsystem

gcc / gcc

Date

2026-05-04

Author

Jeff Law

Commit

13040879a85435edc05bef860cc8530f51a133b5

Source

github

Perf win

Yes

Breaking

No

All attributes

project
gcc
subsystem
gcc
patch_id
commit_hash
13040879a85435edc05bef860cc8530f51a133b5
source_type
github
headline
Simplify ``x + y == y`` into ``x == 0``
tldr
GCC now simplifies ``x + y == y`` into ``x == 0``, potentially improving code generation on RISC-V.
author
Jeff Law
outcome
committed
performance_win
true
breaking_change
false
series_id
series_parts
[]
tags
  • optimization
  • risc-v
discussion_id_link
bugzilla_pr
date
2026-05-04T00:00:00.000Z

GCC now simplifies expressions of the form x + y == y into x == 0. This optimization can remove unnecessary arithmetic instructions. The patch also fixes a missed side_effects_p check and a typo in a constant definition, improving the robustness of the transformation.