From: Jan Hubicka Date: Wed, 18 Jun 2008 19:07:51 +0000 (+0200) Subject: c-opts.c (c_common_post_options): PCH is not compatible with no-unit-at-a-time. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=a7bf199e10bfe7a3ce99d86421632711de48bcc3;p=gcc.git c-opts.c (c_common_post_options): PCH is not compatible with no-unit-at-a-time. * c-opts.c (c_common_post_options): PCH is not compatible with no-unit-at-a-time. * opts.c (handle_options): Enable unit-at-a-time at O0 along with -fno-toplevel-reorder by default now. * gcc.dg/weak/weak-2.c: We no longer complain about incompatibilty. * gcc.dg/weak/weak-3.c: We no longer complain about incompatibilty. * gcc.dg/weak/weak-4.c: We no longer complain about incompatibilty. * gcc.dg/weak/weak-5.c: We no longer complain about incompatibilty. * gcc.dg/weak/weak-6.c: Fix thinko in previous change. * gcc.dg/weak/weak-7.c: Likewise. From-SVN: r136903 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index be29e2d94a6..a86d857d55e 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2008-06-18 Jan Hubicka + + * c-opts.c (c_common_post_options): PCH is not compatible with + no-unit-at-a-time. + * opts.c (handle_options): Enable unit-at-a-time at O0 along with + -fno-toplevel-reorder by default now. + 2008-06-18 Ralf Wildenhues PR documentation/30739 diff --git a/gcc/c-opts.c b/gcc/c-opts.c index 2eef789978d..33d0e6bed26 100644 --- a/gcc/c-opts.c +++ b/gcc/c-opts.c @@ -1038,6 +1038,9 @@ c_common_post_options (const char **pfilename) if (num_in_fnames > 1) flag_unit_at_a_time = 1; + if (pch_file && !flag_unit_at_a_time) + sorry ("Precompiled headers require -funit-at-a-time"); + /* Default to ObjC sjlj exception handling if NeXT runtime. */ if (flag_objc_sjlj_exceptions < 0) flag_objc_sjlj_exceptions = flag_next_runtime; diff --git a/gcc/opts.c b/gcc/opts.c index 4a6d440bc1b..6d6d380fdb7 100644 --- a/gcc/opts.c +++ b/gcc/opts.c @@ -822,6 +822,13 @@ decode_options (unsigned int argc, const char **argv) flag_merge_constants = 0; } + if (!no_unit_at_a_time_default) + { + flag_unit_at_a_time = 1; + if (!optimize) + flag_toplevel_reorder = 0; + } + if (optimize >= 1) { flag_defer_pop = 1; @@ -848,8 +855,6 @@ decode_options (unsigned int argc, const char **argv) flag_tree_fre = 1; flag_tree_copy_prop = 1; flag_tree_sink = 1; - if (!no_unit_at_a_time_default) - flag_unit_at_a_time = 1; if (!optimize_size) { diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 6d2a7952d4c..bf4c5b93185 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,12 @@ +2008-06-16 Jan Hubicka + + * gcc.dg/weak/weak-2.c: We no longer complain about incompatibilty. + * gcc.dg/weak/weak-3.c: We no longer complain about incompatibilty. + * gcc.dg/weak/weak-4.c: We no longer complain about incompatibilty. + * gcc.dg/weak/weak-5.c: We no longer complain about incompatibilty. + * gcc.dg/weak/weak-6.c: Fix thinko in previous change. + * gcc.dg/weak/weak-7.c: Likewise. + 2008-06-16 Jan Hubicka * gcc.dg/asm-wide-1.c: Do not require extra errors we output diff --git a/gcc/testsuite/gcc.dg/weak/weak-2.c b/gcc/testsuite/gcc.dg/weak/weak-2.c index 7f9cde5d095..973f4c216b6 100644 --- a/gcc/testsuite/gcc.dg/weak/weak-2.c +++ b/gcc/testsuite/gcc.dg/weak/weak-2.c @@ -24,7 +24,7 @@ void * foo1b (void) return (void *)ffoo1b; } -extern void * ffoo1c (void); /* { dg-warning "applying #pragma weak" "applying #pragma weak" } */ +extern void * ffoo1c (void); void * foo1c (void) { return (void *)ffoo1c; diff --git a/gcc/testsuite/gcc.dg/weak/weak-3.c b/gcc/testsuite/gcc.dg/weak/weak-3.c index 21e5fa09c28..748bd236cc5 100644 --- a/gcc/testsuite/gcc.dg/weak/weak-3.c +++ b/gcc/testsuite/gcc.dg/weak/weak-3.c @@ -34,7 +34,7 @@ void * foo1c (void) { return (void *)ffoo1c; } -extern void * ffoo1c (void) __attribute__((weak)); /* { dg-warning "weak declaration" "weak declaration" } */ +extern void * ffoo1c (void) __attribute__((weak)); int ffoo1d (void); @@ -59,7 +59,7 @@ void * foo1f (void) return 0; } void * ffoox1f (void) { return (void *)0; } -extern void * ffoo1f (void) __attribute__((weak, alias ("ffoox1f"))); /* { dg-warning "weak declaration" "weak declaration" } */ +extern void * ffoo1f (void) __attribute__((weak, alias ("ffoox1f"))); extern void * ffoo1g (void); diff --git a/gcc/testsuite/gcc.dg/weak/weak-4.c b/gcc/testsuite/gcc.dg/weak/weak-4.c index 622a1c6675e..cd8a1e9124d 100644 --- a/gcc/testsuite/gcc.dg/weak/weak-4.c +++ b/gcc/testsuite/gcc.dg/weak/weak-4.c @@ -32,7 +32,7 @@ void * foo1b (void) } -extern int vfoo1c; /* { dg-warning "applying #pragma weak" "applying #pragma weak" } */ +extern int vfoo1c; void * foo1c (void) { return (void *)&vfoo1c; @@ -64,7 +64,7 @@ void * foo1f (void) #pragma weak vfoo1f -extern int vfoo1g; /* { dg-warning "applying #pragma weak" "applying #pragma weak" } */ +extern int vfoo1g; void * foo1g (void) { return (void *)&vfoo1g; diff --git a/gcc/testsuite/gcc.dg/weak/weak-5.c b/gcc/testsuite/gcc.dg/weak/weak-5.c index a8aca287544..e82792af3ff 100644 --- a/gcc/testsuite/gcc.dg/weak/weak-5.c +++ b/gcc/testsuite/gcc.dg/weak/weak-5.c @@ -39,7 +39,7 @@ void * foo1c (void) { return (void *)&vfoo1c; } -extern int vfoo1c __attribute__((weak)); /* { dg-warning "unspecified behavior" } */ +extern int vfoo1c __attribute__((weak)); extern int vfoo1d __attribute__((weak)); @@ -63,7 +63,7 @@ void * foo1f (void) { return (void *)&vfoo1f; } -extern int vfoo1f __attribute__((weak)); /* { dg-warning "unspecified behavior" } */ +extern int vfoo1f __attribute__((weak)); extern int vfoo1g; @@ -71,7 +71,7 @@ void * foo1g (void) { return (void *)&vfoo1g; } -int vfoo1g __attribute__((weak)); /* { dg-warning "unspecified behavior" } */ +int vfoo1g __attribute__((weak)); extern int vfoo1h __attribute__((weak)); diff --git a/gcc/testsuite/gcc.dg/weak/weak-6.c b/gcc/testsuite/gcc.dg/weak/weak-6.c index 3a660f71ba6..6fa0d66ff2d 100644 --- a/gcc/testsuite/gcc.dg/weak/weak-6.c +++ b/gcc/testsuite/gcc.dg/weak/weak-6.c @@ -2,5 +2,6 @@ /* { dg-require-weak "" } */ extern void * foo (void); -void * foo (void) { return (void *)foo; } /* { dg-error "precede" } */ +void * foo (void) { return (void *)foo; } +/* { dg-error "function pointer" "pointer conversion" { target *-*-* } 5 } */ #pragma weak foo diff --git a/gcc/testsuite/gcc.dg/weak/weak-7.c b/gcc/testsuite/gcc.dg/weak/weak-7.c index 031f830783f..07c03bc975a 100644 --- a/gcc/testsuite/gcc.dg/weak/weak-7.c +++ b/gcc/testsuite/gcc.dg/weak/weak-7.c @@ -2,5 +2,6 @@ /* { dg-require-weak "" } */ extern void * foo (void); -void * foo (void) { return (void *)foo; } /* { dg-error "precede" } */ +void * foo (void) { return (void *)foo; } +/* { dg-error "function pointer" "pointer conversion" { target *-*-* } 5 } */ extern void * foo (void) __attribute__((weak));