On 7/6/2025 12:49 PM, Steve Kargl wrote:
On Sun, Jul 06, 2025 at 08:43:06AM +0800, Yuao Ma wrote:
Hi Steve,

On 7/6/2025 12:25 AM, Steve Kargl wrote:
On Sat, Jul 05, 2025 at 05:20:02PM +0800, Yuao Ma wrote:
diff --git a/libgfortran/configure b/libgfortran/configure
index 9898a94a372..971f1e9df5e 100755
--- a/libgfortran/configure
+++ b/libgfortran/configure
@@ -16413,7 +16413,7 @@ else
       We can't simply define LARGE_OFF_T to be 9223372036854775807,
       since some C++ compilers masquerading as C compilers
       incorrectly reject 9223372036854775807.  */
-#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
+#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31))

What is the purpose of this change?


Since I don't have root/sudo permissions on my devbox, I manually downloaded
and compiled the autoconf 2.69 tarball. This means there might be some minor
discrepancies compared to the version shipped with OS distributions.

I suspect the issue could be related to platforms where `off_t` is 32-bit,
causing a left shift of 62 to result in undefined behavior. The commit at 
https://cgit.git.savannah.gnu.org/cgit/autoconf.git/commit/?id=a1d8293f3bfa2516f9a0424e3a6e63c2f8e93c6e
seems to support my theory.


This patch is not okay to commit with this change.
Changing LARGE_OFF_T has nothing to do with implementing the
half-cycle trig functions.


Would it be possible to regenerate the configure file in a separate patch first, before we address the trig-pi patch? I believe this regeneration is a bug fix originating from autoconf 2.69, and it would be beneficial for GCC to incorporate this modification. Beyond libgfortran, libcpp and libiberty are also affected by this issue. This is indeed the direct output from my autoconf 2.69, and manually reverting parts of the generated file seems odd.

Additionally, besides the LARGE_OFF_T issue, are there any other issues this patch needs to address?

Yuao

Reply via email to