This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug ipa/79043] New: Wrong code with optimize(("-fno-strict-aliasing")) and always_inline
- From: "marxin at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 10 Jan 2017 13:39:25 +0000
- Subject: [Bug ipa/79043] New: Wrong code with optimize(("-fno-strict-aliasing")) and always_inline
- Auto-submitted: auto-generated
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79043
Bug ID: 79043
Summary: Wrong code with optimize(("-fno-strict-aliasing")) and
always_inline
Product: gcc
Version: unknown
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: ipa
Assignee: unassigned at gcc dot gnu.org
Reporter: marxin at gcc dot gnu.org
Target Milestone: ---
Following code does not respect -no-strict-aliasing:
$ cat ./gcc/testsuite/gcc.c-torture/execute/alias-2.c
int val;
int *ptr = &val;
float *ptr2 = &val;
static
__attribute__((always_inline, optimize ("-fno-strict-aliasing")))
typepun ()
{
*ptr2=0;
}
main()
{
*ptr=1;
typepun ();
if (*ptr)
__builtin_abort ();
}
$ gcc -O2 ./gcc/testsuite/gcc.c-torture/execute/alias-2.c && ./a.out
Aborted (core dumped)
Discussed in: https://gcc.gnu.org/ml/gcc/2017-01/msg00059.html
I'm testing patch for that.