From: Gaius Mulley Date: Sun, 20 Aug 2023 22:27:34 +0000 (+0100) Subject: PR modula2/111085 nexttoward and nexttowardf contain incorrect definitions X-Git-Tag: basepoints/gcc-15~6793 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a724c6e93dfce3a86f9c0fbf8be4316c37dd5a40;p=thirdparty%2Fgcc.git PR modula2/111085 nexttoward and nexttowardf contain incorrect definitions The definition for procedures nexttoward and nexttowardf contain second incorrect parameter and return types. This bug was discovered when attempting to resolve PR 108143 and is applied separately and prior to PR 108143. gcc/m2/ChangeLog: PR modula2/111085 * gm2-libs/Builtins.def (nexttoward): Alter the second parameter to LONGREAL. (nexttowardf): Alter the second parameter to LONGREAL. * gm2-libs/Builtins.mod (nexttoward): Alter the second parameter to LONGREAL. (nexttowardf): Alter the second parameter to LONGREAL. * gm2-libs/cbuiltin.def (nexttoward): Alter the second parameter to LONGREAL. (nexttowardf): Alter the second parameter to LONGREAL. Signed-off-by: Gaius Mulley --- diff --git a/gcc/m2/gm2-libs/Builtins.def b/gcc/m2/gm2-libs/Builtins.def index eda36c3cfce7..651ade580cb0 100644 --- a/gcc/m2/gm2-libs/Builtins.def +++ b/gcc/m2/gm2-libs/Builtins.def @@ -91,8 +91,8 @@ PROCEDURE __BUILTIN__ nextafter (x, y: REAL) : REAL ; PROCEDURE __BUILTIN__ nextafterf (x, y: SHORTREAL) : SHORTREAL ; PROCEDURE __BUILTIN__ nextafterl (x, y: LONGREAL) : LONGREAL ; -PROCEDURE __BUILTIN__ nexttoward (x, y: REAL) : LONGREAL ; -PROCEDURE __BUILTIN__ nexttowardf (x, y: SHORTREAL) : LONGREAL ; +PROCEDURE __BUILTIN__ nexttoward (x: REAL; y: LONGREAL) : REAL ; +PROCEDURE __BUILTIN__ nexttowardf (x: SHORTREAL; y: LONGREAL) : SHORTREAL ; PROCEDURE __BUILTIN__ nexttowardl (x, y: LONGREAL) : LONGREAL ; PROCEDURE __BUILTIN__ scalbln (x: REAL; n: LONGINT) : REAL ; diff --git a/gcc/m2/gm2-libs/Builtins.mod b/gcc/m2/gm2-libs/Builtins.mod index 963e88ec461f..70c1f8a3e1fa 100644 --- a/gcc/m2/gm2-libs/Builtins.mod +++ b/gcc/m2/gm2-libs/Builtins.mod @@ -267,12 +267,12 @@ BEGIN RETURN cbuiltin.nextafterl (x, y) END nextafterl ; -PROCEDURE __ATTRIBUTE__ __BUILTIN__ ((__builtin_nexttoward)) nexttoward (x, y: REAL) : LONGREAL ; +PROCEDURE __ATTRIBUTE__ __BUILTIN__ ((__builtin_nexttoward)) nexttoward (x: REAL; y: LONGREAL) : REAL ; BEGIN RETURN cbuiltin.nexttoward (x, y) END nexttoward ; -PROCEDURE __ATTRIBUTE__ __BUILTIN__ ((__builtin_nexttowardf)) nexttowardf (x, y: SHORTREAL) : LONGREAL ; +PROCEDURE __ATTRIBUTE__ __BUILTIN__ ((__builtin_nexttowardf)) nexttowardf (x: SHORTREAL; y: LONGREAL) : SHORTREAL ; BEGIN RETURN cbuiltin.nexttowardf (x, y) END nexttowardf ; diff --git a/gcc/m2/gm2-libs/cbuiltin.def b/gcc/m2/gm2-libs/cbuiltin.def index 99927058bc6c..64d0a79fb509 100644 --- a/gcc/m2/gm2-libs/cbuiltin.def +++ b/gcc/m2/gm2-libs/cbuiltin.def @@ -118,8 +118,8 @@ PROCEDURE nextafter (x, y: REAL) : REAL ; PROCEDURE nextafterf (x, y: SHORTREAL) : SHORTREAL ; PROCEDURE nextafterl (x, y: LONGREAL) : LONGREAL ; -PROCEDURE nexttoward (x, y: REAL) : REAL ; -PROCEDURE nexttowardf (x, y: SHORTREAL) : SHORTREAL ; +PROCEDURE nexttoward (x: REAL; y: LONGREAL) : REAL ; +PROCEDURE nexttowardf (x: SHORTREAL; y: LONGREAL) : SHORTREAL ; PROCEDURE nexttowardl (x, y: LONGREAL) : LONGREAL ; PROCEDURE scalb (x, n: REAL) : REAL ;