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/46163] New: GCC Produces Invalid Assembly Code from Anonymous Function Syntax


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

           Summary: GCC Produces Invalid Assembly Code from Anonymous
                    Function Syntax
           Product: gcc
           Version: 4.4.4
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: kerrg@ccs.neu.edu
              Host: Linux x86_64
            Target: Linux x86_64


Created attachment 22143
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=22143
verbose outpuit from compilation

When compiling the following code:

int main(void)
{
    int (*func)(void *) = ({ int $(int (*x)()) { x(x); }; $($); });
    int x = func(func);
    return 0;
}

GCC compiles it to bad assembly code, causing the following error:
func.s: Assembler messages:
func.s:38: Error: suffix or operands invalid for `call'

The particular problem line is this:
    call    $.1597

I have attached more verbose output.


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