Iain Buclaw avatar Iain Buclaw committed b443310

D2 - default to flag_strict_aliasing.

Comments (0)

Files changed (1)

 #define LANG_HOOKS_PARSE_FILE               d_parse_file
 #define LANG_HOOKS_COMMON_ATTRIBUTE_TABLE   d_common_attribute_table
 #define LANG_HOOKS_FORMAT_ATTRIBUTE_TABLE   d_common_format_attribute_table
-#define LANG_HOOKS_GET_ALIAS_SET            d_hook_get_alias_set
 #define LANG_HOOKS_TYPES_COMPATIBLE_P       d_types_compatible_p
 #define LANG_HOOKS_BUILTIN_FUNCTION         d_builtin_function
 #define LANG_HOOKS_BUILTIN_FUNCTION_EXT_SCOPE d_builtin_function
     opts->frontend_set_flag_errno_math = true;
     // Keep in synch with existing -fbounds-check flag.
-    opts->x_flag_bounds_check = 1;
+    opts->x_flag_bounds_check = global.params.useArrayBounds;
-    // Honour left to right code evaluation
+    // Honour left to right code evaluation.
     opts->x_flag_evaluation_order = 1;
+#if V2
+    // Default to using strict aliasing.
+    opts->x_flag_strict_aliasing = 1;
 /* Return language mask for option parsing.  */
     // Honour left to right code evaluation.
     flag_evaluation_order = 1;
+#if V2
+    // Default to using strict aliasing.
+    flag_strict_aliasing = 1;
     // extra D-specific options
     gen.splitDynArrayVarArgs = true;
     gen.emitTemplates = TEnormal;
     emit_debug_global_declarations(vec, globalDeclarations.dim);
-// Some phobos code (isnormal, etc.) breaks with strict aliasing...
-// so I guess D doesn't have aliasing rules.  Would be nice to enable
-// strict aliasing, but hooking or defaulting flag_strict_aliasing is
-// not trivial
-static alias_set_type
-    return 0;
 /* Gimplification of expression trees.  */
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.