diff mbox series

[4/8,BRIGFE] allow controlling strict aliasing from cmd line

Message ID 693f8b5e-e3fe-3ac7-5fc3-4a5e238e1373@parmance.com
State New
Headers show
Series [1/8,BRIGFE] fix an alloca stack underflow | expand

Commit Message

Pekka Jääskeläinen May 4, 2018, 1:59 p.m. UTC
---
  gcc/brig/brig-lang.c | 12 +++++++++---
  1 file changed, 9 insertions(+), 3 deletions(-)

Comments

Pekka Jääskeläinen May 4, 2018, 5:58 p.m. UTC | #1
Committed as r259948.

On Fri, May 4, 2018 at 4:59 PM, Pekka Jääskeläinen <pekka@parmance.com> wrote:
> ---
>  gcc/brig/brig-lang.c | 12 +++++++++---
>  1 file changed, 9 insertions(+), 3 deletions(-)
>
>
diff mbox series

Patch

From c8a86773e877949fb9308d2dd448ea013be22c3e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Pekka=20J=C3=A4=C3=A4skel=C3=A4inen?=
 <pekka.jaaskelainen@parmance.com>
Date: Mon, 12 Feb 2018 11:34:58 +0200
Subject: [PATCH 4/8] [BRIGFE] allow controlling strict aliasing from cmd line

---
 gcc/brig/brig-lang.c | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/gcc/brig/brig-lang.c b/gcc/brig/brig-lang.c
index 030d76a..58b98fd 100644
--- a/gcc/brig/brig-lang.c
+++ b/gcc/brig/brig-lang.c
@@ -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;
-- 
2.7.4