Commit Graph

3 Commits

Author SHA1 Message Date
Zoltan Somogyi
4865f11503 Update programming style. 2020-10-04 13:20:42 +11:00
Zoltan Somogyi
33eb3028f5 Clean up the tests in half the test directories.
tests/accumulator/*.m:
tests/analysis_*/*.m:
tests/benchmarks*/*.m:
tests/debugger*/*.{m,exp,inp}:
tests/declarative_debugger*/*.{m,exp,inp}:
tests/dppd*/*.m:
tests/exceptions*/*.m:
tests/general*/*.m:
tests/grade_subdirs*/*.m:
tests/hard_coded*/*.m:
    Make these tests use four-space indentation, and ensure that
    each module is imported on its own line. (I intend to use the latter
    to figure out which subdirectories' tests can be executed in parallel.)

    These changes usually move code to different lines. For the debugger tests,
    specify the new line numbers in .inp files and expect them in .exp files.
2015-02-14 20:14:03 +11:00
Zoltan Somogyi
eda1cbec07 Work around Mantis bug 160. The bug arises because gcc mishandles this
Estimated hours taken: 6 (mostly in tracking down the problem)
Branches: main

Work around Mantis bug 160. The bug arises because gcc mishandles this
code sequence:

	r1 = mkword(tag, base);
	r2 = tag(r1);

In this case, we know r2 == tag, but gcc screws up the optimization.

compiler/peephole.m:
	Add a peephole optimization pattern that replaces the second assignment
	above with r2 = tag. This should help avoid tickling the gcc bug.

compiler/options.m:
	Add a developer-only option, --no-optimize-peep-mkword, that disables
	the new pattern. The intention is that we can use this to check whether
	gcc has fixed the bug.

compiler/optimize.m:
	Get the value of the new option to peephole.m.

compiler/tag_switch.m:
	Fix some misleading comments that mmc generated for the bug test case
	file.

tests/hard_coded/bug160.{m,exp}:
	The test case for this bug.

tests/hard_coded/Mmakefile:
tests/hard_coded/Mercury.options:
	Enable the test case.
2010-09-10 04:02:30 +00:00