A goto-elimination method and its implementation for the McCAT C compiler /
In designing optimizing and parallelizing compilers, it is often simpler and more efficient to deal with programs that have structured control flow. Although most programmers naturally program in a structured fashion, there remain many important programs and benchmarks that include some number of go...
Main Author: | |
---|---|
Other Authors: | |
Format: | Others |
Language: | en |
Published: |
McGill University
1995
|
Subjects: | |
Online Access: | http://digitool.Library.McGill.CA:80/R/?func=dbin-jump-full&object_id=55450 |
id |
ndltd-LACETR-oai-collectionscanada.gc.ca-QMM.55450 |
---|---|
record_format |
oai_dc |
spelling |
ndltd-LACETR-oai-collectionscanada.gc.ca-QMM.554502014-02-13T03:50:58ZA goto-elimination method and its implementation for the McCAT C compiler /Erosa, Ana MariaComputer Science.In designing optimizing and parallelizing compilers, it is often simpler and more efficient to deal with programs that have structured control flow. Although most programmers naturally program in a structured fashion, there remain many important programs and benchmarks that include some number of goto statements, thus rendering the entire program unstructured. Such unstructured programs cannot be handled with compilers built with analyses and transformations for structured programs.In this thesis we present a straight-forward algorithm to structure C programs by eliminating all goto statements. The method works directly on a high-level abstract syntax tree (AST) representation of the program and could easily be integrated into any compiler that uses an AST-based intermediate representation. The actual algorithm proceeds by eliminating each goto by first applying a sequence of goto-movement transformations followed by the appropriate goto-elimination transformation.Our McCAT (McGill Compiler Architecture Testbed) optimizing/parallelizing C compiler is based on a compositional representation of the program, and hence does not support unrestricted use of gotos directly. We have implemented the method within the framework of the McCat compiler. We present some experimental results and study the cost of structuring. The results show that applying a small number of simple transformations eliminates all the goto statements, usually with a minimal effect on the execution speed. Thus, we can exploit structured representations for designing compilers, while paying a minimal penalty due to structuring.McGill UniversityHendren, Laurie (advisor)1995Electronic Thesis or Dissertationapplication/pdfenalephsysno: 001473100proquestno: AAIMM08012Theses scanned by UMI/ProQuest.All items in eScholarship@McGill are protected by copyright with all rights reserved unless otherwise indicated.Master of Science (School of Computer Science.) http://digitool.Library.McGill.CA:80/R/?func=dbin-jump-full&object_id=55450 |
collection |
NDLTD |
language |
en |
format |
Others
|
sources |
NDLTD |
topic |
Computer Science. |
spellingShingle |
Computer Science. Erosa, Ana Maria A goto-elimination method and its implementation for the McCAT C compiler / |
description |
In designing optimizing and parallelizing compilers, it is often simpler and more efficient to deal with programs that have structured control flow. Although most programmers naturally program in a structured fashion, there remain many important programs and benchmarks that include some number of goto statements, thus rendering the entire program unstructured. Such unstructured programs cannot be handled with compilers built with analyses and transformations for structured programs. === In this thesis we present a straight-forward algorithm to structure C programs by eliminating all goto statements. The method works directly on a high-level abstract syntax tree (AST) representation of the program and could easily be integrated into any compiler that uses an AST-based intermediate representation. The actual algorithm proceeds by eliminating each goto by first applying a sequence of goto-movement transformations followed by the appropriate goto-elimination transformation. === Our McCAT (McGill Compiler Architecture Testbed) optimizing/parallelizing C compiler is based on a compositional representation of the program, and hence does not support unrestricted use of gotos directly. We have implemented the method within the framework of the McCat compiler. We present some experimental results and study the cost of structuring. The results show that applying a small number of simple transformations eliminates all the goto statements, usually with a minimal effect on the execution speed. Thus, we can exploit structured representations for designing compilers, while paying a minimal penalty due to structuring. |
author2 |
Hendren, Laurie (advisor) |
author_facet |
Hendren, Laurie (advisor) Erosa, Ana Maria |
author |
Erosa, Ana Maria |
author_sort |
Erosa, Ana Maria |
title |
A goto-elimination method and its implementation for the McCAT C compiler / |
title_short |
A goto-elimination method and its implementation for the McCAT C compiler / |
title_full |
A goto-elimination method and its implementation for the McCAT C compiler / |
title_fullStr |
A goto-elimination method and its implementation for the McCAT C compiler / |
title_full_unstemmed |
A goto-elimination method and its implementation for the McCAT C compiler / |
title_sort |
goto-elimination method and its implementation for the mccat c compiler / |
publisher |
McGill University |
publishDate |
1995 |
url |
http://digitool.Library.McGill.CA:80/R/?func=dbin-jump-full&object_id=55450 |
work_keys_str_mv |
AT erosaanamaria agotoeliminationmethodanditsimplementationforthemccatccompiler AT erosaanamaria gotoeliminationmethodanditsimplementationforthemccatccompiler |
_version_ |
1716640113876795392 |