Landing: b65eb20e8fff

Project / Subsystem

gcc / avr

Date

2026-09-01

Author

Georg-Johann Lay

Commit

b65eb20e8fff1bc572a49fae254055ccfc7799aa

Source

github

Perf win

No

Breaking

No

All attributes

project
gcc
subsystem
avr
patch_id
—
commit_hash
b65eb20e8fff1bc572a49fae254055ccfc7799aa
source_type
github
headline
AVR: Fix 64-bit signed fixed-point multiply
tldr
Corrects a bug in AVR's 64-bit signed fixed-point multiplication that mishandled negative numbers.
author
Georg-Johann Lay
outcome
committed
performance_win
false
breaking_change
false
series_id
—
series_parts
[]
tags
  • • avr
  • • libgcc
  • • fixed-point
  • • multiplication
discussion_id_link
—
bugzilla_pr
—
date
2026-09-01T00:00:00.000Z

The fixed-point multiply routine for 64-bit signed integers on AVR microcontrollers was incorrect for negative numbers. It failed to restore the original value of the B register after the multiplication when B was negative. This patch ensures that B is properly restored by negating it twice if it was negative, preserving the expected register state for the caller.