Ignore -fdebug-prefix-map in producer string (by Daniel Kahn Gillmor)
authorBernd Schmidt <bernds@gcc.gnu.org>
Fri, 18 Dec 2015 19:48:26 +0000 (19:48 +0000)
committerBernd Schmidt <bernds@gcc.gnu.org>
Fri, 18 Dec 2015 19:48:26 +0000 (19:48 +0000)
* dwarf2out.c (gen_producer_string): Ignore -fdebug-prefix-map.

testsuite/
* gcc.dg/debug/dwarf2/prod-options.c: New test.

From-SVN: r231835

gcc/ChangeLog
gcc/dwarf2out.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/debug/dwarf2/prod-options.c [new file with mode: 0644]

index fec799200b118a54de26f090efb66664221fb483..11ee6206388a56b266aa6ed88ac49e049d7f3421 100644 (file)
@@ -1,3 +1,7 @@
+2015-12-18  Daniel Kahn Gillmor  <dkg@fifthhorseman.net>
+
+       * dwarf2out.c (gen_producer_string): Ignore -fdebug-prefix-map.
+
 2015-12-18  Nathan Sidwell  <nathan@acm.org>
 
        * config/nvptx/nvptx.c (nvptx_option_override): Emit sorry for
index 067c4f23892d4a18a58593e1e09925ee71c0cda8..320a077c0c707eaf309da73f65caf3fd07df6042 100644 (file)
@@ -21498,6 +21498,7 @@ gen_producer_string (void)
       case OPT_fpreprocessed:
       case OPT_fltrans_output_list_:
       case OPT_fresolution_:
+      case OPT_fdebug_prefix_map_:
        /* Ignore these.  */
        continue;
       default:
index 5da1ce4bc2b2f6c06cc71f5c28bfc28d7010bc42..b2d9d3bcd50d25bc2c0a9b3ebe838e37c0249dde 100644 (file)
@@ -1,3 +1,7 @@
+2015-12-18  Bernd Schmidt  <bschmidt@redhat.com>
+
+       * gcc.dg/debug/dwarf2/prod-options.c: New test.
+
 2015-12-18  Eric Botcazou  <ebotcazou@adacore.com>
 
        * gnat.dg/specs/debug1.ads: Bump final count to 18.
diff --git a/gcc/testsuite/gcc.dg/debug/dwarf2/prod-options.c b/gcc/testsuite/gcc.dg/debug/dwarf2/prod-options.c
new file mode 100644 (file)
index 0000000..21449f9
--- /dev/null
@@ -0,0 +1,12 @@
+/* Verify that the DW_AT_producer does not contain certain compiler options
+   such as -fdebug-prefix-map=; this is undesirable since path names make
+   the build not reproducible.  Other skipped options could be tested here
+   as well.  */
+/* { dg-do compile } */
+/* { dg-options "-O2 -gdwarf -dA -fdebug-prefix-map=a=b" } */
+/* { dg-final { scan-assembler "DW_AT_producer: \"GNU C" } } */
+/* { dg-final { scan-assembler-not "debug-prefix-map" } } */
+
+void func (void)
+{
+}