This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c/33918] New: GCC failed to produce assembler output with -masm=intel option


This happened to me when I wanted to look at assembler output source using gcc
-S and for better readability choose -masm=intel option. -S only works fine. I
tried to cut my source and include short example which can be quickly verified.
I also checked this problem happen on mingw32 gcc ver 3.4.5

Try to compile this: gcc -S x.c -masm=intel

x.c:
=================================
#include <stdlib.h>
#include <stdio.h>

typedef struct {
unsigned long offset; // 32-bit offset
unsigned short selector; // 16-bit selector
} __attribute__((packed)) PM_FAR_POINTER;

int exec_ring0_code(unsigned long code_address, unsigned long ecx, unsigned
long *eax, unsigned long *edx)
{
PM_FAR_POINTER callgate_ptr;
asm __volatile__ (
"lcall *%5\n"
: "=a"(*eax), "=d"(*edx)
: "a"(*eax), "c"(ecx), "d"(*edx), "m" (callgate_ptr)
: "memory"
);
return(0);
}
=================================

result is:

x.c: In function 'exec_ring0_code':
x.c:19: internal compiler error: in print_operand, at config/i386/i386.c:7961
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://gcc.gnu.org/bugs.html> for instructions.

Assembler output x.S stops at line
"lcall *"

when I compile it with gcc -S x.c only it compile all without error
and mentioned line looks this:
"lcall *-6(%ebp)"


-- 
           Summary: GCC failed to produce assembler output with -masm=intel
                    option
           Product: gcc
           Version: 4.2.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: rayer at seznam dot cz
 GCC build triplet: i386-pc-dos-djgpp, win32-mingw
  GCC host triplet: i386-pc-dos-djgpp, win32-mingw
GCC target triplet: i386-pc-dos-djgpp, win32-mingw


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]