OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [g++.dg/] [opt/] [stack2.C] - Rev 693

Compare with Previous | Blame | View Log

// PR c++/51060
// { dg-options "-Os -Wframe-larger-than=2000 -Werror" }

// Shows a problem of not re-using stack space:
// Compile as: g++ -c test_stack_reuse.cpp -o /dev/null -Wframe-larger-than=2048 -Werror -Os
// Result: warning: the frame size of 10240 bytes is larger than 2048 bytes [-Wframe-larger-than=]
//

struct StackObject
{
  StackObject();
  char buffer[1024];
};

void Test()
{
#define TEST_SUB() \
  StackObject();

#define TEST() \
        TEST_SUB() \
        TEST_SUB() \
        TEST_SUB() \
        TEST_SUB() \
        TEST_SUB() \
        TEST_SUB() \
        TEST_SUB() \
        TEST_SUB() \
        TEST_SUB() \
        TEST_SUB()

  TEST()
}

Compare with Previous | Blame | View Log

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.