Paul Bone
3452e25fd6
Improve tail call warnings for the low level C grade.
...
This patch reduces spurious tail call warnings by warning only for the last
of a sequence of recursive calls along an execution path, for example it
no-longer emits a warning for the first of the two recursive calls in
quicksort. I have already made a change to this effect for the MLDS
backends.
This patch also implements the new the require_tail_recursion pragma. This
change has already been made for the MLDS backends.
The require_tail_recursion pragma does not yet handle mutual recursion or
raise an error if the code is not recursive at all. These will be my next
tasks.
compiler/mark_tail_calls.m:
Combine marking tail calls with warning about tail calls.
Handle scopes more accurately.
compiler/mercury_compile_llds_back_end.m:
Conform to changes in mark_tail_calls.m
No longer warn for tail calls, this is now done in the same pass that
marks tail calls. The decision to run this pass is now made on a
per-procedure basis and in mark_tail_calls.m
tests/invalid/require_tailrec_1.m:
tests/invalid/require_tailrec_2.m:
tests/invalid/Mmakefile:
tests/invalid/Mercury.options:
tests/valid/require_tailrec_1.m:
tests/valid/require_tailrec_2.m:
tests/valid/Mmakefile:
tests/valid/Mercury.options:
Add new tests.
tests/invalid/Mmakefile:
tests/invalid/Mercury.options:
tests/invalid/require_tail_recursion.{m,err_exp} ->
require_tailrec_invalid.{m,exp}:
Rename existing test.
2015-12-16 22:47:08 +11:00
..
2015-12-14 18:38:06 +11:00
2015-11-16 21:13:04 +11:00
2015-11-28 07:46:33 +11:00
2015-11-28 07:46:33 +11:00
2015-12-02 18:46:14 +11:00
2015-11-28 07:46:33 +11:00
2015-11-19 21:41:37 +11:00
2015-12-07 08:30:56 +11:00
2015-11-30 03:36:32 +11:00
2015-11-28 07:46:33 +11:00
2015-11-28 07:46:33 +11:00
2015-12-14 11:36:43 +11:00
2015-11-28 07:46:33 +11:00
2015-10-29 14:13:46 +11:00
2015-12-05 06:33:48 +11:00
2015-11-19 21:41:37 +11:00
2015-10-29 14:13:46 +11:00
2015-11-19 21:41:37 +11:00
2015-11-19 21:41:37 +11:00
2015-11-13 15:03:20 +11:00
2015-10-25 09:17:21 +11:00
2015-11-13 15:03:20 +11:00
2015-10-25 08:17:42 +11:00
2015-11-06 20:52:25 +11:00
2015-11-13 15:03:20 +11:00
2015-10-25 09:17:21 +11:00
2015-11-13 15:03:20 +11:00
2015-11-16 00:09:26 +11:00
2015-10-19 10:49:44 +11:00
2015-11-13 15:03:20 +11:00
2015-12-14 10:36:00 +11:00
2015-12-14 10:36:00 +11:00
2015-12-14 10:36:00 +11:00
2015-11-13 15:03:20 +11:00
2015-12-02 18:46:14 +11:00
2015-11-28 07:46:33 +11:00
2015-11-13 15:03:20 +11:00
2015-09-21 18:18:25 +10:00
2015-12-02 18:46:14 +11:00
2015-11-16 00:09:26 +11:00
2015-12-02 18:46:14 +11:00
2015-09-21 18:18:25 +10:00
2015-11-06 20:52:25 +11:00
2015-12-14 11:36:43 +11:00
2015-12-09 20:25:14 +11:00
2015-12-11 09:01:26 +11:00
2015-11-13 15:03:20 +11:00
2015-10-17 23:09:22 +11:00
2015-11-13 15:03:20 +11:00
2015-11-13 15:03:20 +11:00
2015-11-13 15:03:20 +11:00
2015-12-06 09:49:53 +11:00
2015-11-16 21:13:04 +11:00
2015-12-02 18:46:14 +11:00
2015-11-13 15:03:20 +11:00
2015-11-13 15:03:20 +11:00
2015-11-13 15:03:20 +11:00
2015-11-13 15:03:20 +11:00
2015-12-06 14:16:41 +11:00
2015-12-14 11:36:43 +11:00
2015-12-03 02:00:54 +11:00
2015-11-13 15:03:20 +11:00
2015-11-13 15:03:20 +11:00
2015-12-02 08:08:17 +11:00
2015-11-06 20:52:25 +11:00
2015-09-21 05:47:55 +10:00
2015-09-21 18:18:25 +10:00
2015-12-02 18:46:14 +11:00
2015-11-13 15:03:20 +11:00
2015-11-18 00:40:05 +11:00
2015-11-18 00:40:05 +11:00
2015-12-13 13:10:54 +11:00
2015-11-13 15:03:20 +11:00
2015-11-16 21:13:04 +11:00
2015-10-18 06:57:19 +11:00
2015-09-21 05:47:55 +10:00
2015-09-21 05:47:55 +10:00
2015-11-13 15:03:20 +11:00
2015-11-13 15:03:20 +11:00
2015-12-03 05:06:28 +11:00
2015-12-14 11:36:43 +11:00
2015-11-13 15:03:20 +11:00
2015-11-13 15:03:20 +11:00
2015-11-16 21:13:04 +11:00
2015-11-13 15:03:20 +11:00
2015-11-13 15:03:20 +11:00
2015-11-13 15:03:20 +11:00
2015-12-12 12:48:32 +11:00
2015-12-02 18:46:14 +11:00
2015-12-02 18:46:14 +11:00
2015-09-21 11:34:46 +10:00
2015-12-05 06:36:14 +11:00
2015-12-04 11:07:01 +11:00
2015-10-20 21:53:36 +11:00
2015-11-13 15:03:20 +11:00
2015-12-16 10:03:46 +11:00
2015-11-16 21:14:17 +11:00
2015-11-13 15:03:20 +11:00
2015-11-13 15:03:20 +11:00
2015-09-30 15:26:28 +10:00
2015-11-16 21:13:04 +11:00
2015-09-21 05:47:55 +10:00
2015-12-02 18:46:14 +11:00
2015-11-13 15:03:20 +11:00
2015-12-14 11:36:43 +11:00
2015-11-13 15:03:20 +11:00
2015-12-03 05:06:28 +11:00
2015-12-02 18:46:14 +11:00
2015-11-13 15:03:20 +11:00
2015-11-16 00:09:26 +11:00
2015-11-13 15:03:20 +11:00
2015-12-13 13:10:54 +11:00
2015-11-13 15:03:20 +11:00
2015-10-18 08:59:10 +11:00
2015-12-12 12:21:46 +11:00
2015-11-13 15:03:20 +11:00
2015-11-13 15:03:20 +11:00
2015-11-28 07:46:33 +11:00
2015-12-02 18:46:14 +11:00
2015-11-28 07:46:33 +11:00
2015-11-16 21:13:04 +11:00
2015-11-13 15:03:20 +11:00
2015-11-13 15:03:20 +11:00
2015-11-13 15:03:20 +11:00
2015-11-13 15:03:20 +11:00
2015-12-06 09:49:53 +11:00
2015-12-02 18:46:14 +11:00
2015-12-03 05:06:28 +11:00
2015-12-06 09:49:53 +11:00
2015-12-12 16:03:50 +11:00
2015-11-16 00:09:26 +11:00
2015-12-14 11:36:43 +11:00
2015-12-07 08:30:56 +11:00
2015-12-14 11:36:43 +11:00
2015-12-06 11:03:46 +11:00
2015-11-13 15:03:20 +11:00
2015-11-30 03:36:32 +11:00
2015-10-18 06:57:19 +11:00
2015-12-06 14:16:41 +11:00
2015-11-16 00:09:26 +11:00
2015-11-13 15:03:20 +11:00
2015-12-15 21:38:27 +11:00
2015-11-16 21:13:04 +11:00
2015-10-17 23:09:22 +11:00
2015-12-03 05:06:28 +11:00
2015-11-16 21:13:04 +11:00
2015-10-25 09:17:21 +11:00
2015-12-14 11:36:43 +11:00
2015-11-06 20:52:25 +11:00
2015-11-13 15:03:20 +11:00
2015-11-13 15:03:20 +11:00
2015-12-14 11:36:43 +11:00
2015-10-25 09:17:21 +11:00
2015-11-13 15:03:20 +11:00
2015-12-06 09:49:53 +11:00
2015-09-21 05:47:55 +10:00
2015-11-13 15:03:20 +11:00
2015-11-13 15:03:20 +11:00
2015-11-13 15:03:20 +11:00
2015-12-02 18:46:14 +11:00
2015-10-17 23:09:22 +11:00
2015-11-13 15:03:20 +11:00
2015-10-26 00:06:53 +11:00
2015-11-16 00:09:26 +11:00
2015-11-13 15:03:20 +11:00
2015-11-13 15:03:20 +11:00
2015-11-13 15:03:20 +11:00
2015-11-13 15:03:20 +11:00
2015-12-10 10:38:21 +11:00
2015-11-13 15:03:20 +11:00
2015-12-10 10:38:21 +11:00
2015-12-10 10:38:21 +11:00
2015-12-02 18:46:14 +11:00
2015-11-16 00:09:26 +11:00
2015-11-13 15:03:20 +11:00
2015-11-16 00:09:26 +11:00
2015-12-02 18:46:14 +11:00
2015-09-25 10:11:10 +10:00
2015-11-16 21:13:04 +11:00
2015-11-13 15:03:20 +11:00
2015-12-02 18:46:14 +11:00
2015-12-14 11:36:43 +11:00
2015-11-22 03:20:37 +11:00
2015-11-13 15:03:20 +11:00
2015-11-16 00:09:26 +11:00
2015-12-06 09:49:53 +11:00
2015-11-13 15:03:20 +11:00
2015-10-21 15:02:19 +11:00
2015-10-13 03:24:49 +11:00
2015-12-02 18:46:14 +11:00
2015-12-02 18:46:14 +11:00
2015-10-28 12:41:16 +11:00
2015-12-16 22:47:08 +11:00
2015-12-06 09:49:53 +11:00
2015-10-07 00:44:14 +11:00
2015-12-12 16:03:50 +11:00
2015-11-13 15:03:20 +11:00
2015-12-14 18:38:06 +11:00
2015-12-16 22:47:08 +11:00
2015-12-11 23:05:10 +11:00
2015-12-08 22:54:59 +11:00
2015-12-08 22:54:59 +11:00
2015-11-16 00:09:26 +11:00
2015-10-16 15:03:03 +11:00
2015-09-21 18:18:25 +10:00
2015-12-02 18:46:14 +11:00
2015-11-13 15:03:20 +11:00
2015-11-13 15:03:20 +11:00
2015-12-06 09:49:53 +11:00
2015-12-02 18:46:14 +11:00
2015-12-08 22:54:59 +11:00
2015-11-13 15:03:20 +11:00
2015-11-13 15:03:20 +11:00
2015-12-08 22:54:59 +11:00
2015-12-06 09:49:53 +11:00
2015-11-13 15:03:20 +11:00
2015-11-13 15:03:20 +11:00
2015-11-13 15:03:20 +11:00
2015-12-08 22:54:59 +11:00
2015-12-08 22:54:59 +11:00
2015-11-13 15:03:20 +11:00
2015-11-16 00:09:26 +11:00
2015-11-13 15:03:20 +11:00
2015-11-13 15:03:20 +11:00
2015-12-08 22:54:59 +11:00
2015-11-13 15:03:20 +11:00
2015-12-08 22:54:59 +11:00
2015-11-13 15:03:20 +11:00
2015-12-08 22:54:59 +11:00
2015-12-12 16:03:50 +11:00
2015-12-10 10:38:21 +11:00
2015-12-10 10:38:21 +11:00
2015-12-08 22:54:59 +11:00
2015-09-23 11:13:00 +10:00
2015-11-13 15:03:20 +11:00
2015-12-02 18:46:14 +11:00
2015-10-18 08:21:53 +11:00
2015-12-12 16:03:50 +11:00
2015-12-05 06:33:48 +11:00
2015-12-02 18:46:14 +11:00
2015-12-02 18:46:14 +11:00
2015-12-02 18:46:14 +11:00
2015-12-02 18:46:14 +11:00
2015-12-02 18:46:14 +11:00
2015-12-02 18:46:14 +11:00
2015-12-02 18:46:14 +11:00
2015-12-12 16:03:50 +11:00
2015-12-03 05:06:28 +11:00
2015-12-05 06:33:48 +11:00
2015-12-05 06:33:48 +11:00
2015-12-03 05:06:28 +11:00
2015-12-05 06:33:48 +11:00
2015-12-03 05:06:28 +11:00
2015-11-13 15:03:20 +11:00
2015-11-13 15:03:20 +11:00
2015-12-02 18:46:14 +11:00
2015-11-16 19:23:11 +11:00
2015-11-21 21:41:26 +11:00
2015-12-14 11:36:43 +11:00
2015-12-14 11:36:43 +11:00
2015-11-16 00:09:26 +11:00
2015-11-04 01:51:11 +11:00
2015-11-04 01:51:11 +11:00
2015-11-22 01:55:19 +11:00
2015-11-13 15:03:20 +11:00
2015-09-21 05:47:55 +10:00
2015-11-13 15:03:20 +11:00
2015-12-06 09:49:53 +11:00
2015-12-11 23:05:10 +11:00
2015-11-13 15:03:20 +11:00
2015-11-16 21:13:04 +11:00
2015-11-13 15:03:20 +11:00
2015-10-23 11:15:53 +11:00
2015-11-28 07:46:33 +11:00
2015-11-13 15:03:20 +11:00
2015-12-12 12:45:59 +11:00
2015-12-14 11:36:43 +11:00
2015-12-12 12:45:59 +11:00
2015-11-16 00:09:26 +11:00
2015-12-12 12:45:59 +11:00
2015-11-22 00:34:50 +11:00
2015-11-13 15:03:20 +11:00
2015-11-13 15:03:20 +11:00
2015-11-13 15:03:20 +11:00
2015-11-13 15:03:20 +11:00
2015-11-13 15:03:20 +11:00
2015-11-21 05:09:50 +11:00
2015-09-21 05:47:55 +10:00
2015-11-10 21:50:27 +11:00
2015-12-02 18:46:14 +11:00
2015-12-02 18:46:14 +11:00
2015-12-03 05:06:28 +11:00
2015-12-15 21:38:27 +11:00
2015-11-13 15:03:20 +11:00
2015-12-06 14:16:41 +11:00
2015-11-16 00:09:26 +11:00
2015-10-23 08:57:28 +11:00
2015-11-15 04:17:24 +11:00
2015-12-11 16:35:59 +11:00
2015-11-13 15:03:20 +11:00
2015-12-02 18:46:14 +11:00
2015-10-21 15:02:19 +11:00
2015-11-28 07:46:33 +11:00
2015-11-22 00:34:50 +11:00
2015-12-02 18:46:14 +11:00
2015-12-02 18:46:14 +11:00
2015-11-26 07:35:39 +11:00
2015-12-14 11:36:43 +11:00
2015-11-28 07:46:33 +11:00
2015-12-05 06:33:48 +11:00
2015-11-26 07:35:39 +11:00
2015-11-26 07:35:39 +11:00
2015-12-02 18:46:14 +11:00
2015-12-14 11:36:43 +11:00
2015-12-14 13:55:17 +11:00
2015-11-16 21:13:04 +11:00
2015-10-23 08:57:28 +11:00
2015-11-13 15:03:20 +11:00
2015-11-16 18:14:27 +11:00
2015-10-23 08:57:28 +11:00
2015-11-13 15:03:20 +11:00
2015-11-22 03:20:37 +11:00
2015-10-18 08:21:53 +11:00
2015-12-14 10:36:00 +11:00
2015-11-13 15:03:20 +11:00
2015-10-28 12:41:16 +11:00
2015-11-13 15:03:20 +11:00
2015-12-02 18:46:14 +11:00
2015-11-16 19:23:11 +11:00
2015-11-13 15:03:20 +11:00
2015-09-21 05:47:55 +10:00
2015-11-03 17:22:38 +11:00
2015-11-13 15:03:20 +11:00
2015-11-16 21:13:04 +11:00
2015-12-14 11:36:43 +11:00
2015-12-14 18:38:06 +11:00
2015-11-13 15:03:20 +11:00
2015-11-13 15:03:20 +11:00
2015-11-16 00:09:26 +11:00
2015-11-13 15:03:20 +11:00
2015-12-02 18:46:14 +11:00
2015-12-13 13:10:54 +11:00
2015-12-13 13:10:54 +11:00
2015-12-13 13:10:54 +11:00
2015-12-13 13:10:54 +11:00
2015-12-13 13:10:54 +11:00
2015-10-16 17:18:34 +11:00
2015-10-16 17:18:34 +11:00
2015-12-13 13:10:54 +11:00
2015-12-13 13:10:54 +11:00
2015-10-16 17:18:34 +11:00
2015-11-13 15:03:20 +11:00
2015-12-03 05:06:28 +11:00
2015-11-13 15:03:20 +11:00
2015-12-03 05:06:28 +11:00
2015-12-02 18:46:14 +11:00
2015-11-17 04:12:47 +11:00
2015-11-15 16:52:14 +11:00
2015-11-13 15:03:20 +11:00
2015-11-15 16:52:14 +11:00
2015-11-15 23:13:02 +11:00
2015-12-12 16:03:50 +11:00
2015-09-21 05:47:55 +10:00
2015-11-20 23:32:27 +11:00
2015-11-15 16:52:14 +11:00
2015-10-23 13:47:56 +11:00
2015-09-21 11:34:46 +10:00
2015-11-13 15:03:20 +11:00
2015-11-13 15:03:20 +11:00
2015-12-02 18:46:14 +11:00
2015-11-13 15:03:20 +11:00
2015-11-13 15:03:20 +11:00
2015-12-06 14:16:41 +11:00
2015-11-13 15:03:20 +11:00
2015-11-13 15:03:20 +11:00
2015-11-13 15:03:20 +11:00
2015-11-13 15:03:20 +11:00
2015-11-13 15:03:20 +11:00
2015-11-13 15:03:20 +11:00
2015-12-06 14:16:41 +11:00
2015-11-13 15:03:20 +11:00
2015-12-05 06:36:14 +11:00
2015-11-16 00:09:26 +11:00
2015-12-13 13:10:54 +11:00
2015-11-13 15:03:20 +11:00
2015-10-03 11:43:29 +10:00
2015-12-14 11:36:43 +11:00
2015-11-16 00:09:26 +11:00
2015-11-13 15:03:20 +11:00
2015-11-13 15:03:20 +11:00
2015-11-13 15:03:20 +11:00
2015-12-03 05:06:28 +11:00
2015-11-13 15:03:20 +11:00
2015-12-03 05:06:28 +11:00
2015-11-13 15:03:20 +11:00
2015-11-13 15:03:20 +11:00
2015-11-13 15:03:20 +11:00
2015-11-13 15:03:20 +11:00
2015-12-02 18:46:14 +11:00
2015-11-13 15:03:20 +11:00
2015-11-13 15:03:20 +11:00
2015-11-13 15:03:20 +11:00
2015-11-13 15:03:20 +11:00
2015-12-05 06:33:48 +11:00
2015-12-03 05:06:28 +11:00
2015-11-17 04:12:47 +11:00
2015-11-13 15:03:20 +11:00
2015-11-13 15:03:20 +11:00
2015-12-03 05:06:28 +11:00
2015-12-06 09:47:04 +11:00
2015-11-13 15:03:20 +11:00
2015-11-17 04:12:47 +11:00
2015-11-13 15:03:20 +11:00
2015-11-20 23:32:27 +11:00
2015-11-17 04:12:47 +11:00
2015-12-06 14:16:41 +11:00
2015-11-17 04:12:47 +11:00
2015-11-17 04:12:47 +11:00
2015-10-08 21:41:35 +11:00
2015-12-03 05:06:28 +11:00
2015-12-06 14:16:41 +11:00
2015-12-02 18:46:14 +11:00
2015-12-06 14:16:41 +11:00
2015-12-06 14:16:41 +11:00
2015-12-02 18:46:14 +11:00
2015-12-13 22:03:30 +11:00
2015-11-17 04:12:47 +11:00
2015-11-13 15:03:20 +11:00
2015-12-06 14:16:41 +11:00
2015-11-13 15:03:20 +11:00
2015-12-02 18:46:14 +11:00
2015-09-21 05:47:55 +10:00
2015-11-13 15:03:20 +11:00
2015-11-13 15:03:20 +11:00
2015-09-21 05:47:55 +10:00
2015-12-06 09:49:53 +11:00
2015-12-14 11:36:43 +11:00
2015-12-02 18:46:14 +11:00