[PATCH] D100509: Support GCC's -fstack-usage flag

Dávid Bolvanský via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Apr 15 10:54:45 PDT 2021


xbolva00 added a comment.

  Set current_function_has_unbounded_dynamic_stack_size to 1 when pushing a variable-sized argument onto the stack. 
  
        if (current_function_has_unbounded_dynamic_stack_size)
  	stack_usage_kind = DYNAMIC;
        else
  	stack_usage_kind = DYNAMIC_BOUNDED;

https://github.com/gcc-mirror/gcc/commit/d3c12306971946ab9a9d644ddf7b26e9383d2391

You can compile eg. zstd project with "CC="gcc -fstack-usage" make -j6 -B" and then grep "bounded" . -R and you will find some examples of dynamic,bounded.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D100509/new/

https://reviews.llvm.org/D100509



More information about the cfe-commits mailing list