[m-rev.] for review: optimization_options.m

Julien Fischer jfischer at opturion.com
Mon Sep 28 23:43:33 AEST 2020


On Mon, 28 Sep 2020, Zoltan Somogyi wrote:

> 2020-09-28 18:42 GMT+10:00 "Zoltan Somogyi" <zoltan.somogyi at runbox.com>:
>>
>> 2020-09-28 17:06 GMT+10:00 "Zoltan Somogyi" <zoltan.somogyi at runbox.com>:
>>> A related issue is: if an optimization level setting causes an integer option
>>> to be set to e.g. 3, then the current code handles a latter setting of that option
>>> to a higher value just fine (using int.max), but ignores any later setting of that
>>> option to a lower value.
>>>
>>> I will fix this by applying the max *only* to option settings implicit in -O<n>
>>> arguments, not when a specific option is set explicitly. Again, in a separate
>>> diff for further review.
>>
>> Here is that diff, for post-commit review by Peter.
>
> That would work better with actual attachments :-(

Something is broken with this; the stage 2 library no longer builds.
The rotd build just failed with:

gmake: *** [library.o] Error 1
library.c:256:31: error: conflicting type qualifiers for
‘mercury_data_io__type_ctor_info_state_0’
In file included from library.c:140:0:
table_builtin.mh:38:1: note: previous declaration of
‘mercury_data_io__type_ctor_info_state_0’ was here
library.c:282:31: error: conflicting type qualifiers for
‘mercury_data_builtin__type_ctor_info_string_0’
In file included from ../runtime/mercury_type_desc.h:12:0,
                  from construct.mh:30,
                  from library.c:52:
../runtime/mercury_builtin_types.h:44:1: note: previous declaration of
‘mercury_data_builtin__type_ctor_info_string_0’ was here
library.c:284:31: error: conflicting type qualifiers for
‘mercury_data_builtin__type_ctor_info_character_0’
In file included from ../runtime/mercury_type_desc.h:12:0,
                  from construct.mh:30,
                  from library.c:52:
../runtime/mercury_builtin_types.h:48:1: note: previous declaration of
‘mercury_data_builtin__type_ctor_info_character_0’ was here
gmake: *** [library.pic_o] Error 1
mer_std.c:209:31: error: conflicting type qualifiers for
‘mercury_data_io__type_ctor_info_state_0’
In file included from mer_std.c:120:0:
table_builtin.mh:38:1: note: previous declaration of
‘mercury_data_io__type_ctor_info_state_0’ was here
mer_std.c:235:31: error: conflicting type qualifiers for
‘mercury_data_builtin__type_ctor_info_string_0’
In file included from ../runtime/mercury_type_desc.h:12:0,
                  from construct.mh:30,
                  from mer_std.c:48:

I've attached a diff between stage 1 and stage 2 for library/array.c in
asm_fast.gc.  These ought to be the same since stage 1 was built using
yesterday's rotd and this change shouldn't (intentionally) affect which
options are enabled.  A bunch of const qualifiers appear to have gone 
walkabout.

Julien.
-------------- next part --------------
--- library/array.c	2020-09-28 23:24:54.479742481 +1000
+++ stage2/library/array.c	2020-09-28 23:30:41.156520539 +1000
@@ -1,7 +1,7 @@
 /*
 ** Automatically generated from `array.m'
 ** by the Mercury compiler,
-** version rotd-2020-09-27
+** version rotd-2020-09-28
 ** configured for x86_64-pc-linux-gnu.
 ** Do not edit.
 **
@@ -432,7 +432,7 @@
 #endif
 MR_STATIC_LINKAGE const struct mercury_type_16 mercury_common_16[];
 
-extern const MR_TypeCtorInfo_Struct
+extern MR_TypeCtorInfo_Struct
 	mercury_data_array__type_ctor_info_array_1,
 	mercury_data_array__type_ctor_info_index_out_of_bounds_0;
 MR_decl_label9(f_97_114_114_97_121_95_95_84_121_112_101_83_112_101_99_79_102_95_95_112_114_101_100_95_111_114_95_102_117_110_99_95_95_99_111_112_121_95_114_117_110_95_97_115_99_101_110_100_105_110_103_95_95_91_84_32_61_32_105_110_116_93_95_48_95_49_6_0, 4,5,6,7,10,11,3,13,14)
@@ -935,9 +935,9 @@
 MR_def_extern_entry(fn__f_97_114_114_97_121_95_95_84_121_112_101_83_112_101_99_79_102_95_95_112_114_101_100_95_111_114_95_102_117_110_99_95_95_115_111_114_116_95_95_91_84_32_61_32_115_116_114_105_110_103_93_95_48_95_49_1_0)
 MR_def_extern_entry(fn__f_97_114_114_97_121_95_95_84_121_112_101_83_112_101_99_79_102_95_95_112_114_101_100_95_111_114_95_102_117_110_99_95_95_115_111_114_116_95_95_91_84_32_61_32_105_110_116_93_95_48_95_49_1_0)
 
-extern const MR_BaseTypeclassInfo mercury_data_base_typeclass_info_stream__stream__arity2__io__output_stream__arity0__io__state__arity0__[];
-extern const MR_TypeCtorInfo_Struct mercury_data_io__type_ctor_info_output_stream_0;
-extern const MR_TypeCtorInfo_Struct mercury_data_io__type_ctor_info_state_0;
+extern MR_BaseTypeclassInfo mercury_data_base_typeclass_info_stream__stream__arity2__io__output_stream__arity0__io__state__arity0__[];
+extern MR_TypeCtorInfo_Struct mercury_data_io__type_ctor_info_output_stream_0;
+extern MR_TypeCtorInfo_Struct mercury_data_io__type_ctor_info_state_0;
 static const struct mercury_type_0 mercury_common_0[1] =
 {
 {
@@ -949,7 +949,7 @@
 },
 };
 
-extern const MR_BaseTypeclassInfo mercury_data_base_typeclass_info_stream__output__arity2__io__output_stream__arity0__io__state__arity0__[];
+extern MR_BaseTypeclassInfo mercury_data_base_typeclass_info_stream__output__arity2__io__output_stream__arity0__io__state__arity0__[];
 static const struct mercury_type_1 mercury_common_1[1] =
 {
 {
@@ -962,10 +962,10 @@
 },
 };
 
-extern const MR_BaseTypeclassInfo mercury_data_base_typeclass_info_stream__writer__arity3__io__output_stream__arity0__string__arity0__io__state__arity0__[];
-extern const MR_TypeCtorInfo_Struct mercury_data_builtin__type_ctor_info_string_0;
-extern const MR_BaseTypeclassInfo mercury_data_base_typeclass_info_stream__writer__arity3__io__output_stream__arity0__character__arity0__io__state__arity0__[];
-extern const MR_TypeCtorInfo_Struct mercury_data_builtin__type_ctor_info_character_0;
+extern MR_BaseTypeclassInfo mercury_data_base_typeclass_info_stream__writer__arity3__io__output_stream__arity0__string__arity0__io__state__arity0__[];
+extern MR_TypeCtorInfo_Struct mercury_data_builtin__type_ctor_info_string_0;
+extern MR_BaseTypeclassInfo mercury_data_base_typeclass_info_stream__writer__arity3__io__output_stream__arity0__character__arity0__io__state__arity0__[];
+extern MR_TypeCtorInfo_Struct mercury_data_builtin__type_ctor_info_character_0;
 static const struct mercury_type_2 mercury_common_2[2] =
 {
 {
@@ -988,8 +988,8 @@
 },
 };
 
-extern const MR_TypeCtorInfo_Struct mercury_data_list__type_ctor_info_list_1;
-extern const MR_TypeCtorInfo_Struct mercury_data_type_desc__type_ctor_info_type_desc_0;
+extern MR_TypeCtorInfo_Struct mercury_data_list__type_ctor_info_list_1;
+extern MR_TypeCtorInfo_Struct mercury_data_type_desc__type_ctor_info_type_desc_0;
 static const struct mercury_type_3 mercury_common_3[5] =
 {
 {
@@ -1067,7 +1067,7 @@
 
 static const MR_UserClosureId
 mercury_data__closure_layout__array__fetch_items_4_0_1;
-extern const MR_TypeCtorInfo_Struct mercury_data_private_builtin__type_ctor_info_type_info_0;
+extern MR_TypeCtorInfo_Struct mercury_data_private_builtin__type_ctor_info_type_info_0;
 static const struct mercury_type_7 mercury_common_7[1] =
 {
 {
@@ -1083,7 +1083,7 @@
 
 static const MR_UserClosureId
 mercury_data__closure_layout__array__binary_search_3_0_1;
-extern const MR_TypeCtorInfo_Struct mercury_data_builtin__type_ctor_info_comparison_result_0;
+extern MR_TypeCtorInfo_Struct mercury_data_builtin__type_ctor_info_comparison_result_0;
 static const MR_UserClosureId
 mercury_data__closure_layout__array__approx_binary_search_3_0_1;
 static const struct mercury_type_8 mercury_common_8[2] =
@@ -1108,7 +1108,7 @@
 },
 };
 
-extern const MR_TypeCtorInfo_Struct mercury_data_builtin__type_ctor_info_func_0;
+extern MR_TypeCtorInfo_Struct mercury_data_builtin__type_ctor_info_func_0;
 static const struct mercury_type_9 mercury_common_9[1] =
 {
 {
@@ -1205,8 +1205,8 @@
 
 static const MR_UserClosureId
 mercury_data__closure_layout__fn__array__array_to_doc_2_2_0_1;
-extern const MR_TypeCtorInfo_Struct mercury_data_builtin__type_ctor_info_int_0;
-extern const MR_TypeCtorInfo_Struct mercury_data_pretty_printer__type_ctor_info_doc_0;
+extern MR_TypeCtorInfo_Struct mercury_data_builtin__type_ctor_info_int_0;
+extern MR_TypeCtorInfo_Struct mercury_data_pretty_printer__type_ctor_info_doc_0;
 static const MR_UserClosureId
 mercury_data__closure_layout__fn__array__array_to_doc_2_2_0_2;
 static const struct mercury_type_16 mercury_common_16[2] =
@@ -1239,7 +1239,7 @@
 },
 };
 
-const MR_TypeCtorInfo_Struct mercury_data_array__type_ctor_info_array_1 = {
+MR_TypeCtorInfo_Struct mercury_data_array__type_ctor_info_array_1 = {
 	1,
 	17,
 	-1,
@@ -1254,8 +1254,8 @@
 	0,
 	NULL
 };
-extern const MR_TypeCtorInfo_Struct mercury_data_builtin__type_ctor_info_string_0;
-extern const MR_TypeCtorInfo_Struct mercury_data_builtin__type_ctor_info_string_0;
+extern MR_TypeCtorInfo_Struct mercury_data_builtin__type_ctor_info_string_0;
+extern MR_TypeCtorInfo_Struct mercury_data_builtin__type_ctor_info_string_0;
 
 static const MR_NotagFunctorDesc mercury_data_array__notag_functor_desc_index_out_of_bounds_0 = {
 	"index_out_of_bounds",
@@ -1268,7 +1268,7 @@
 	0
 };
 	
-const MR_TypeCtorInfo_Struct mercury_data_array__type_ctor_info_index_out_of_bounds_0 = {
+MR_TypeCtorInfo_Struct mercury_data_array__type_ctor_info_index_out_of_bounds_0 = {
 	0,
 	17,
 	-1,
@@ -14916,7 +14916,7 @@
 MR_END_MODULE
 
 MR_decl_entry(random__random_3_1);
-extern const MR_TypeCtorInfo_Struct mercury_data_exception__type_ctor_info_domain_error_0;
+extern MR_TypeCtorInfo_Struct mercury_data_exception__type_ctor_info_domain_error_0;
 MR_decl_entry(exception__throw_1_0);
 
 MR_BEGIN_MODULE(array_module181)
@@ -26408,7 +26408,7 @@
 #endif
 MR_END_MODULE
 
-extern const MR_TypeCtorInfo_Struct mercury_data_builtin__type_ctor_info_int_0;
+extern MR_TypeCtorInfo_Struct mercury_data_builtin__type_ctor_info_int_0;
 
 MR_BEGIN_MODULE(array_module290)
 	MR_init_entry1(f_97_114_114_97_121_95_95_84_121_112_101_83_112_101_99_79_102_95_95_112_114_101_100_95_111_114_95_102_117_110_99_95_95_109_101_114_103_101_95_115_117_98_97_114_114_97_121_115_95_95_91_84_32_61_32_105_110_116_93_95_48_95_49_8_0);


More information about the reviews mailing list