diff options
author | Gaius Mulley <gaiusmod2@gmail.com> | 2025-01-29 20:32:07 +0000 |
---|---|---|
committer | Gaius Mulley <gaiusmod2@gmail.com> | 2025-01-29 20:32:07 +0000 |
commit | 62abe069506e67d2668e8de7c5e00c118c60d8a7 (patch) | |
tree | 9e9f53359a95341fec816fa22b5f1946bed3fdf1 /gcc/m2/gm2-gcc | |
parent | d9ac0ad1e9a4ceec2d354ac0368da7462bea5675 (diff) | |
download | gcc-62abe069506e67d2668e8de7c5e00c118c60d8a7.zip gcc-62abe069506e67d2668e8de7c5e00c118c60d8a7.tar.gz gcc-62abe069506e67d2668e8de7c5e00c118c60d8a7.tar.bz2 |
PR modula2/116073 invalid rtl sharing compiling FileSystem.mod caused by ext-dce
The bug fixes to PR modula2/118010 and PR modula2/118183 uncovered a bug
in the procedure interface to lseek which uses SYSTEM.COFF_T rather than
SYSTEM.CSSIZE_T. This patch sets the default size for COFF_T to the same
as CSSIZE_T.
gcc/ChangeLog:
PR modula2/118010
PR modula2/118183
PR modula2/116073
* doc/gm2.texi (-fm2-file-offset-bits=): Change the default size
description to CSSIZE_T.
Add COFF_T to the list of data types exported by SYSTEM.def.
gcc/m2/ChangeLog:
PR modula2/118010
PR modula2/118183
PR modula2/116073
* gm2-compiler/M2Options.mod (OffTBits): Assign to 0.
* gm2-gcc/m2type.cc (build_m2_specific_size_type): Ensure that
layout_type is called before returning c.
(build_m2_offt_type_node): If GetFileOffsetBits returns 0 then
use the type size of ssize_t.
gcc/testsuite/ChangeLog:
PR modula2/118010
PR modula2/118183
PR modula2/116073
* gm2/pim/run/pass/printtypesize.mod: New test.
Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>
Diffstat (limited to 'gcc/m2/gm2-gcc')
-rw-r--r-- | gcc/m2/gm2-gcc/m2type.cc | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/gcc/m2/gm2-gcc/m2type.cc b/gcc/m2/gm2-gcc/m2type.cc index 9f7a433..a946509 100644 --- a/gcc/m2/gm2-gcc/m2type.cc +++ b/gcc/m2/gm2-gcc/m2type.cc @@ -1077,7 +1077,6 @@ build_m2_specific_size_type (location_t location, enum tree_code base, { if (!float_mode_for_size (TYPE_PRECISION (c)).exists ()) return NULL; - layout_type (c); } else if (base == SET_TYPE) return build_m2_size_set_type (location, precision); @@ -1096,6 +1095,7 @@ build_m2_specific_size_type (location_t location, enum tree_code base, TYPE_UNSIGNED (c) = true; } } + layout_type (c); return c; } @@ -1385,8 +1385,12 @@ static tree build_m2_offt_type_node (location_t location) { m2assert_AssertLocation (location); + int offt_size = M2Options_GetFileOffsetBits (); + + if (offt_size == 0) + offt_size = TREE_INT_CST_LOW (TYPE_SIZE (ssizetype)); return build_m2_specific_size_type (location, INTEGER_TYPE, - M2Options_GetFileOffsetBits (), true); + offt_size, true); } /* m2type_InitSystemTypes initialise loc and word derivatives. */ |