Landing: 8247ea5bb5b4

Project / Subsystem

gcc / ada

Date

2026-06-09

Author

Eric Botcazou

Commit

8247ea5bb5b425746d1860e08aa8d823e3cb2500

Source

github

Perf win

No

Breaking

No

All attributes

project
gcc
subsystem
ada
patch_id
commit_hash
8247ea5bb5b425746d1860e08aa8d823e3cb2500
source_type
github
headline
Ada Big_Integer package correctly handles negative exponents
tldr
The Ada Big_Integer package in GCC now correctly handles negative base values with even exponents for the exponentiation operator and preserves the sign during…
author
Eric Botcazou
outcome
committed
performance_win
false
breaking_change
false
series_id
series_parts
[]
tags
  • ada
  • bugfix
  • arithmetic
discussion_id_link
bugzilla_pr
date
2026-06-09T00:00:00.000Z

This commit corrects two issues within GCC’s Ada Big_Integer package, preventing incorrect results in certain arithmetic operations. Specifically, the exponentiation operator (**) now accurately accounts for the parity of an exponent when the base is negative, resolving cases like -2 ** even_exponent. Additionally, a previous oversight where the sign of the result was dropped during multiplication has been fixed, ensuring arithmetic correctness in the Big_Integer library.