[BRIGFE] allow controlling strict aliasing from cmd line
authorPekka Jääskeläinen <pekka.jaaskelainen@parmance.com>
Fri, 4 May 2018 17:58:38 +0000 (17:58 +0000)
committerPekka Jääskeläinen <visit0r@gcc.gnu.org>
Fri, 4 May 2018 17:58:38 +0000 (17:58 +0000)
From-SVN: r259948

gcc/brig/ChangeLog
gcc/brig/brig-lang.c

index c68c8dd4757c4f0bf0dc60a149e514b7db3c7b3d..40a715664fd33d0433206edcfec611c7672df8cc 100644 (file)
@@ -1,3 +1,8 @@
+2018-05-04  Pekka Jääskeläinen  <pekka.jaaskelainen@parmance.com>
+
+       * brig/brig-lang.c: Allow controlling strict aliasing from
+       cmd line.
+
 2018-05-04  Pekka Jääskeläinen  <pekka.jaaskelainen@parmance.com>
 
        * brig/brigfrontend/brig-code-entry-handler.cc: The modulo in
index 030d76a745e403ba5ecb913f2afa9aa821c70fc1..58b98fd56a3c76d2aeaac28235c7ba2dcb2a567f 100644 (file)
@@ -167,9 +167,15 @@ brig_langhook_post_options (const char **pfilename ATTRIBUTE_UNUSED)
   if (flag_excess_precision_cmdline == EXCESS_PRECISION_DEFAULT)
     flag_excess_precision_cmdline = EXCESS_PRECISION_STANDARD;
 
-  /* gccbrig casts pointers around like crazy, TBAA produces
-     broken code if not force disabling it.  */
-  flag_strict_aliasing = 0;
+  /* gccbrig casts pointers around like crazy, TBAA might produce broken
+     code if not disabling it by default.  Some PRM conformance tests such
+     as prm/core/memory/ordinary/ld/ld_u16 fail currently with strict
+     aliasing (to fix).  It can be enabled from the command line for cases
+     that are known not to break the C style aliasing requirements.  */
+  if (!global_options_set.x_flag_strict_aliasing)
+    flag_strict_aliasing = 0;
+  else
+    flag_strict_aliasing = global_options.x_flag_strict_aliasing;
 
   /* Returning false means that the backend should be used.  */
   return false;