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

--- Comment #25 from EML <elowe at elowe dot com> ---
I have applied the patch and tried your other suggestions, still the stage1
compiler has the same problems generating executables.

In analyzing the intermediate files between working (gcc 4.93) and not
(bootstrap 8.3), the intermediate files seem similar until the "mach" stage

The problem seems to be in out the compiler decides to reference a string in
the source.

My program is:

#include <stdio.h>

int main()
{
        printf("Hellos World\n");
        return 0;
}

The generated .s file for Working does this:

.LC0:
        stringz "Hellos World"

<edited for breivity>

        addl r36 = @ltoffx(.LC0), r1
        ;;
        ld8.mov r36 = [r36], .LC0

The non-working .s file does this:

.LC0:
        stringz "Hellos World"

<edited for breivity>

        movl r36 = @gprel(.LC0)
        ;;
        add r36 = r1, r36


If I replace those 3 lines and run the assembler+linker by hand - the
non-working foo.s will run correctly

Reply via email to