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

            Bug ID: 70415
           Summary: -Wa options should be passed to LTO
           Product: gcc
           Version: 5.3.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: lto
          Assignee: unassigned at gcc dot gnu.org
          Reporter: vincent.riviere at freesbee dot fr
  Target Milestone: ---
            Target: m68k-elf

Basically, options specified with -Wa should be used in final LTO step.
Currently, they are not passed to LTO, this can break inline assembly.

Concretely, LTO fails if inline assembly requires gas
--register-prefix-optional option.

Testcase:

$ cat bug.c
void _start(void)
{
    asm("clr.l d0"); /* Note the absence of % in front of d0 */
}

$ m68k-elf-gcc -nostartfiles -nodefaultlibs -Wa,--register-prefix-optional
bug.c -o bug
# This works

$ m68k-elf-gcc -nostartfiles -nodefaultlibs -Wa,--register-prefix-optional
bug.c -o bug -flto
/tmp/ccQVzOtj.ltrans0.ltrans.o: In function `_start':
<artificial>:(.text+0x6): undefined reference to `d0'
collect2: error: ld returned 1 exit status

If we add -v on the command line, we can see that --register-prefix-optional is
not passed to "as" when for the LTO pass. While it should.

Reply via email to