Contents

GNU Compiler Collection (GCC) Internals

This file documents the internals of the GNU compilers.

Copyright © 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.

Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation; with the Invariant Sections being “GNU General Public License” and “Funding Free Software”, the Front-Cover texts being (a) (see below), and with the Back-Cover Texts being (b) (see below). A copy of the license is included in the section entitled “GNU Free Documentation License”.

(a) The FSF's Front-Cover Text is:

A GNU Manual

(b) The FSF's Back-Cover Text is:

You have freedom to copy and modify this GNU Manual, like GNU software. Copies published by the Free Software Foundation raise funds for GNU development.

Short Contents

Table of Contents

4.2 Routines for floating point emulation

4.3 Routines for decimal floating point emulation

4.4 Language-independent routines for exception handling

4.5 Miscellaneous runtime library routines

5 Language Front Ends in GCC

6 Source Tree Structure and Build System

6.3.3 Build System in the gcc Directory

6.3.4 Makefile Targets

6.3.5 Library Source Files and Headers under the gcc Directory

6.3.6 Headers Installed by GCC

6.3.7 Building Documentation

6.3.8 Anatomy of a Language Front End

6.3.9 Anatomy of a Target Back End

6.4 Testsuites

7 Option specification files

8 Passes and Files of the Compiler

9 Trees: The intermediate representation used by the C and C++ front ends

9.3 Types

9.4 Scopes

9.5 Declarations

9.6 Functions

9.7 Attributes in trees

9.8 Expressions

10 Analysis and Optimization of GIMPLE Trees

10.2.4 Statements

10.2.5 GIMPLE Example

10.2.6 Rough GIMPLE Grammar

10.3 Annotations

10.4 Statement Operands

10.5 Static Single Assignment

10.6 Alias analysis

11 Analysis and Representation of Loops

12 RTL Representation

13 Control Flow Graph

14 Machine Descriptions

14.8 Operand Constraints

14.9 Standard Pattern Names For Generation

14.10 When the Order of Patterns Matters

14.11 Interdependence of Patterns

14.12 Defining Jump Instruction Patterns

14.13 Defining Looping Instruction Patterns

14.14 Canonicalization of Instructions

14.15 Defining RTL Sequences for Code Generation

14.16 Defining How to Split Instructions

14.17 Including Patterns in Machine Descriptions.

14.18 Machine-Specific Peephole Optimizers

14.19 Instruction Attributes

14.20 Conditional Execution

14.21 Constant Definitions

14.22 Macros

14.22.2 Code Macros

15 Target Description Macros and Functions

15.8 Register Classes

15.9 Obsolete Macros for Defining Constraints

15.10 Stack Layout and Calling Conventions

15.11 Implementing the Varargs Macros

15.12 Trampolines for Nested Functions

15.13 Implicit Calls to Library Routines

15.14 Addressing Modes

15.15 Anchored Addresses

15.16 Condition Code Status

15.17 Describing Relative Costs of Operations

15.18 Adjusting the Instruction Scheduler

15.19 Dividing the Output into Sections (Texts, Data, ...)

15.20 Position Independent Code

15.21 Defining the Output Assembler Language

15.22 Controlling Debugging Information Format

15.23 Cross Compilation and Floating Point

15.24 Mode Switching Instructions

15.25 Defining target-specific uses of attribute

15.26 Defining coprocessor specifics for MIPS targets.

15.27 Parameters for Precompiled Header Validity Checking

15.28 C++ ABI parameters

15.29 Miscellaneous Parameters

16 Host Configuration

17 Makefile Fragments

18 collect2

19 Standard Header File Directories

20 Memory Management and Type Information

Funding Free Software

The GNU Project and GNU/Linux

GNU GENERAL PUBLIC LICENSE

GNU Free Documentation License

Contributors to GCC

Option Index

Concept Index

Next: Contributing, Up: (DIR)

Introduction

This manual documents the internals of the GNU compilers, including how to port them to new targets and some information about how to write front ends for new languages. It corresponds to GCC version 4.2.1. The use of the GNU compilers is documented in a separate manual. See Introduction.

This manual is mainly a reference manual rather than a tutorial. It discusses how to contribute to GCC (see Contributing), the characteristics of the machines supported by GCC as hosts and targets (see Portability), how GCC relates to the ABIs on such systems (see Interface), and the characteristics of the languages for which GCC front ends are written (see Languages). It then describes the GCC source tree structure and build system, some of the interfaces to GCC front ends, and how support for a target system is implemented in GCC.

Additional tutorial information is linked to from http://gcc.gnu.org/readings.html.