Commit 9dc39706 by Jan Hubicka Committed by Jan Hubicka

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
parent 8c86248e
2015-12-01 Jan Hubicka <hubicka@ucw.cz> 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. * lto-streamer-out.c (hash_tree): Do not stream TYPE_ALIAS_SET.
* tree-streamer-out.c (pack_ts_type_common_value_fields): Do not * tree-streamer-out.c (pack_ts_type_common_value_fields): Do not
stream TYPE_ALIAS_SET. stream TYPE_ALIAS_SET.
...@@ -9988,7 +9988,6 @@ parse_optimize_options (tree args, bool attr_p) ...@@ -9988,7 +9988,6 @@ parse_optimize_options (tree args, bool attr_p)
bool ret = true; bool ret = true;
unsigned opt_argc; unsigned opt_argc;
unsigned i; unsigned i;
int saved_flag_strict_aliasing;
const char **opt_argv; const char **opt_argv;
struct cl_decoded_option *decoded_options; struct cl_decoded_option *decoded_options;
unsigned int decoded_options_count; unsigned int decoded_options_count;
...@@ -10081,8 +10080,6 @@ parse_optimize_options (tree args, bool attr_p) ...@@ -10081,8 +10080,6 @@ parse_optimize_options (tree args, bool attr_p)
for (i = 1; i < opt_argc; i++) for (i = 1; i < opt_argc; i++)
opt_argv[i] = (*optimize_args)[i]; opt_argv[i] = (*optimize_args)[i];
saved_flag_strict_aliasing = flag_strict_aliasing;
/* Now parse the options. */ /* Now parse the options. */
decode_cmdline_options_to_array_default_mask (opt_argc, opt_argv, decode_cmdline_options_to_array_default_mask (opt_argc, opt_argv,
&decoded_options, &decoded_options,
...@@ -10093,9 +10090,6 @@ parse_optimize_options (tree args, bool attr_p) ...@@ -10093,9 +10090,6 @@ parse_optimize_options (tree args, bool attr_p)
targetm.override_options_after_change(); targetm.override_options_after_change();
/* Don't allow changing -fstrict-aliasing. */
flag_strict_aliasing = saved_flag_strict_aliasing;
optimize_args->truncate (0); optimize_args->truncate (0);
return ret; return ret;
} }
......
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> 2015-12-01 Marek Polacek <polacek@redhat.com>
PR tree-optimization/64769 PR tree-optimization/64769
......
int val;
int *ptr = &val;
float *ptr2 = &val;
__attribute__((optimize ("-fno-strict-aliasing")))
typepun ()
{
*ptr2=0;
}
main()
{
*ptr=1;
typepun ();
if (*ptr)
__builtin_abort ();
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment