From: Jan Hubicka Date: Tue, 1 Dec 2015 04:13:26 +0000 (+0100) Subject: ipa-inline-transform.c (inline_call): Drop -fstrict-aliasing when inlining -fno-stric... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=6fa04359f8d9b1ea1d30dafe072b114bef9727a0;p=gcc.git ipa-inline-transform.c (inline_call): Drop -fstrict-aliasing when inlining -fno-strict-aliasing into... * ipa-inline-transform.c (inline_call): Drop -fstrict-aliasing when inlining -fno-strict-aliasing into -fstrict-aliasing body. * gcc.dg/lto/alias-1_0.c: New testcase. * gcc.dg/lto/alias-1_1.c: New testcase. From-SVN: r231094 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index a68582dae91..a1c196251a2 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2015-11-30 Jan Hubicka + + * ipa-inline-transform.c (inline_call): Drop -fstrict-aliasing when + inlining -fno-strict-aliasing into -fstrict-aliasing body. + 2015-11-30 Aditya Kumar Sebastian Pop diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index d3816a259e6..1a86d8779a6 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2015-11-30 Jan Hubicka + + * gcc.dg/lto/alias-1_0.c: New testcase. + * gcc.dg/lto/alias-1_1.c: New testcase. + 2015-11-30 Aditya Kumar Sebastian Pop diff --git a/gcc/testsuite/gcc.dg/lto/alias-1_0.c b/gcc/testsuite/gcc.dg/lto/alias-1_0.c new file mode 100644 index 00000000000..48ef54fd59e --- /dev/null +++ b/gcc/testsuite/gcc.dg/lto/alias-1_0.c @@ -0,0 +1,23 @@ +/* { dg-lto-do run } */ +/* { dg-lto-options { { -O2 -flto } } } */ +int val; + +__attribute__ ((used)) +int *ptr = &val; +__attribute__ ((used)) +float *ptr2 = (void *)&val; + +extern void typefun(float val); + +void link_error (void); + +int +main() +{ + *ptr=1; + typefun (0); + if (*ptr) + __builtin_abort (); + return 0; +} + diff --git a/gcc/testsuite/gcc.dg/lto/alias-1_1.c b/gcc/testsuite/gcc.dg/lto/alias-1_1.c new file mode 100644 index 00000000000..f9e08f3fe27 --- /dev/null +++ b/gcc/testsuite/gcc.dg/lto/alias-1_1.c @@ -0,0 +1,7 @@ +/* { dg-options "-fno-strict-aliasing" } */ +extern float *ptr2; +void +typefun (float val) +{ + *ptr2=val; +}