The toolchain is built with newlib C.
*** EXIT code 4242
FAIL: gcc.dg/initpri1.c execution test

The constructors are performed in the correct order, from lowest to highest.
However the destructors are performed in a wrong order.

...
void d1() __attribute__((destructor (500)));
void d2() __attribute__((destructor (700)));
void d3() __attribute__((destructor (600)));

void d1() {
  if (--i != 0)
    abort ();
}

void d2() {
  if (--i != 2)
    abort ();
}

void d3() {
  if (j != 2)
    abort ();
  if (--i != 1)
    abort ();
}

void cd4() __attribute__((constructor (800), destructor (800)));

void cd4() {
  if (i != 3)
    abort ();
  ++j;
}

The correct order should be:
cd4() -> d2() -> d3() -> d1()
However, on arm target, the order is d1()->d3()->d2()->cd4().


-- 
           Summary: FAIL: gcc.dg/initpri1.c, g++.dg/special/initpri1.C on
                    arm target
           Product: gcc
           Version: 4.4.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: jingyu at google dot com
 GCC build triplet: i686-linux-gnu, x86_64-pc-linux-gnu
  GCC host triplet: i686-linux-gnu, x86_64-pc-linux-gnu
GCC target triplet: arm-unknown-eabi


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

Reply via email to