Skip to content

[llvmgcc] Passing large structures by value to functions results in large code. #1117

@llvmbot

Description

@llvmbot
Bugzilla Link 745
Resolution FIXED
Resolved on Mar 06, 2010 14:00
Version 1.0
OS All
Depends On llvm/llvm-bugzilla-archive#1521
Reporter LLVM Bugzilla Contributor

Extended Description

#include <stdlib.h>

struct RT {
char a;
char b;
int c;
int d[50][50];
} glob;

int main(int argc, char **argv) {
glob.a = 1;
glob.b = 2;
glob.c = 3;
printf("glob.1 = %d\n", *(&glob + 1));
}

compiles 62 seconds, spits out 18kb bc file with 5063 tmp vars. For
larger arrays (say 1000 X 2000) it never returns. GCC has no problems
compiling such examples.

A 10-liner shouldn't kill the compiler :-)

Domagoj

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions