https://gcc.gnu.org/g:bcd1b7a097031d33bc74943bb260d12ff801cf3f

commit r15-1592-gbcd1b7a097031d33bc74943bb260d12ff801cf3f
Author: Kewen Lin <li...@linux.ibm.com>
Date:   Tue Jun 25 00:04:49 2024 -0500

    rust: Replace uses of {FLOAT,{,LONG_}DOUBLE}_TYPE_SIZE
    
    Joseph pointed out "floating types should have their mode,
    not a poorly defined precision value" in the discussion[1],
    as he and Richi suggested, the existing macros
    {FLOAT,{,LONG_}DOUBLE}_TYPE_SIZE will be replaced with a
    hook mode_for_floating_type.  To be prepared for that, this
    patch is to replace use of {FLOAT,{,LONG_}DOUBLE}_TYPE_SIZE
    in rust with TYPE_PRECISION of {float,{,long_}double}_type_node.
    
    [1] https://gcc.gnu.org/pipermail/gcc-patches/2024-May/651209.html
    
    gcc/rust/ChangeLog:
    
            * rust-gcc.cc (float_type): Use TYPE_PRECISION of
            {float,double,long_double}_type_node to replace
            {FLOAT,DOUBLE,LONG_DOUBLE}_TYPE_SIZE.

Diff:
---
 gcc/rust/rust-gcc.cc | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/gcc/rust/rust-gcc.cc b/gcc/rust/rust-gcc.cc
index f17e19a2dfc..38169c08985 100644
--- a/gcc/rust/rust-gcc.cc
+++ b/gcc/rust/rust-gcc.cc
@@ -411,11 +411,11 @@ tree
 float_type (int bits)
 {
   tree type;
-  if (bits == FLOAT_TYPE_SIZE)
+  if (bits == TYPE_PRECISION (float_type_node))
     type = float_type_node;
-  else if (bits == DOUBLE_TYPE_SIZE)
+  else if (bits == TYPE_PRECISION (double_type_node))
     type = double_type_node;
-  else if (bits == LONG_DOUBLE_TYPE_SIZE)
+  else if (bits == TYPE_PRECISION (long_double_type_node))
     type = long_double_type_node;
   else
     {

Reply via email to