diff options
author | Eric Botcazou <ebotcazou@adacore.com> | 2024-09-11 20:15:32 +0200 |
---|---|---|
committer | Marc Poulhiès <dkm@gcc.gnu.org> | 2024-10-08 10:37:15 +0200 |
commit | 9fd38cc5d636124f0611aa5d26ac4258431f164a (patch) | |
tree | cbd3f8c7a8130a225986ae2988b2efe211d98b80 /gcc/ada/gcc-interface | |
parent | 409de30d89310ea6ec24b480528c75cb74f8ef85 (diff) | |
download | gcc-9fd38cc5d636124f0611aa5d26ac4258431f164a.zip gcc-9fd38cc5d636124f0611aa5d26ac4258431f164a.tar.gz gcc-9fd38cc5d636124f0611aa5d26ac4258431f164a.tar.bz2 |
ada: Fix infinite loop on MSP430 with -mlarge flag
This removes the loop trying to find a pointer mode among the integer modes,
which is obsolete and does not work on platforms where pointers have unusual
size like MSP430 or special semantics like Morello.
gcc/ada/ChangeLog:
PR ada/116498
* gcc-interface/decl.cc (validate_size): Use the size of the default
pointer mode as the minimum size for access types and fat pointers.
Diffstat (limited to 'gcc/ada/gcc-interface')
-rw-r--r-- | gcc/ada/gcc-interface/decl.cc | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/gcc/ada/gcc-interface/decl.cc b/gcc/ada/gcc-interface/decl.cc index 880eaff..79d60c0 100644 --- a/gcc/ada/gcc-interface/decl.cc +++ b/gcc/ada/gcc-interface/decl.cc @@ -9602,14 +9602,9 @@ validate_size (Uint uint_size, tree gnu_type, Entity_Id gnat_object, old_size = max_size (old_size, true); /* If this is an access type or a fat pointer, the minimum size is that given - by the smallest integral mode that's valid for pointers. */ + by the default pointer mode. */ if (TREE_CODE (gnu_type) == POINTER_TYPE || TYPE_IS_FAT_POINTER_P (gnu_type)) - { - scalar_int_mode p_mode = NARROWEST_INT_MODE; - while (!targetm.valid_pointer_mode (p_mode)) - p_mode = GET_MODE_WIDER_MODE (p_mode).require (); - old_size = bitsize_int (GET_MODE_BITSIZE (p_mode)); - } + old_size = bitsize_int (ptr_mode); /* Issue an error either if the default size of the object isn't a constant or if the new size is smaller than it. */ |