multicore - 一些理解 GCC 源代码的指针

标签 multicore compiler-optimization gcc4

我是正在为多核处理器优化 GCC 的学生。我尝试查看源代码,但由于我需要向后端添加一些代码,因此很难理解它。任何人都可以建议一些很好的资源来解释不同阶段的代码流。
还建议一些调试GCC的开发环境,主要是单步调试代码。在windows上可以吗?

最佳答案

作为起点,请参阅 Links and Selected Readings在海湾合作委员会网站上。我认为你特别感兴趣的是:

  • GNU C Compiler Internals
  • Compilation of Functional Programming Languages using GCC -- Tail Calls作者:安德烈亚斯·鲍尔
  • Porting GCC for Dunces作者:Hans-Peter Nilsson

  • 如果你想在 Windows 上开发你可能需要从 MinGW 开始(Minimalist GNU for Windows) Compiler Suite 源代码(它包括 GNU GDB 调试器),它是 GCC 到 Windows 的端口。

    对于舒适的开发环境,我帮不上什么忙,因为我不是用 C++ 开发的。但我想一个好的 C/C++ IDE 是你所需要的:看看 this comparison ,有很多适用于 Windows 的免费/开源 IDE。

    更新:我想 ICI您也可能感兴趣:

    The Interactive Compilation Interface (or 'ICI' for short) is a plugin system with a high-level compiler-independent and low-level compiler-dependent API to transform current compilers into collaborative open modular interactive toolsets. The ICI framework acts as a "middleware" interface between the compiler and the user-definable plugins. It opens up and reuses the production-quality compiler infrastructure to enable program analysis and instrumentation, fine-grain program optimizations, simple prototyping of new development and research ideas while avoiding building new compilation tools from scratch. For example, it is used in MILEPOST GCC to automate compiler and architecture design and program optimizations based on statistical analysis and machine learning. It should enable universal self-tuning compilers adaptable to heterogeneous, reconfigurable, multi-core architectures ranging from supercomputers to embedded systems.



    .. 作为 Collective TUNING 下的其余项目伞。

    注:正如 BlueRaja 在评论中所写的那样,编写“编译器是最复杂的程序之一”是夸大其词:有非常简单的编译器和非常复杂的编译器。但是在编译器理论中(一旦你研究过它)就没有什么深奥的了。 GCC 是一个复杂的程序,可以理解为任何 ,那里的程序记录不完整 1 .所以 rizwanhudda 不要气馁:开始研究可用的文档,然后询问 GCC 开发人员(在 GCC irc channel ,如 suggested by nvlGCC developers mailing list )解释什么是不良(或根本没有)记录。
  • 事实上program comprehension是一个活跃的研究领域。
  • 关于multicore - 一些理解 GCC 源代码的指针,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2504365/

    相关文章:

    r - 追溯罕见错误

    c++ - C++ 中的编译器指令重新排序优化(以及抑制它们的因素)

    gcc:为什么没有优化文字类型?

    c++ - 为什么 sqrt() 在没有为 int 定义的 int 变量上工作正常?

    c++ - 如何设置 gcc 4.3 默认规范文件?

    cpu - 对于乱序的超标量处理器,每个周期获取的指令数是否恒定?

    C++ 并行化库 : OpenMP vs. 线程构建 block

    cpu-architecture - 两个进程可以在一个 CPU 内核上同时运行吗?

    go - golang 编译器是否使用常量折叠?

    c - 指向不透明结构数组的指针