+2008-11-04 Jakub Jelinek <jakub@redhat.com>
+
+ PR c/37106
+ * c-common.c (parse_optimize_options): Save and restore
+ flag_strict_aliasing around decode_options call.
+
2008-11-04 Uros Bizjak <ubizjak@gmail.com>
* config/i386/driver-i386.c (enum vendor_signatures): New enum.
bool ret = true;
unsigned opt_argc;
unsigned i;
+ int saved_flag_strict_aliasing;
const char **opt_argv;
tree ap;
for (i = 1; i < opt_argc; i++)
opt_argv[i] = VEC_index (const_char_p, optimize_args, i);
+ saved_flag_strict_aliasing = flag_strict_aliasing;
+
/* Now parse the options. */
decode_options (opt_argc, opt_argv);
+ /* Don't allow changing -fstrict-aliasing. */
+ flag_strict_aliasing = saved_flag_strict_aliasing;
+
VEC_truncate (const_char_p, optimize_args, 0);
return ret;
}
+2008-11-04 Jakub Jelinek <jakub@redhat.com>
+
+ PR c/37106
+ * gcc.dg/pr37106-1.c: New test.
+ * gcc.dg/pr37106-2.c: New test.
+
2008-11-03 Chao-ying Fu <fu@mips.com>
* gcc.target/mips/dsp-ctrl.c: New test.
--- /dev/null
+/* PR c/37106 */
+/* { dg-do compile } */
+/* { dg-options "-O1" } */
+/* { dg-options "-O1 -fpic" { target fpic } } */
+
+#define SIZE 256
+float a[SIZE], b[SIZE], c[SIZE];
+
+void opt3 (void) __attribute__((__optimize__(3)));
+
+void
+opt3 (void)
+{
+ int i;
+
+ for (i = 0; i < SIZE; i++)
+ a[i] = b[i] + c[i];
+}
+
+void
+not_opt3 (void)
+{
+ int i;
+
+ for (i = 0; i < SIZE; i++)
+ a[i] = b[i] - c[i];
+}
--- /dev/null
+/* PR c/37106 */
+/* { dg-do compile } */
+/* { dg-options "-O3" } */
+/* { dg-options "-O3 -fpic" { target fpic } } */
+
+#define SIZE 256
+float a[SIZE], b[SIZE], c[SIZE];
+
+void non_opt3 (void) __attribute__((__optimize__(1)));
+
+void
+not_opt3 (void)
+{
+ int i;
+
+ for (i = 0; i < SIZE; i++)
+ a[i] = b[i] - c[i];
+}
+
+void
+opt3 (void)
+{
+ int i;
+
+ for (i = 0; i < SIZE; i++)
+ a[i] = b[i] + c[i];
+}