From: ludo@gnu.org (Ludovic Courtès)
To: guile-devel@gnu.org
Subject: Re: Should we compile Guile with -fno-strict-aliasing?
Date: Fri, 27 Jan 2012 22:02:11 +0100 [thread overview]
Message-ID: <87y5sssvu4.fsf@gnu.org> (raw)
In-Reply-To: 87hazhm0jm.fsf@netris.org
Hi Mark,
Mark H Weaver <mhw@netris.org> skribis:
> Perhaps we should simply add this compiler flag where its available, at
> least in the short term. What do you think?
I’ve been thinking about that too, because on some platforms GCC emits
may-break-strict-aliasing-rules warnings, notably on x86_64-freebsd8.2
with GCC 4.2.1:
--8<---------------cut here---------------start------------->8---
vm.c: In function 'vm_reinstate_partial_continuation':
vm.c:281: warning: dereferencing type-punned pointer will break strict-aliasing rules
In file included from vm-engine.c:127,
from vm.c:467:
vm-i-system.c: In function 'vm_regular_engine':
vm-i-system.c:49: warning: dereferencing type-punned pointer will break strict-aliasing rules
vm-i-system.c:52: warning: dereferencing type-punned pointer will break strict-aliasing rules
vm-i-system.c:53: warning: dereferencing type-punned pointer will break strict-aliasing rules
vm-i-system.c:79: warning: dereferencing type-punned pointer will break strict-aliasing rules
vm-i-system.c:212: warning: dereferencing type-punned pointer will break strict-aliasing rules
vm-i-system.c:225: warning: dereferencing type-punned pointer will break strict-aliasing rules
vm-i-system.c:418: warning: dereferencing type-punned pointer will break strict-aliasing rules
vm-i-system.c:430: warning: dereferencing type-punned pointer will break strict-aliasing rules
vm-i-system.c:445: warning: dereferencing type-punned pointer will break strict-aliasing rules
vm-i-system.c:465: warning: dereferencing type-punned pointer will break strict-aliasing rules
vm-i-system.c:487: warning: dereferencing type-punned pointer will break strict-aliasing rules
vm-i-system.c:528: warning: dereferencing type-punned pointer will break strict-aliasing rules
vm-i-system.c:537: warning: dereferencing type-punned pointer will break strict-aliasing rules
vm-i-system.c:546: warning: dereferencing type-punned pointer will break strict-aliasing rules
vm-i-system.c:556: warning: dereferencing type-punned pointer will break strict-aliasing rules
vm-i-system.c:566: warning: dereferencing type-punned pointer will break strict-aliasing rules
vm-i-system.c:575: warning: dereferencing type-punned pointer will break strict-aliasing rules
vm-i-system.c:923: warning: dereferencing type-punned pointer will break strict-aliasing rules
vm-i-system.c:994: warning: dereferencing type-punned pointer will break strict-aliasing rules
vm-i-system.c:1043: warning: dereferencing type-punned pointer will break strict-aliasing rules
vm-i-system.c:1073: warning: dereferencing type-punned pointer will break strict-aliasing rules
vm-i-system.c:1089: warning: dereferencing type-punned pointer will break strict-aliasing rules
vm-i-system.c:1121: warning: dereferencing type-punned pointer will break strict-aliasing rules
vm-i-system.c:1131: warning: dereferencing type-punned pointer will break strict-aliasing rules
vm-i-system.c:1195: warning: dereferencing type-punned pointer will break strict-aliasing rules
vm-i-system.c:1218: warning: dereferencing type-punned pointer will break strict-aliasing rules
vm-i-system.c:1241: warning: dereferencing type-punned pointer will break strict-aliasing rules
vm-i-system.c:1281: warning: dereferencing type-punned pointer will break strict-aliasing rules
vm-i-system.c:1332: warning: dereferencing type-punned pointer will break strict-aliasing rules
vm-i-system.c:1427: warning: dereferencing type-punned pointer will break strict-aliasing rules
vm-i-system.c:1446: warning: dereferencing type-punned pointer will break strict-aliasing rules
vm-i-system.c:1457: warning: dereferencing type-punned pointer will break strict-aliasing rules
vm-i-system.c:1470: warning: dereferencing type-punned pointer will break strict-aliasing rules
vm-i-system.c:1472: warning: dereferencing type-punned pointer will break strict-aliasing rules
vm-i-system.c:1480: warning: dereferencing type-punned pointer will break strict-aliasing rules
vm-i-system.c:1513: warning: dereferencing type-punned pointer will break strict-aliasing rules
vm-i-system.c:1548: warning: dereferencing type-punned pointer will break strict-aliasing rules
vm-i-system.c:1574: warning: dereferencing type-punned pointer will break strict-aliasing rules
vm-i-system.c:1600: warning: dereferencing type-punned pointer will break strict-aliasing rules
vm-i-system.c:1607: warning: dereferencing type-punned pointer will break strict-aliasing rules
vm-i-system.c:1619: warning: dereferencing type-punned pointer will break strict-aliasing rules
vm-i-system.c:1627: warning: dereferencing type-punned pointer will break strict-aliasing rules
vm-i-system.c:1641: warning: dereferencing type-punned pointer will break strict-aliasing rules
vm-i-system.c:1679: warning: dereferencing type-punned pointer will break strict-aliasing rules
vm-i-system.c:1704: warning: dereferencing type-punned pointer will break strict-aliasing rules
vm-i-system.c:1726: warning: dereferencing type-punned pointer will break strict-aliasing rules
vm-i-system.c:1751: warning: dereferencing type-punned pointer will break strict-aliasing rules
vm-i-system.c:1783: warning: dereferencing type-punned pointer will break strict-aliasing rules
In file included from vm-engine.c:128,
from vm.c:467:
vm-i-scheme.c:192: warning: dereferencing type-punned pointer will break strict-aliasing rules
vm-i-scheme.c:203: warning: dereferencing type-punned pointer will break strict-aliasing rules
vm-i-scheme.c:599: warning: dereferencing type-punned pointer will break strict-aliasing rules
vm-i-scheme.c:624: warning: dereferencing type-punned pointer will break strict-aliasing rules
vm-i-scheme.c:626: warning: dereferencing type-punned pointer will break strict-aliasing rules
vm-i-scheme.c:629: warning: dereferencing type-punned pointer will break strict-aliasing rules
vm-i-scheme.c:692: warning: dereferencing type-punned pointer will break strict-aliasing rules
vm-i-scheme.c:809: warning: dereferencing type-punned pointer will break strict-aliasing rules
vm-i-scheme.c:859: warning: dereferencing type-punned pointer will break strict-aliasing rules
vm-i-scheme.c:861: warning: dereferencing type-punned pointer will break strict-aliasing rules
vm-i-scheme.c:863: warning: dereferencing type-punned pointer will break strict-aliasing rules
vm-i-scheme.c:865: warning: dereferencing type-punned pointer will break strict-aliasing rules
vm-i-scheme.c:867: warning: dereferencing type-punned pointer will break strict-aliasing rules
vm-i-scheme.c:869: warning: dereferencing type-punned pointer will break strict-aliasing rules
vm-i-scheme.c:871: warning: dereferencing type-punned pointer will break strict-aliasing rules
vm-i-scheme.c:873: warning: dereferencing type-punned pointer will break strict-aliasing rules
vm-i-scheme.c:1016: warning: dereferencing type-punned pointer will break strict-aliasing rules
vm-i-scheme.c:1016: warning: dereferencing type-punned pointer will break strict-aliasing rules
vm-i-scheme.c:1018: warning: dereferencing type-punned pointer will break strict-aliasing rules
vm-i-scheme.c:1018: warning: dereferencing type-punned pointer will break strict-aliasing rules
vm-i-scheme.c:1020: warning: dereferencing type-punned pointer will break strict-aliasing rules
vm-i-scheme.c:1020: warning: dereferencing type-punned pointer will break strict-aliasing rules
vm-i-scheme.c:1022: warning: dereferencing type-punned pointer will break strict-aliasing rules
vm-i-scheme.c:1022: warning: dereferencing type-punned pointer will break strict-aliasing rules
vm-i-scheme.c:1024: warning: dereferencing type-punned pointer will break strict-aliasing rules
vm-i-scheme.c:1024: warning: dereferencing type-punned pointer will break strict-aliasing rules
vm-i-scheme.c:1026: warning: dereferencing type-punned pointer will break strict-aliasing rules
vm-i-scheme.c:1026: warning: dereferencing type-punned pointer will break strict-aliasing rules
vm-i-scheme.c:1028: warning: dereferencing type-punned pointer will break strict-aliasing rules
vm-i-scheme.c:1028: warning: dereferencing type-punned pointer will break strict-aliasing rules
vm-i-scheme.c:1030: warning: dereferencing type-punned pointer will break strict-aliasing rules
vm-i-scheme.c:1030: warning: dereferencing type-punned pointer will break strict-aliasing rules
vm-i-scheme.c:1119: warning: dereferencing type-punned pointer will break strict-aliasing rules
vm-i-scheme.c:1121: warning: dereferencing type-punned pointer will break strict-aliasing rules
vm-i-scheme.c:1123: warning: dereferencing type-punned pointer will break strict-aliasing rules
vm-i-scheme.c:1125: warning: dereferencing type-punned pointer will break strict-aliasing rules
vm-i-scheme.c:1128: warning: dereferencing type-punned pointer will break strict-aliasing rules
vm-i-scheme.c:1134: warning: dereferencing type-punned pointer will break strict-aliasing rules
vm-i-scheme.c:1139: warning: dereferencing type-punned pointer will break strict-aliasing rules
vm-i-scheme.c:1141: warning: dereferencing type-punned pointer will break strict-aliasing rules
vm-i-scheme.c:1143: warning: dereferencing type-punned pointer will break strict-aliasing rules
vm-i-scheme.c:1145: warning: dereferencing type-punned pointer will break strict-aliasing rules
In file included from vm-engine.c:129,
from vm.c:467:
vm-i-loader.c:65: warning: dereferencing type-punned pointer will break strict-aliasing rules
vm-i-loader.c:87: warning: dereferencing type-punned pointer will break strict-aliasing rules
vm-i-loader.c:99: warning: dereferencing type-punned pointer will break strict-aliasing rules
In file included from vm-engine.c:127,
from vm.c:475:
vm-i-system.c: In function 'vm_debug_engine':
vm-i-system.c:49: warning: dereferencing type-punned pointer will break strict-aliasing rules
vm-i-system.c:52: warning: dereferencing type-punned pointer will break strict-aliasing rules
vm-i-system.c:53: warning: dereferencing type-punned pointer will break strict-aliasing rules
vm-i-system.c:79: warning: dereferencing type-punned pointer will break strict-aliasing rules
vm-i-system.c:212: warning: dereferencing type-punned pointer will break strict-aliasing rules
vm-i-system.c:225: warning: dereferencing type-punned pointer will break strict-aliasing rules
vm-i-system.c:418: warning: dereferencing type-punned pointer will break strict-aliasing rules
vm-i-system.c:430: warning: dereferencing type-punned pointer will break strict-aliasing rules
vm-i-system.c:445: warning: dereferencing type-punned pointer will break strict-aliasing rules
vm-i-system.c:465: warning: dereferencing type-punned pointer will break strict-aliasing rules
vm-i-system.c:487: warning: dereferencing type-punned pointer will break strict-aliasing rules
vm-i-system.c:528: warning: dereferencing type-punned pointer will break strict-aliasing rules
vm-i-system.c:537: warning: dereferencing type-punned pointer will break strict-aliasing rules
vm-i-system.c:546: warning: dereferencing type-punned pointer will break strict-aliasing rules
vm-i-system.c:556: warning: dereferencing type-punned pointer will break strict-aliasing rules
vm-i-system.c:566: warning: dereferencing type-punned pointer will break strict-aliasing rules
vm-i-system.c:575: warning: dereferencing type-punned pointer will break strict-aliasing rules
vm-i-system.c:923: warning: dereferencing type-punned pointer will break strict-aliasing rules
vm-i-system.c:994: warning: dereferencing type-punned pointer will break strict-aliasing rules
vm-i-system.c:1043: warning: dereferencing type-punned pointer will break strict-aliasing rules
vm-i-system.c:1073: warning: dereferencing type-punned pointer will break strict-aliasing rules
vm-i-system.c:1089: warning: dereferencing type-punned pointer will break strict-aliasing rules
vm-i-system.c:1121: warning: dereferencing type-punned pointer will break strict-aliasing rules
vm-i-system.c:1131: warning: dereferencing type-punned pointer will break strict-aliasing rules
vm-i-system.c:1195: warning: dereferencing type-punned pointer will break strict-aliasing rules
vm-i-system.c:1218: warning: dereferencing type-punned pointer will break strict-aliasing rules
vm-i-system.c:1241: warning: dereferencing type-punned pointer will break strict-aliasing rules
vm-i-system.c:1281: warning: dereferencing type-punned pointer will break strict-aliasing rules
vm-i-system.c:1325: warning: dereferencing type-punned pointer will break strict-aliasing rules
vm-i-system.c:1332: warning: dereferencing type-punned pointer will break strict-aliasing rules
vm-i-system.c:1367: warning: dereferencing type-punned pointer will break strict-aliasing rules
vm-i-system.c:1427: warning: dereferencing type-punned pointer will break strict-aliasing rules
vm-i-system.c:1446: warning: dereferencing type-punned pointer will break strict-aliasing rules
vm-i-system.c:1457: warning: dereferencing type-punned pointer will break strict-aliasing rules
vm-i-system.c:1470: warning: dereferencing type-punned pointer will break strict-aliasing rules
vm-i-system.c:1472: warning: dereferencing type-punned pointer will break strict-aliasing rules
vm-i-system.c:1480: warning: dereferencing type-punned pointer will break strict-aliasing rules
vm-i-system.c:1513: warning: dereferencing type-punned pointer will break strict-aliasing rules
vm-i-system.c:1548: warning: dereferencing type-punned pointer will break strict-aliasing rules
vm-i-system.c:1574: warning: dereferencing type-punned pointer will break strict-aliasing rules
vm-i-system.c:1600: warning: dereferencing type-punned pointer will break strict-aliasing rules
vm-i-system.c:1607: warning: dereferencing type-punned pointer will break strict-aliasing rules
vm-i-system.c:1619: warning: dereferencing type-punned pointer will break strict-aliasing rules
vm-i-system.c:1627: warning: dereferencing type-punned pointer will break strict-aliasing rules
vm-i-system.c:1641: warning: dereferencing type-punned pointer will break strict-aliasing rules
vm-i-system.c:1679: warning: dereferencing type-punned pointer will break strict-aliasing rules
vm-i-system.c:1704: warning: dereferencing type-punned pointer will break strict-aliasing rules
vm-i-system.c:1726: warning: dereferencing type-punned pointer will break strict-aliasing rules
vm-i-system.c:1751: warning: dereferencing type-punned pointer will break strict-aliasing rules
vm-i-system.c:1783: warning: dereferencing type-punned pointer will break strict-aliasing rules
In file included from vm-engine.c:128,
from vm.c:475:
vm-i-scheme.c:192: warning: dereferencing type-punned pointer will break strict-aliasing rules
vm-i-scheme.c:203: warning: dereferencing type-punned pointer will break strict-aliasing rules
vm-i-scheme.c:599: warning: dereferencing type-punned pointer will break strict-aliasing rules
vm-i-scheme.c:624: warning: dereferencing type-punned pointer will break strict-aliasing rules
vm-i-scheme.c:626: warning: dereferencing type-punned pointer will break strict-aliasing rules
vm-i-scheme.c:629: warning: dereferencing type-punned pointer will break strict-aliasing rules
vm-i-scheme.c:692: warning: dereferencing type-punned pointer will break strict-aliasing rules
vm-i-scheme.c:809: warning: dereferencing type-punned pointer will break strict-aliasing rules
vm-i-scheme.c:859: warning: dereferencing type-punned pointer will break strict-aliasing rules
vm-i-scheme.c:861: warning: dereferencing type-punned pointer will break strict-aliasing rules
vm-i-scheme.c:863: warning: dereferencing type-punned pointer will break strict-aliasing rules
vm-i-scheme.c:865: warning: dereferencing type-punned pointer will break strict-aliasing rules
vm-i-scheme.c:867: warning: dereferencing type-punned pointer will break strict-aliasing rules
vm-i-scheme.c:869: warning: dereferencing type-punned pointer will break strict-aliasing rules
vm-i-scheme.c:871: warning: dereferencing type-punned pointer will break strict-aliasing rules
vm-i-scheme.c:873: warning: dereferencing type-punned pointer will break strict-aliasing rules
vm-i-scheme.c:1016: warning: dereferencing type-punned pointer will break strict-aliasing rules
vm-i-scheme.c:1016: warning: dereferencing type-punned pointer will break strict-aliasing rules
vm-i-scheme.c:1018: warning: dereferencing type-punned pointer will break strict-aliasing rules
vm-i-scheme.c:1018: warning: dereferencing type-punned pointer will break strict-aliasing rules
vm-i-scheme.c:1020: warning: dereferencing type-punned pointer will break strict-aliasing rules
vm-i-scheme.c:1020: warning: dereferencing type-punned pointer will break strict-aliasing rules
vm-i-scheme.c:1022: warning: dereferencing type-punned pointer will break strict-aliasing rules
vm-i-scheme.c:1022: warning: dereferencing type-punned pointer will break strict-aliasing rules
vm-i-scheme.c:1024: warning: dereferencing type-punned pointer will break strict-aliasing rules
vm-i-scheme.c:1024: warning: dereferencing type-punned pointer will break strict-aliasing rules
vm-i-scheme.c:1026: warning: dereferencing type-punned pointer will break strict-aliasing rules
vm-i-scheme.c:1026: warning: dereferencing type-punned pointer will break strict-aliasing rules
vm-i-scheme.c:1028: warning: dereferencing type-punned pointer will break strict-aliasing rules
vm-i-scheme.c:1028: warning: dereferencing type-punned pointer will break strict-aliasing rules
vm-i-scheme.c:1030: warning: dereferencing type-punned pointer will break strict-aliasing rules
vm-i-scheme.c:1030: warning: dereferencing type-punned pointer will break strict-aliasing rules
vm-i-scheme.c:1119: warning: dereferencing type-punned pointer will break strict-aliasing rules
vm-i-scheme.c:1121: warning: dereferencing type-punned pointer will break strict-aliasing rules
vm-i-scheme.c:1123: warning: dereferencing type-punned pointer will break strict-aliasing rules
vm-i-scheme.c:1125: warning: dereferencing type-punned pointer will break strict-aliasing rules
vm-i-scheme.c:1128: warning: dereferencing type-punned pointer will break strict-aliasing rules
vm-i-scheme.c:1134: warning: dereferencing type-punned pointer will break strict-aliasing rules
vm-i-scheme.c:1139: warning: dereferencing type-punned pointer will break strict-aliasing rules
vm-i-scheme.c:1141: warning: dereferencing type-punned pointer will break strict-aliasing rules
vm-i-scheme.c:1143: warning: dereferencing type-punned pointer will break strict-aliasing rules
vm-i-scheme.c:1145: warning: dereferencing type-punned pointer will break strict-aliasing rules
In file included from vm-engine.c:129,
from vm.c:475:
vm-i-loader.c:65: warning: dereferencing type-punned pointer will break strict-aliasing rules
vm-i-loader.c:87: warning: dereferencing type-punned pointer will break strict-aliasing rules
vm-i-loader.c:99: warning: dereferencing type-punned pointer will break strict-aliasing rules
--8<---------------cut here---------------end--------------->8---
I’ve just tried on this platform and it seems to fix the threading
issues we were observing (though I won’t claim victory until Hydra
reproduces the success several times in a row ;-)).
It may well be that my recent COMPILER_BARRIER hack can just go away
with this.
I just committed the change.
Thank you!
Ludo’.
next prev parent reply other threads:[~2012-01-27 21:02 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-01-27 19:02 Should we compile Guile with -fno-strict-aliasing? Mark H Weaver
2012-01-27 21:02 ` Ludovic Courtès [this message]
2012-01-29 21:21 ` Ludovic Courtès
2012-01-29 21:02 ` Andy Wingo
2012-01-29 21:10 ` Ludovic Courtès
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/guile/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87y5sssvu4.fsf@gnu.org \
--to=ludo@gnu.org \
--cc=guile-devel@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).