[PATCH] Add IEEE FLOAT128 support to test gdb.base/whatis-ptype-typedefs.exp

Ulrich Weigand Ulrich.Weigand@de.ibm.com
Fri Jul 15 11:42:16 GMT 2022


Carl Love <cel@us.ibm.com> wrote:

>+# Add the long double tests on the version of GCC
>+if { [test_compiler_info gcc-*] && [gcc_major_version] >= 12 } {
>+    lappend table {"long_double_typedef"    "long
double"           "_Float128"}
>+    lappend table
{"long_double_typedef2"   "long_double_typedef"   "_Float128"}
>+    lappend table
{"v_long_double_typedef"  "long_double_typedef"   "_Float128"}
>+    lappend table {"v_long_double_typedef2"
"long_double_typedef2"  "_Float128"}

This doesn't look correct to me.  First of all, we shouldn't
hardcode GCC version details like that (for one, this doesn't
account for any other compilers like LLVM or XLC).

But also, given that "long_double_typedef" is defined via:

typedef long double long_double_typedef;

in the source file, I think "ptype long_double_typedef"
should really always output "long double", no matter what
the underlying floating-point format is.  Seeing an output
of "_Float128" when that type is nowhere used in the
source code is weird.

So I think you should investigate a bit more why we're
seeing this particular output.

Bye,
Ulrich




More information about the Gdb-patches mailing list