https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68446

            Bug ID: 68446
           Summary: jit testsuite failures seen inside
                    dwarf2out.c:gen_producer_string
           Product: gcc
           Version: 6.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: jit
          Assignee: dmalcolm at gcc dot gnu.org
          Reporter: dmalcolm at gcc dot gnu.org
  Target Milestone: ---

At r230562 (aka 21a6b87b86defda10ac903a9cd49e34b1f8ce6fb) jit.sum has:
  # of expected passes            1711
  # of unexpected failures        60
  # of unresolved testcases       2
as compared to e.g. trunk from July (r226339;
1ae7fdc96dfbbd74f29a0d563fa7641c1563d615) which has jit.sum:
  # of expected passes            6372
  # of unexpected failures        1
(where: FAIL: jit.dg/test-threads.c, initial compilation, due to:
/home/david/coding-3/gcc-git-jit-clean/src/gcc/testsuite/jit.dg/harness.h:25:14:
error: static declaration of 'dejagnu_pass' follows non-static declaration
/home/david/coding-3/gcc-git-jit-clean/src/gcc/testsuite/jit.dg/test-threads.c:23:6:
note: previous declaration of 'dejagnu_pass' was here
(I think I've fixed this other failure).

i.e. lots of major failures.

They seem to mostly be an ICE in:
0x7f9d586ee332 gen_producer_string
        ../../src/gcc/dwarf2out.c:20139
0x7f9d586ee332 dwarf2out_finish
        ../../src/gcc/dwarf2out.c:25250

due to this assertion failing:
20139     gcc_checking_assert (save_decoded_options[j].canonical_option[0][0]
20140                          == '-');

A minimal reproducer is e.g. test-volatile.c

As far as I can tell, save_decoded_options[3] and [4] canonical_option
fieldhave become the empty string (or corrupt?); the loop is accessing 0..9,
and dies with j == 3:
(gdb) p save_decoded_options[0]
$6 = {opt_index = 1432, warn_message = 0x0, 
  arg = 0x606120
"/home/david/coding-3/gcc-git-clean/build-with-jit/gcc/test-volatile.c.exe", 
  orig_option_with_args_text = 0x606120
"/home/david/coding-3/gcc-git-clean/build-with-jit/gcc/test-volatile.c.exe", 
  canonical_option = {0x606120
"/home/david/coding-3/gcc-git-clean/build-with-jit/gcc/test-volatile.c.exe",
0x0, 0x0, 0x0}, 
  canonical_option_num_elements = 1, value = 1, errors = 0}
(gdb) p save_decoded_options[1]
$7 = {opt_index = 1433, warn_message = 0x0, arg = 0x606b50
"/tmp/libgccjit-8Mwbrw/fake.c", 
  orig_option_with_args_text = 0x606b50 "/tmp/libgccjit-8Mwbrw/fake.c",
canonical_option = {
    0x606b50 "/tmp/libgccjit-8Mwbrw/fake.c", 0x0, 0x0, 0x0},
canonical_option_num_elements = 1, value = 1, errors = 0}
(gdb) p save_decoded_options[2]
$8 = {opt_index = 486, warn_message = 0x0, arg = 0x0,
orig_option_with_args_text = 0x608340 "", canonical_option = {
    0x7ffff75b9759 "-fPIC", 0x0, 0x0, 0x0}, canonical_option_num_elements = 1,
value = 1, errors = 0}
(gdb) p save_decoded_options[3]
$9 = {opt_index = 139, warn_message = 0x0, arg = 0x606e42 "3",
orig_option_with_args_text = 0x608360 "\377\377\001", 
  canonical_option = {0x608350 "", 0x0, 0x0, 0x0},
canonical_option_num_elements = 1, value = 1, errors = 0}
(gdb) p save_decoded_options[4]
$10 = {opt_index = 1126, warn_message = 0x0, arg = 0x606e62 "",
orig_option_with_args_text = 0x608380 "\200", canonical_option = {
    0x608370 "", 0x0, 0x0, 0x0}, canonical_option_num_elements = 1, value = 1,
errors = 0}

I ran a git bisect, it indicated that the failure of test-volatile.c was
introduced by:

commit 25faed340686df8d7bb2242dc8d04285976922b6
Author: marxin <marxin@138bc75d-0d04-0410-961f-82ee72b054a4>
Date:   Thu Nov 12 15:50:05 2015 +0000

    Fix big memory leak in ix86_valid_target_attribute_p

        * config/i386/i386.c (ix86_valid_target_attribute_p):
        Finalize options at the of the function.
        * gcc.c (driver_get_configure_time_options): Call newly
        introduced init_opts_obstack.
        * lto-wrapper.c (main): Likewise.
        * opts.c (init_opts_obstack): New function.
        (init_options_struct): Call newly
        introduced init_opts_obstack.
        * opts.h (init_options_struct): Declare.


    git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@230264
138bc75d-0d04-0410-961f-82ee72b054a4

Reply via email to