--no-ansi (mgnuc) and --no-ansi-c (mmc) have not actually done anything for
many years now. Deprecate these options and remove their "use" throughout most
of the Mercury system. (The remaining uses are in the Makefiles for the Boehm
GC, which need to be updated separately.)
Also deprecate the internal compiler option --cflags-for-ansi.
compiler/options.m:
Document that --no-ansi-c is now deprecated.
Document that the internal option --cflags-for-ansi is now
deprecated.
compiler/compile_target_code.m:
Do not pass the ANSI options to the C compiler.
scripts/mgnuc.in:
scripts/mgnuc_file_opts.sh-subr:
Deprecate the --no-ansi option; delete code that no longer does
anything useful.
configure.ac:
Delete the configuration variable CFLAGS_FOR_ANSI; it is only ever
set to be empty. (The comment talks about --no-ansi doing other things
in the mgnuc script. It used to also cause some preprocessor macros
to be defined for compatibility with the system headers on some
platforms -- that has not been the case since 2013.)
doc/user_guide.texi:
Document that --no-ansi-c is deprecated.
bytecode/Mmakefile:
compiler/Mercury.options:
library/Mercury.options:
extras/odbc/odbc.m:
runtime/Mmakefile:
scripts/Mercury.config.bootstrap.in:
scripts/Mercury.config.in:
tests/hard_coded/Mercury.options:
tests/valid/Mercury.options:
trace/Mmakefile:
util/Mmakefile:
Conform to the above change.
NEWS.md:
Announce the above.
library/string.format.m:
Delete the old predicates for formatting ints as unsigned values;
these are now unused.
configure.ac:
Require the use of a compiler that does not generate references
to the deleted predicates.
compiler/introduced_call_table.m:
Delete the above predicates from the introduced call table.
Use the recently added --trans-opt-deps-spec option to break cycles in
the trans-opt dependency graph for the standard library. This enables
more parallelism when making the .trans_opt files; it now takes about
half as long as before.
Ordering modules sensibly, so that .trans_opt files are created in a
logical order, also improves analysis results for many predicates and
functions. The only results which show a regression with this change are
for deprecated forwarding predicates/functions.
In future, we will probably be able to trim more dependencies to further
improve parallelism, without impacting analysis results.
configure.ac:
Check that the bootstrap compiler supports --trans-opt-deps-spec.
library/mer_std.trans_opt_deps_spec:
Add the spec file that adjusts dependencies in the trans-opt
dependency graph.
library/INTER_FLAGS:
Use the --trans-opt-deps-spec option when building with mmake.
scripts/prepare_install_dir.in:
tools/binary:
tools/bootcheck:
tools/unary:
Copy mer_std.trans_opt_deps_spec when preparing a copy of the
library directory.
Rename mmc and mgnuc options that set this grade component to --c-debug-grade.
Let the options named --c-debug of both mmc and mgnuc enable C level debugging
of only the module being compiled.
runtime/mercury_grade.h:
Rename the .ll_debug grade component to .c_debug. Also rename the C macro
that controls the presence or absence of this grade component
from MR_LL_DEBUG to MR_C_DEBUG_GRADE.
runtime/mercury_conf_param.h:
runtime/mercury_debug.c:
runtime/mercury_debug.h:
runtime/mercury_engine.c:
runtime/mercury_label.c:
runtime/mercury_memory_zones.c:
runtime/mercury_memory_zones.h:
runtime/mercury_overflow.c:
runtime/mercury_std.h:
runtime/mercury_wrapper.c:
Rename the MR_LOWLEVEL_DEBUG macro to MR_DEBUG_THE_RUNTIME.
Previously, the name of this macro wrongly implied that it had
something to do with the old .ll_debug grade component, even though
- the MR_LOWLEVEL_DEBUG macro was designed to debug LLDS grades,
since only these existed when it was created, while
- the .ll_debug grade component (now .c_debug) is useful only for
MLDS grades targeting C.
compiler/options.m:
Rename the old confusingly named low_level_debug option to c_debug_grade.
Move it to the list of grade options, and fix its documentation, which
was completely wrong:
- code in compile_target_code.m treated it as being a synonym of
the .ll_debug (now .c_debug) grade component, while
- its (commented out) documentation here in options.m said it called for
the enabling of what is now MR_DEBUG_THE_RUNTIME.
compiler/compile_target_code.m:
Conform to the rename just above.
Define MR_C_DEBUG_GRADE instead of MR_LL_DEBUG if c_debug_grade is enabled.
Pass -g to the C compiler if either c_debug_grade or target_debug
is enabled.
Add an XXX about a missing safety check for an obsolete experimental
feature.
compiler/compute_grade.m:
When given a grade with a .c_debug grade component, set only the
c_debug_grade option; don't set the target_debug option, which is NOT
a grade option. The change to compile_target_code.m above handles the
only situation in which this implication was formerly required.
scripts/canonical_grade.sh-subr:
scripts/init_grade_options.sh-subr:
scripts/parse_grade_options.sh-subr:
Look for and process the .c_debug grade component instead of .ll_debug.
Use a sh variable named c_debug_grade to record its absence/presence.
Look for and process the --c-debug-grade grade-component option,
setting the same sh variable, c_debug_grade. (All grade components
can be set piecemeal using sh options to the scripts using these
subroutines.) This replaces the old, confusingly named option
--low-level-debug.
scripts/mgnuc.in:
scripts/mgnuc_file_opts.sh-subr:
Consistently use the sh variable c_debug to record the presence of
the (non-grade) --c-debug option to mgnuc, and the sh variable
c_debug_grade to record the presence of the .c_debug grade component.
Stop looking for and handling the --low-level-debug option, which
mgnuc used to document, even though this duplicated the same documentation
in init_grade_options.sh-subr, which mgnuc includes. The difference was
that init_grade_options.sh-subr meant it to represent the old .ll_debug
MLDS grade component, while mgnuc treated it as specifying what is now
MR_DEBUG_THE_RUNTIME for LLDS grades. It didn't help that two sh variables
with quite different semantics had names that differed only in an
underscore: LLDEBUG_OPTS vs LL_DEBUG_OPTS.
scripts/Mmakefile:
Add a missing dependency to force the rebuild of mgnuc after each update
of its sh subroutine mgnuc_file_ops.sh-subr.
doc/user_guide.texi:
Document the --c-debug-grade option of mmc. This option was not publicly
documented under its original misleading name (--low-level-debug), but
its documentation is now possible without contorted dancing around the
name.
Clarify the documentation of mgnuc's --c-debug option.
README.sanitizers:
configure.ac:
Conform to the rename of the grade component.
grade_lib/grade_spec.m:
grade_lib/grade_string.m:
grade_lib/grade_structure.m:
grade_lib/try_all_grade_structs.m:
Conform to the rename of the grade component .ll_debug to .c_debug.
Don't allow the .c_debug grade component in LLDS grades.
In grade_string.m, add some obvious implications of some grade components.
grade_lib/choose_grade.m:
grade_lib/grade_lib.m:
grade_lib/test_grades.m:
grade_lib/var_value_names.m:
Fix white space.
scripts/ml.in:
tools/lmc.in:
tools/test_mercury:
Conform to the change in compile_target_code.m to the naming of
Boehm gc library variants.
compiler/const_prop.m:
As above.
Handle / in both int.m and uint.m the same way as //, since / is a
synonym of // in both modules.
Also, handle the compile-time evaluation of plus, minus, and
unchecked_quotient in uint.m. Previusly, we only evaluated
their synonyms +, -, * and //.
configure.ac:
Require the installed compiler to contain the fix for a bug that
prevents compilation of the new code of const_prop.m in hlc grades.
... along with their unchecked equivalents. These differ from <<, >> and
their unchecked equivalents in that they take the shift amount as a uint,
instead of an int.
library/int.m:
library/int16.m:
library/int32.m:
library/int64.m:
library/int8.m:
library/uint.m:
library/uint16.m:
library/uint32.m:
library/uint64.m:
library/uint8.m:
As above. The unchecked versions have only declarations, since
these operations have been recognized as builtins for a while now.
NEWS:
Document the new operations, and the recent change to recognize
<<u and >>u as single tokens, and fix a typo in a recent addition.
configure.ac:
Require the compiler to be sufficiently recent to be able to parse
<<u and >>u as operators.
compiler/options.m:
Provide a way for a later change to configure.ac to detect the presence
of this change.
tests/hard_coded/bitwise_int.exp:
tests/hard_coded/bitwise_int.exp2:
tests/hard_coded/bitwise_int.m:
tests/hard_coded/bitwise_int16.exp:
tests/hard_coded/bitwise_int16.m:
tests/hard_coded/bitwise_int32.exp:
tests/hard_coded/bitwise_int32.m:
tests/hard_coded/bitwise_int64.exp:
tests/hard_coded/bitwise_int64.m:
tests/hard_coded/bitwise_int8.exp:
tests/hard_coded/bitwise_int8.m:
tests/hard_coded/bitwise_uint.exp:
tests/hard_coded/bitwise_uint.exp2:
tests/hard_coded/bitwise_uint.m:
tests/hard_coded/bitwise_uint16.exp:
tests/hard_coded/bitwise_uint16.m:
tests/hard_coded/bitwise_uint32.exp:
tests/hard_coded/bitwise_uint32.m:
tests/hard_coded/bitwise_uint64.exp:
tests/hard_coded/bitwise_uint64.m:
tests/hard_coded/bitwise_uint8.exp:
tests/hard_coded/bitwise_uint8.m:
Check that <<u and >>u compute the same results as << and >> respectively.
On MacOS, make configure use the value of MACOSX_DEPLOYMENT_TARGET as
the default deployment target (if set), otherwise falling back to the
host system version.
configure.ac:
As above.
README.MacOS:
NEWS:
Document the change.
configure.ac:
Require the installed compiler to support disable_warning scopes
for unknown_format_calls.
compiler/Mercury.options:
library/Mercury.options:
Do not disable unknown_format_call warnings in whole files.
compiler/parse_tree_out_info.m:
compiler/pd_debug.m:
library/io.m:
library/stream.string_writer.m:
library/string.m:
Disable unknown_format_call warnings for just the format calls
that need it.
configure.ac:
Use the AC_CHECK_TOOL macro to search for the strip command on the
PATH. This is more consistent with how other commands are configured
(eg. ar and nm).
GCC 12 has new warning, -Winfinite-recursion, that is being triggered by six
tests in the directory tests/valid when compiled in high-level C grades. Since
we also enable -Werror, this is causing these test to fail. Fix these failures
by either removing the infinite recursion from them or by disabling the new GCC
warning for the affected test cases.
configure.ac:
tests/DEFNS_FOR_TESTS.in:
Define a variable whose value is the option for disabling GCC's infinite
recursion check.
tests/valid/higher_order5.m:
tests/valid/stack_alloc.m:
Modify these tests so they do not trigger the infinite recursion warning
in GCC (or Mercury for that matter).
tests/valid/mode_syntax.m:
tests/valid/same_length_2.m:
Merge these two tests (under the first name) since they both test the same
thing. Delete the same_length_2 version.
tests/valid/Mmakefile:
Conform to the above deletion.
tests/valid/Mercury.options:
Include DEFNS_FOR_TESTS here so that mmc --make can see it.
Disable GCC's infinite recursion check for those tests that trigger
it.
Shut up a bunch Mercury warnings for the mode_syntax test case that
are unrelated to what is actually being tested.
The basic block vectorizer optimisation in GCC 11 and 12 is generating code
that causes segmentation faults in grades that use non-local gotos.
As a workaround, disable that optimisation for GCC 11 and later.
(While this problem has presumably always existed for GCC 11, it has not shown
up previously because the affected optimisation is only enabled at -O3; with
GCC 12 it is enabled by default. GCC 10 and earlier do not appear to be
affected.)
configure.ac:
Add the above workaround.
Programs using non-local gotos on AArch64 crash when compiled with
newer versions of GCC:
gcc 6.3.0 (Debian 9) - ok
gcc 8.3.0 (Debian 10) - ok
gcc 9.3.0 (Debian 11) - crash
gcc 10.2 (Debian 11) - crash
Specifically, the programs only crash when compiled with PIC,
but PIC is commonly the default now.
This is Mantis bug #560.
configure.ac:
Disable non-local gotos on AArch64 when using GCC 9+.
README.Linux-aarch64:
Mention the problem.
As mentioned recently on the developers list, GCC versions 9 10 and 11 are
emitting suprious warnings with -Warray-bounds for the specialised code they
introduce for strcmp etc. Disable that warning for those versions of GCC. In
addition to this issue, according to the GCC bug database is is generating a
lot of false positives anyway.
configure.ac:
scripts/mgnuc.in:
As above.
In configure, we try detect the non-working combination of gcc 5+,
targeting x86, PIC, and non-local gotos. We assumed that PIC is only
generated when creating shared libraries, but gcc may have been
configured to generate PIC by default. This is very common on more
recent Linux distributions.
configure.ac:
Extend the test mentioned above: if shared libraries are disabled,
check whether gcc generates PIC anyway.
Clean up the code a little.
m4/mercury.m4:
Add helper macros MERCURY_CC_TARGETS_X86 and
MERCURY_CC_GENERATES_PIC.
README.x86:
Update this document.
compiler/mercury_compile_main.m:
I added that option a week or so ago, but at that time, it did nothing.
This diff implements the warning.
library/LIB_FLAGS.in:
Disable the warning for the modules in the library directory.
configure.ac:
Require the installed compiler to recognize the option, since without this,
library/LIBFLAGS won't work.
tests/warnings/profiling_builtin.{m,exp}:
tests/warnings/time.{m,exp}:
tests/warnings/time.subtime.m:
Two test cases for the warning. One, time, shadows the name of
a documented library module, the other, profiling_builtin,
shadows the name an undocumented library module.
The purpose of time.subtime is to test the message when the module name
*contains* a stdlib module name, but is not *identical* to it.
tests/warnings/Mmakefile:
Do *not* turn on the new test cases, but do document why we do not do so.
configure:
Change default value of enable_gc_mmap and enable_gc_munmap to yes.
Invert sense of --enable-gc-mmap and --enable-gc-munmap options in
the help text.
NEWS:
Announce change.
configure.ac:
Use single quotes for quoting in configure script messages.
Using `' results in warnings from autoconf.
Delete a stray comma from the test for GNU make.
as the default for the Mercury system.
configure.ac:
Require the installed compiler to support this option.
browser/MDB_FLAGS.in:
compiler/COMP_FLAGS.in:
deep_profiler/DEEP_FLAGS.in:
grade_lib/GRADE_LIB_FLAGS.in:
library/LIB_FLAGS.in:
mdbcomp/MDBCOMP_FLAGS.in:
mfilterjavac/MFILTERJAVAC_FLAGS.in:
profiler/PROF_FLAGS.in:
slice/SLICE_FLAGS.in:
ssdb/SSDB_FLAGS.in:
Specify this option as the default in their directories.
According to the changelog for autoconf 2.70, many macros have become pickier
about argument quotation. Add quotes to the configure script to avoid these
problems.
Delete unnecessary use of changequote (whose use the autoconf manual recommends
against anyway.)
configure.ac:
As above.
configure.ac:
Require at least autoconf 2.69 (released 2012).
Avoid a warning about an obsolete macro from autoconf 2.70 onwards:
s/AC_HELP_STRING/AS_HELP_/STRING/
configure.ac:
Detect a signal handler being invoked over and over in a loop for a
single SIGSEGV signal; fail the test in that case.
This has been observed on Ubuntu 18.04.5 amd64 (running on a VPS),
when using gcc -m32 to target x86. As far as I understand, this is
not supposed to happen, so it is probably a bug.
configure.ac:
Run the C compiler to check if it actually targets x86-64.
Previously we assumed if $host is x86_64 then the C compiler will be
targeting x86-64, but that is not true if gcc -m32 or gcc -mx32 is
used.
Then, as before, if the C compiler targets x86 and dynamic linking
is enabled (except on Windows) and GCC is version 5+ then disable
selection of any grades that use gcc labels.
runtime/mercury_goto.h:
Report an error if the user tries to use non-local gotos with PIC
on x86 with GCC 5+.
README.x86:
Document the issue.
README.md:
Add reference to README.x86.