Skip to content
Snippets Groups Projects
Commit 113c4826 authored by Alexandre Oliva's avatar Alexandre Oliva Committed by Alexandre Oliva
Browse files

[debug] Avoid dropping bits from num/den in fixed-point types

We used to use an unsigned 128-bit type to hold the numerator and
denominator used to represent the delta of a fixed-point type in debug
information, but there are cases in which that was not enough, and
more significant bits silently overflowed and got omitted from debug
information.

Introduce a mode in which UI_to_gnu selects a wide-enough unsigned
type, and use that to convert numerator and denominator.  While at
that, avoid exceeding the maximum precision for wide ints, and for
available int modes, when selecting a type to represent very wide
constants, falling back to 0/0 for unrepresentable fractions.


for  gcc/ada/ChangeLog

	* gcc-interface/cuintp.cc (UI_To_gnu): Add mode that selects a
	wide enough unsigned type.  Fail if the constant exceeds the
	representable numbers.
	* gcc-interface/decl.cc (gnat_to_gnu_entity): Use it for
	numerator and denominator of fixed-point types.  In case of
	failure, fall back to an indeterminate fraction.
parent bf2fc0a2
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment