Patchwork Temporarily revert Steven's PCH changes for 4.8 (PR pch/54117)

login
register
mail settings
Submitter Steven Bosscher
Date Feb. 13, 2013, 11:41 p.m.
Message ID <CABu31nOvNOzq3fHCKtEKveccRL=nt=tLiNWsY=X3LmUok7xxiQ@mail.gmail.com>
Download mbox | patch
Permalink /patch/220302/
State New
Headers show

Comments

Steven Bosscher - Feb. 13, 2013, 11:41 p.m.
On Thu, Feb 14, 2013 at 12:17 AM, John David Anglin wrote:
> On 2013-02-13 3:33 PM, David Edelsohn wrote:
>>
>>      Perhaps Dave can explain what would have to be done to move this
>> >     platform to DWARF2...?
>> >
>
> I had looked at this a bit in the past.  I don't think it's that difficult
> to add DWARF2 support
> to GCC on hppa.  Although we don't support named sections, we can create
> named subspaces
> for the dwarf info.  More of an issue in my mind is the changes needed to
> gdb to recognize
> this support.
>
> I agree with David that it might be better to give up pch.

That'd be a really a good start.

How about something like the attached patch for trunk?
Tested on powerpc64-linux pch.exp with -gstabs.

Ciao!
Steven

c-family/
        * c-opts.c (c_common_handle_option): Warn that pre-compiled headers
        with debug formats other than DWARF are deprecated.

testsuite/
        * lib/dg-pch.exp: Compile the PCH with extra flag -Wno-deprecated.
c-family/
	* c-opts.c (c_common_handle_option): Warn that pre-compiled headers
	with debug formats other than DWARF are deprecated.

testsuite/
	* lib/dg-pch.exp: Compile the PCH with extra flag -Wno-deprecated.

Patch

Index: c-family/c-opts.c
===================================================================
--- c-family/c-opts.c	(revision 196032)
+++ c-family/c-opts.c	(working copy)
@@ -268,6 +268,10 @@  c_common_handle_option (size_t scode, const char *
       break;
 
     case OPT__output_pch_:
+      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]);
       pch_file = arg;
       break;
 
Index: testsuite/lib/dg-pch.exp
===================================================================
--- testsuite/lib/dg-pch.exp	(revision 196032)
+++ testsuite/lib/dg-pch.exp	(working copy)
@@ -39,8 +39,12 @@  proc dg-flags-pch { subdir test otherflags options
 	set dg-do-what-default precompile
 	catch { file_on_host delete "$bname$suffix" }
 	gcc_copy_files "[file rootname $test]${suffix}s" "$bname$suffix"
-	dg-test -keep-output "./$bname$suffix" "$otherflags $flags" ""
 
+	# Suppress -Wdeprecated to allow PCH tests to work with non-DWARF2
+	# debug formats.  Support for such combinations has been deprecated
+	# for GCC 4.8.
+	dg-test -keep-output "./$bname$suffix" "$otherflags $flags -Wno-deprecated" ""
+
 	# For the rest, the default is to compile to .s.
 	set dg-do-what-default compile