http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45955

           Summary: FAIL: gcc.dg/initpri1.c (test for excess errors)
           Product: gcc
           Version: 4.6.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: middle-end
        AssignedTo: unassig...@gcc.gnu.org
        ReportedBy: dang...@gcc.gnu.org
              Host: hppa2.0w-hp-hpux11.11
            Target: hppa2.0w-hp-hpux11.11
             Build: hppa2.0w-hp-hpux11.11


Executing on host: /test/gnu/gcc/objdir/gcc/xgcc -B/test/gnu/gcc/objdir/gcc/
/te
st/gnu/gcc/gcc/gcc/testsuite/gcc.dg/initpri1.c    -ansi -pedantic-errors  -lm   
-o ./initpri1.exe    (timeout = 300)
WARNING: program timed out.
compiler exited with status 1
FAIL: gcc.dg/initpri1.c (test for excess errors)

Running under gdb, I see:

Program received signal SIGINT, Interrupt.
0x01478e68 in build_cdtor (ctor_p=1 '\001', cdtors=0x400c9108)
    at ../../gcc/gcc/ipa.c:1490
1490          while (i < len);
(gdb) bt
#0  0x01478e68 in build_cdtor (ctor_p=1 '\001', cdtors=0x400c9108)
    at ../../gcc/gcc/ipa.c:1490
#1  0x01479384 in build_cdtor_fns () at ../../gcc/gcc/ipa.c:1565
#2  0x0147962c in ipa_cdtor_merge () at ../../gcc/gcc/ipa.c:1594
#3  0x00ca6da0 in execute_one_pass (pass=0x4001ca4c)
    at ../../gcc/gcc/passes.c:1562
#4  0x00ca8058 in execute_ipa_pass_list (pass=0x4001ca4c)
    at ../../gcc/gcc/passes.c:1929
#5  0x013ee044 in ipa_passes () at ../../gcc/gcc/cgraphunit.c:1734
#6  0x013ee1a8 in cgraph_optimize () at ../../gcc/gcc/cgraphunit.c:1769
#7  0x013eb62c in cgraph_finalize_compilation_unit ()
    at ../../gcc/gcc/cgraphunit.c:1020
#8  0x000c262c in c_write_global_declarations ()
    at ../../gcc/gcc/c-decl.c:9821
#9  0x00e2c434 in compile_file () at ../../gcc/gcc/toplev.c:946
#10 0x00e30508 in do_compile () at ../../gcc/gcc/toplev.c:2374
#11 0x00e30694 in toplev_main (argc=19, argv=0x7eff05e4)
    at ../../gcc/gcc/toplev.c:2415
#12 0x00373f34 in main (argc=19, argv=0x7eff05e4) at ../../gcc/gcc/main.c:36

There's a thinko in this code:

      /* Find the next batch of constructors/destructors with the same
         initialization priority.  */
      for (;i < j; i++)
        {
          tree call;
          fn = VEC_index (tree, cdtors, i);
          call = build_call_expr (fn, 0);
          if (ctor_p)
            DECL_STATIC_CONSTRUCTOR (fn) = 0;
          else
            DECL_STATIC_DESTRUCTOR (fn) = 0;
          /* We do not want to optimize away pure/const calls here.
             When optimizing, these should be already removed, when not
             optimizing, we want user to be able to breakpoint in them.  */
          TREE_SIDE_EFFECTS (call) = 1;
          append_to_statement_list (call, &body);
        }
      while (i < len);

Reply via email to