diff options
author | Jan Hubicka <hubicka@ucw.cz> | 2015-12-01 20:14:44 +0100 |
---|---|---|
committer | Jan Hubicka <hubicka@gcc.gnu.org> | 2015-12-01 19:14:44 +0000 |
commit | 9dc39706b4afc31623f28b71150cfd2bdadb2c24 (patch) | |
tree | fcadd30756f38a08b3bd0abee3e26ea755a6efa3 /gcc | |
parent | 8c86248e5830cf6c3c05c8ab851b1e8fe90551d0 (diff) | |
download | gcc-9dc39706b4afc31623f28b71150cfd2bdadb2c24.zip gcc-9dc39706b4afc31623f28b71150cfd2bdadb2c24.tar.gz gcc-9dc39706b4afc31623f28b71150cfd2bdadb2c24.tar.bz2 |
alias-1.c: New testcase.
* gcc.c-torture/execute/alias-1.c: New testcase.
* c-common.c: Do not silently ignore -fstrict-aliasing changes.
From-SVN: r231125
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/c-family/c-common.c | 6 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 4 | ||||
-rw-r--r-- | gcc/testsuite/gcc.c-torture/execute/alias-1.c | 19 |
4 files changed, 28 insertions, 6 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index d5aa3d6..f90b4cd 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,10 @@ 2015-12-01 Jan Hubicka <hubicka@ucw.cz> + * c-common.c (parse_optimize_options): Do not silently ignore + -fstrict-aliasing changes. + +2015-12-01 Jan Hubicka <hubicka@ucw.cz> + * lto-streamer-out.c (hash_tree): Do not stream TYPE_ALIAS_SET. * tree-streamer-out.c (pack_ts_type_common_value_fields): Do not stream TYPE_ALIAS_SET. diff --git a/gcc/c-family/c-common.c b/gcc/c-family/c-common.c index 369574f..7a9e3b9 100644 --- a/gcc/c-family/c-common.c +++ b/gcc/c-family/c-common.c @@ -9988,7 +9988,6 @@ parse_optimize_options (tree args, bool attr_p) bool ret = true; unsigned opt_argc; unsigned i; - int saved_flag_strict_aliasing; const char **opt_argv; struct cl_decoded_option *decoded_options; unsigned int decoded_options_count; @@ -10081,8 +10080,6 @@ parse_optimize_options (tree args, bool attr_p) for (i = 1; i < opt_argc; i++) opt_argv[i] = (*optimize_args)[i]; - saved_flag_strict_aliasing = flag_strict_aliasing; - /* Now parse the options. */ decode_cmdline_options_to_array_default_mask (opt_argc, opt_argv, &decoded_options, @@ -10093,9 +10090,6 @@ parse_optimize_options (tree args, bool attr_p) targetm.override_options_after_change(); - /* Don't allow changing -fstrict-aliasing. */ - flag_strict_aliasing = saved_flag_strict_aliasing; - optimize_args->truncate (0); return ret; } diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index ef5a175..7fd8b55 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2015-12-01 Jan Hubicka <hubicka@ucw.cz> + + * gcc.c-torture/execute/alias-1.c: New testcase. + 2015-12-01 Marek Polacek <polacek@redhat.com> PR tree-optimization/64769 diff --git a/gcc/testsuite/gcc.c-torture/execute/alias-1.c b/gcc/testsuite/gcc.c-torture/execute/alias-1.c new file mode 100644 index 0000000..666e96f --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/execute/alias-1.c @@ -0,0 +1,19 @@ +int val; + +int *ptr = &val; +float *ptr2 = &val; + +__attribute__((optimize ("-fno-strict-aliasing"))) +typepun () +{ + *ptr2=0; +} + +main() +{ + *ptr=1; + typepun (); + if (*ptr) + __builtin_abort (); +} + |