[gcc r17-3168] hwint: Simplify add_hwi/mul_hwi.

Kael Andrew Franco via Gcc-cvs <[email protected]>
Newsgroups gmane.comp.gcc.cvs
Message-ID <[email protected]>
https://gcc.gnu.org/g:7e0bb48cbb2654816ce2714de5b644f4d965d3db

commit r17-3168-g7e0bb48cbb2654816ce2714de5b644f4d965d3db
Author: Kael Andrew Alonzo Franco <[email protected]>
Date:   Sun Aug 9 17:54:47 2026 -0400

    hwint: Simplify add_hwi/mul_hwi.
    
    This combines duplicated C++ code so any C++ compiler compiles this
    header file faster.
    
    Bootstrapped and regtested on x86_64-pc-linux-gnu.
    
    gcc/ChangeLog:
    
            * hwint.h (add_hwi, mul_hwi): Combine return result.
    
    Signed-off-by: Kael Andrew Franco <[email protected]>

Diff:
---
 gcc/hwint.h | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/gcc/hwint.h b/gcc/hwint.h
index 454ee0efdcb0..ebb4253e89db 100644
--- a/gcc/hwint.h
+++ b/gcc/hwint.h
@@ -365,12 +365,11 @@ add_hwi (HOST_WIDE_INT a, HOST_WIDE_INT b, bool *overflow)
     *overflow = true;
   else
     *overflow = false;
-  return result;
 #else
   HOST_WIDE_INT result;
   *overflow = __builtin_add_overflow (a, b, &result);
-  return result;
 #endif
+  return result;
 }
 
 /* Compute the product of signed A and B and indicate in *OVERFLOW whether
@@ -386,12 +385,11 @@ mul_hwi (HOST_WIDE_INT a, HOST_WIDE_INT b, bool *overflow)
     *overflow = true;
   else
     *overflow = false;
-  return result;
 #else
   HOST_WIDE_INT result;
   *overflow = __builtin_mul_overflow (a, b, &result);
-  return result;
 #endif
+  return result;
 }
 
 /* Compute the saturated sum of signed A and B, i.e. upon overflow clamp
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.