+2013-02-18 Jakub Jelinek <jakub@redhat.com>
+ Steven Bosscher <steven@gcc.gnu.org>
+
+ PR pch/54117
+ * c-opts.c (c_common_post_options): If debug info is enabled
+ and non-dwarf*, refuse to load PCH files and when writing PCH
+ file warn.
+
2013-02-05 Jakub Jelinek <jakub@redhat.com>
PR middle-end/56167
because the default address space slot then can't be used
for the output PCH file. */
if (pch_file)
+ {
+ c_common_no_more_pch ();
+ /* Only -g0 and -gdwarf* are supported with PCH, for other
+ debug formats we warn here and refuse to load any PCH files. */
+ if (write_symbols != NO_DEBUG && write_symbols != DWARF2_DEBUG)
+ warning (OPT_Wdeprecated,
+ "the \"%s\" debug format cannot be used with "
+ "pre-compiled headers", debug_type_names[write_symbols]);
+ }
+ else if (write_symbols != NO_DEBUG && write_symbols != DWARF2_DEBUG)
c_common_no_more_pch ();
/* Yuk. WTF is this? I do know ObjC relies on it somewhere. */
+2013-02-18 Jakub Jelinek <jakub@redhat.com>
+
+ PR pch/54117
+ * lib/dg-pch.exp (pch-init, pch-finish,
+ check_effective_target_pch_supported_debug): New procs.
+ (dg-flags-pch): If $pch_unsupported, make tests UNSUPPORTED.
+ Likewise if $pch_unsupported_debug and $flags include -g.
+ Skip FAILs about missing *.gch file if $pch_unsupported_debug
+ and dg-require-effective-target pch_unsupported_debug.
+ * g++.dg/pch/pch.exp: Call pch-init and pch-finish.
+ * objc.dg/pch/pch.exp: Likewise.
+ * gcc.dg/pch/pch.exp: Likewise.
+ * gcc.dg/pch/valid-1.c: Add dg-require-effective-target
+ pch_unsupported_debug.
+ * gcc.dg/pch/valid-1.hs: Likewise.
+ * gcc.dg/pch/valid-1b.c: Likewise.
+ * gcc.dg/pch/valid-1b.hs: Likewise.
+
2013-02-18 Richard Biener <rguenther@suse.de>
PR tree-optimization/56366
# Initialize `dg'.
dg-init
+pch-init
set old_dg_do_what_default "${dg-do-what-default}"
set dg-do-what-default "$old_dg_do_what_default"
# All done.
+pch-finish
dg-finish
dg-init
torture-init
set-torture-options $DG_TORTURE_OPTIONS
+pch-init
set old_dg_do_what_default "${dg-do-what-default}"
set dg-do-what-default "$old_dg_do_what_default"
# All done.
+pch-finish
torture-finish
dg-finish
+/* { dg-require-effective-target pch_supported_debug } */
/* { dg-options "-I. -Winvalid-pch -g" } */
#include "valid-1.h"/* { dg-warning "created with -gnone, but used with -g" } */
+/* { dg-require-effective-target pch_supported_debug } */
/* { dg-options "-I. -Winvalid-pch -g0" } */
extern int x;
+/* { dg-require-effective-target pch_supported_debug } */
/* { dg-options "-I. -Winvalid-pch -g0" } */
#include "valid-1b.h"
+/* { dg-require-effective-target pch_supported_debug } */
/* { dg-options "-I. -Winvalid-pch -g" } */
extern int x;
load_lib copy-file.exp
+proc pch-init { args } {
+ global pch_unsupported_debug pch_unsupported
+
+ if [info exists pch_unsupported_debug] {
+ error "pch-init: pch_unsupported_debug is not empty as expected"
+ }
+ if [info exists pch_unsupported] {
+ error "pch-init: pch_unsupported is not empty as expected"
+ }
+
+ set result [check_compile pchtest object "int i;" "-g -x c-header"]
+ set pch_unsupported_debug \
+ [regexp "debug format cannot be used with pre-compiled headers" \
+ [lindex $result 0]]
+
+ set pch_unsupported 0
+ if { $pch_unsupported_debug } {
+ verbose -log "pch is unsupported with the debug info format"
+
+ set result [check_compile pchtest object "int i;" "-x c-header"]
+ set pch_unsupported \
+ [regexp "debug format cannot be used with pre-compiled headers" \
+ [lindex $result 0]]
+ }
+}
+
+proc pch-finish { args } {
+ global pch_unsupported_debug pch_unsupported
+ unset pch_unsupported_debug
+ unset pch_unsupported
+}
+
+proc check_effective_target_pch_supported_debug { } {
+ global pch_unsupported_debug
+ if { $pch_unsupported_debug } {
+ return 0
+ }
+ return 1
+}
+
proc dg-flags-pch { subdir test otherflags options suffix } {
global runtests dg-do-what-default
+ global pch_unsupported_debug pch_unsupported
# If we're only testing specific files and this isn't one of them, skip it.
if ![runtest_file_p $runtests $test] {
foreach flags $options {
verbose "Testing $nshort, $otherflags $flags" 1
+ if { $pch_unsupported != 0 \
+ || ( $pch_unsupported_debug != 0 && [regexp " -g" " $flags"] ) } {
+ verbose -log "$nshort unsupported because debug format conflicts with PCH"
+ unsupported "$nshort $flags"
+ continue
+ }
+
# For the header files, the default is to precompile.
set dg-do-what-default precompile
catch { file_on_host delete "$bname$suffix" }
fail "$nshort $flags assembly comparison"
}
}
- } else {
+ } elseif { $pch_unsupported_debug == 0 \
+ || [llength [grep $test "{\[ \t\]\+dg-require-effective-target\[ \t\]\+pch_supported_debug\[ \t\]\+.*\[ \t\]\+}"]] > 0 } {
verbose -log "pch file '$bname$suffix.gch' missing"
fail "$nshort $flags"
if { !$have_errs } {
# Initialize `dg'.
dg-init
-
torture-init
+pch-init
set-torture-options $DG_TORTURE_OPTIONS
set dg-do-what-default "$old_dg_do_what_default"
# All done.
+pch-finish
torture-finish
dg-finish