Beyond a joke: Dead Code Elimination can delete live code

Dead Code Elimination (DCE) is a fundamental compiler optimization technique that removes dead code (e.g., unreachable or reachable but whose results are unused) in the program to produce smaller or faster executables. However, since compiler optimizations are typically aggressively performed and th...

Full description

Saved in:
Bibliographic Details
Main Authors: TU, Haoxin, JIANG, Lingxiao, GAO, Debin, JIANG, He
Format: text
Language:English
Published: Institutional Knowledge at Singapore Management University 2024
Subjects:
Online Access:https://ink.library.smu.edu.sg/sis_research/8923
https://ink.library.smu.edu.sg/context/sis_research/article/9926/viewcontent/3639476.3639763_pvoa_cc_by.pdf
Tags: Add Tag
No Tags, Be the first to tag this record!
Institution: Singapore Management University
Language: English
id sg-smu-ink.sis_research-9926
record_format dspace
spelling sg-smu-ink.sis_research-99262024-06-27T07:46:00Z Beyond a joke: Dead Code Elimination can delete live code TU, Haoxin JIANG, Lingxiao GAO, Debin JIANG, He Dead Code Elimination (DCE) is a fundamental compiler optimization technique that removes dead code (e.g., unreachable or reachable but whose results are unused) in the program to produce smaller or faster executables. However, since compiler optimizations are typically aggressively performed and there are complex relationships/interplay among a vast number of compiler optimizations (including DCE), it is not known whether DCE is indeed correctly performed and will only delete dead code in practice. In this study, we open a new research problem to investigate: can DCE happen to erroneously delete live code? To tackle this problem, we design a new approach named Xdead, which leverages differential testing, static binary analysis, and dynamic symbolic execution techniques, to detect miscompilation bugs caused by the erroneously deleted live code. Preliminary evaluation shows that Xdead can identify many divergent portions indicating erroneously deleted live code and finally detect two such miscompilation bugs in LLVM compilers. Our findings call for more attention to the potential issues in existing DCE implementations and more conservative strategies when designing new DCE-related compiler optimizations. 2024-04-01T07:00:00Z text application/pdf https://ink.library.smu.edu.sg/sis_research/8923 info:doi/10.1145/3639476.3639763 https://ink.library.smu.edu.sg/context/sis_research/article/9926/viewcontent/3639476.3639763_pvoa_cc_by.pdf http://creativecommons.org/licenses/by/3.0/ Research Collection School Of Computing and Information Systems eng Institutional Knowledge at Singapore Management University program analysis Reliability software testing symbolic execution Software Engineering
institution Singapore Management University
building SMU Libraries
continent Asia
country Singapore
Singapore
content_provider SMU Libraries
collection InK@SMU
language English
topic program analysis
Reliability
software testing
symbolic execution
Software Engineering
spellingShingle program analysis
Reliability
software testing
symbolic execution
Software Engineering
TU, Haoxin
JIANG, Lingxiao
GAO, Debin
JIANG, He
Beyond a joke: Dead Code Elimination can delete live code
description Dead Code Elimination (DCE) is a fundamental compiler optimization technique that removes dead code (e.g., unreachable or reachable but whose results are unused) in the program to produce smaller or faster executables. However, since compiler optimizations are typically aggressively performed and there are complex relationships/interplay among a vast number of compiler optimizations (including DCE), it is not known whether DCE is indeed correctly performed and will only delete dead code in practice. In this study, we open a new research problem to investigate: can DCE happen to erroneously delete live code? To tackle this problem, we design a new approach named Xdead, which leverages differential testing, static binary analysis, and dynamic symbolic execution techniques, to detect miscompilation bugs caused by the erroneously deleted live code. Preliminary evaluation shows that Xdead can identify many divergent portions indicating erroneously deleted live code and finally detect two such miscompilation bugs in LLVM compilers. Our findings call for more attention to the potential issues in existing DCE implementations and more conservative strategies when designing new DCE-related compiler optimizations.
format text
author TU, Haoxin
JIANG, Lingxiao
GAO, Debin
JIANG, He
author_facet TU, Haoxin
JIANG, Lingxiao
GAO, Debin
JIANG, He
author_sort TU, Haoxin
title Beyond a joke: Dead Code Elimination can delete live code
title_short Beyond a joke: Dead Code Elimination can delete live code
title_full Beyond a joke: Dead Code Elimination can delete live code
title_fullStr Beyond a joke: Dead Code Elimination can delete live code
title_full_unstemmed Beyond a joke: Dead Code Elimination can delete live code
title_sort beyond a joke: dead code elimination can delete live code
publisher Institutional Knowledge at Singapore Management University
publishDate 2024
url https://ink.library.smu.edu.sg/sis_research/8923
https://ink.library.smu.edu.sg/context/sis_research/article/9926/viewcontent/3639476.3639763_pvoa_cc_by.pdf
_version_ 1814047632212885504