୍⯡♫ᅋἲே 㟁Ꮚ᝟ሗ㏻ಙᏛ఍                  ಙᏛᢏሗ‫ٻ‬‫ٻڇڮڞڤکڪڭگڞڠڧڠٻڡڪٻڠگڰگڤگڮکڤٻڠڣگ‬                 ‫ٻۏۍۊۋۀڭٻۇڼھۄۉۃھۀگٻڠڞڤڠڤ‬ࣾஂ๏ਓ ిࢠ৘ใ௨৴ֶձ
৴ֶٕใ‫ٻڮڭڠڠکڤڢکڠٻکڪڤگڜڞڤکڰڨڨڪڞٻڟکڜٻکڪڤگڜڨڭڪڡکڤ‬            ‫ٻڄڌڋڈڐڌڋڍڃڎڑڈڏڌڋڍڡکڪڞڠڭڇڔڎڌڈڏڌڋڍڴڮګڞڇڋڎڌڈڏڌڋڍڟڧڱ‬THE INSTITUTE OF ELECTRONICS,TECHNICAL REPORT OF IEICE.
INFORMATION AND COMMUNICATION ENGINEERS‫ٻ‬

C ίϯύΠϥͷࢉज़࠷దԽΛର৅ͱͨ͠ςετεΠʔτ CF3೔ൺ໺༎྄†

ੴӜࡊ‫†ࠤذ‬† ؔ੢ֶӃେֶ ཧ޻ֶ෦ ˟ 669–1337 ฌ‫ֶࢢాࡾݝݿ‬Ԃ 2-1͋Β·͠ຊߘͰ͸, C ίϯύΠϥͷࢉज़࠷దԽ, ಛʹఆ਺৞ΈࠐΈΛର৅ͱͨ͠ςετεΠʔτ CF3 ΛఏҊ͢Δ.

C ίϯύΠϥ༻ϥϯμϜςετ Orange3 ͸, GCC ΍ LLVM/Clang ͷ࠷৽൛ͷෆ۩߹Λ‫ݕ‬ग़͢Δ‫ͳྗڧ‬ςετγεςϜ͕ͩ, ίϯύΠϥʹΑͬͯ͸ಉ͡ෆ۩߹Λ‫ݕ‬ग़͢ΔΤϥʔϓϩάϥϜ͕ଟ਺ੜ੒͞ΕΔͨΊ, ෆ۩߹ͷಛఆ͕ޮ཰
తʹߦ͑ͳ͍͜ͱ͕͋Δ. ຊߘͰ͸, Orange3 ͕ GCC ͷෳ਺ͷόʔδϣϯͰ‫ݕ‬ग़ͨ͠ΤϥʔϓϩάϥϜΛ࠷খԽ͢Δͱ, ࣜ਺ 1, ԋࢉ਺ 3 ఔ౓ͷখ͍͞΋ͷʹͳΔ͜ͱʹண໨͠, ͜ͷ‫ن‬໛ͷϓϩάϥϜΛͰ͖Δ‫ݶ‬Γ໢ཏతʹूΊΔ͜ͱʹΑΓςετεΠʔτ CF3 Λߏங͢Δ. CF3 ͸, 1 ͭͷࣜͷ‫ʹܗ‬ରͯ͠ม਺ͷ‫ܕ‬΍஋͕ҟͳΔ 100 ͷςετέʔεΛ

1 ϑΝΠϧʹऩ༰ͨ͠΋ͷΛ, 3 ԋࢉͰߏ੒Մೳͳશͯͷࣜͷ‫ ܗ‬10,985 ௨Γʹରͯ͠ੜ੒ͨ͠΋ͷͰ͋Δ. GCC ͱ
LLVM/Clang ͷෳ਺ͷόʔδϣϯͰ࣮‫ݧ‬Λߦͬͨ݁Ռ, ಉ࣌ؒ͡Ͱ Orange3 ΑΓ΋ଟ͘ͷύλʔϯͷΤϥʔΛ‫ݕ‬ग़͢
Δ͜ͱ͕Ͱ͖ͨ.
ΩʔϫʔυίϯύΠϥ, ςετεΠʔτ, ϥϯμϜςετ

CF3: Test Suite for Arithmetic Optimization of C Compilers
Yusuke HIBINO† and Nagisa ISHIURA†† Kwansei Gakuin University, Gakuen 2–1, Sanda, Hyogo, 669–1337, Japan
Abstract This article presents a compiler test suite “CF3,” which targets arithmetic optimization, especially constant folding, of C compilers. While Orange3 is a random test system which has detected bugs in the latest versionsof GCC and LLVM/Clang, it may generate, for some compilers, many long error programs which detect the same
bugs repeatedly. A new test suite CF3 is based on an obervation that most of the error programs which Orange3
found on GCCs have been reduced to small programs, each consisting of a single expression with 3 operations. CF3
consists of 10,985 ﬁles, which cover all the possible expression patterns build up with 3 operations, and each ﬁlecontains 100 cases to test optimization for the expression pattern with diﬀerent types and initial values of 4 variables.
Experiments on GCC and LLVM/Clang show that CF3 detects more error program patterns than Orange3 within
the same computation time.
Key words Compiler, Test suite, Randomtest౳ʹԠ༷ͯ͡ʑͳ΋ͷ͕͋Δ. C ίϯύΠϥΛର৅ͱͨ͠΋ͷ

1. ͸ ͡ Ί ʹͱͯ͠͸, ։ൃॳ‫ظ‬ஈ֊ͷίϯύΠϥΛର৅ͱͨ͠ testgen2 [1],ίϯύΠϥ͸ιϑτ΢ΣΞ։ൃʹ͓͚Δ‫ج‬൫πʔϧͰ͋Γ,

GCC ͷ༷ʑͳ‫ػ‬ೳͷςετΛ໨తͱ͢Δ GCC ෇ଐͷςετͦͷෆ۩߹͸ιϑτ΢ΣΞͷ։ൃͷ޻‫ظ‬΍৴པੑʹॏେͳӨ‫ڹ‬εΠʔτ [2], C ‫ޠݴ‬ͷ‫ʹ֨ن‬ରԠ͍ͯ͠Δ͔Λ‫͢ূݕ‬Δ PlumΛ‫͢΅ٴ‬. ৴པੑͷ֬อͷͨΊ, ίϯύΠϥʹ͸పఈతͳςεHall [3], ঎༻ͷίϯύΠϥධՁαʔϏεͷςετεΠʔτ [4]τ͕ඞཁʹͳΔ.

౳͕͋Δ.

ίϯύΠϥͷςετ͸, ਖ਼͍͠ϓϩάϥϜΛΤϥʔΛग़ͣ͞ίϯύΠϥͷϥϯμϜςετ͸ϥϯμϜʹੜ੒ͨ͠ϓϩάʹίϯύΠϧͰ͖, ͞Βʹੜ੒͞Εͨίʔυͷ࣮ߦ݁Ռ͕ਖ਼͠

ϥϜʹΑΓςετΛߦ͏ख๏Ͱ͋Δ. ςετεΠʔτ͸‫ݶ‬ΒΕ͍͔Ͳ͏͔Λ֬ೝ͢Δ͜ͱʹΑΓߦ͏. ίϯύΠϥͷςετ

ͨຊ਺ͷϓϩάϥϜͰςετΛߦ͏ͷʹର͠, ϥϯμϜςετ

ʹ͸, ਺ઍ͔Β਺ेສຊͷςετϓϩάϥϜ͔Β੒ΔςετεͰ͸࣌ؒͷ‫ݶ͢ڐ‬Γଟ͘ͷϓϩάϥϜͰςετΛߦ͏ͨΊ, ςΠʔτΛ༻͍Δ͕, ςετεΠʔτͰൃ‫͍ͳ͖Ͱݟ‬ෆ۩߹Λ‫ݕ‬ετεΠʔτͰ‫ݕ‬ग़Ͱ͖ͳ͔ͬͨෆ۩߹Λ‫ݕ‬ग़Ͱ͖Δ͜ͱ͕͋ग़͢ΔͨΊʹϥϯμϜςετ͕ߦΘΕΔ͜ͱ΋͋Δ.

Δ. ίϯύΠϥͷϥϯμϜςετ΋, ςετͷର৅ʹΑ༷ͬͯʑίϯύΠϥͷςετεΠʔτʹ͸, ໨త΍ίϯύΠϥͷ‫׬‬੒౓ͳ΋ͷ͕ఏҊ͞Ε͍ͯΔ. ؔ਺‫ͼݺ‬ग़͠ʹ͓͚ΔҾ਺΍ฦΓ஋

- 117 -

—1—

This article is a technical report without peer review, and its polished and/or extended version may be published elsewhere.

Copyright ©2015 by IEICE

2. 2 ίϯύΠϥͷϥϯμϜςετ

౳ͷ‫ن‬໿Λର৅ͱ͢Δ quest [5], volatile એ‫͞ݴ‬Εͨม਺Λର৅ͱ͢Δ randprog [6], ഑ྻ΍ߏ଄ମ, for จ΍ while จ౳༷ʑίϯύΠϥͷϥϯμϜςετͷྲྀΕΛਤ 1 ʹࣔ͢. ·ͣϥϯͳߏจΛର৅ͱ͢Δ Csmith [7], ࢉज़ࣜͷ࠷దԽΛର৅ͱͨ͠

μϜʹϓϩάϥϜΛੜ੒͠, ͦΕΛςετର৅ͷίϯύΠϥͰ

Orange3 [8] ౳͕͋Δ.

ίϯύΠϧ͠, ࣮ߦ͢Δ. ࣮ߦ݁Ռ͕ਖ਼͘͠ͳ͚Ε͹Τϥʔϓ

Orange3 ͸, GCC ΍ LLVM/Clang ͷ࠷৽൛ͷෆ۩߹Λ‫ݕ‬ग़͢Δ‫ͳྗڧ‬ςετγεςϜͰ͋Δ. ͔͠͠, ‫ن‬໛ͷେ͖ͳΤϩάϥϜͱͯ͠อଘ͢Δ. ͜ͷૢ࡞Λ, ࢦఆͨ͠ճ਺·ͨ͸࣌ؒ‫܁‬Γฦ͠ߦ͏.

ϥʔϓϩάϥϜ͕ଟ਺ੜ੒͞Εͨ৔߹ʹ͸, ͦͷղੳʹେ͖ͳwhile (ࢦఆ࣌ؒ or ࢦఆճ਺) {ςετϓϩάϥϜΛϥϯμϜʹੜ੒;ίϯύΠϧ & ࣮ߦ;
if (Τϥʔ) { ‫ه‬࿥;}}ΤϥʔϓϩάϥϜͷղੳ;࿑ྗΛཁ͢Δ. ΤϥʔϓϩάϥϜͷ࠷খԽ͸ࣗಈతʹߦ͏͜ͱ
͕Ͱ͖Δ͕࣌ؒΛཁ͢Δ. ·ͨ, ෳ਺ͷϓϩάϥϜ͕ಉ͡ෆ۩
߹Λ‫܁‬Γฦ͠‫ݕ‬ग़͢Δ͜ͱ͕͋ΔͨΊ, ‫׬‬੒౓͕͋·Γߴ͘ͳ͍ίϯύΠϥ΁ͷద༻͸ඞͣ͠΋ޮ཰తͰ͸ͳ͍.

ਤ 1 ίϯύΠϥͷϥϯμϜςετͷྲྀΕͦ͜ͰຊߘͰ͸, Orange3 ͕ੜ੒͢ΔϓϩάϥϜʹ‫͖ͮج‬, CίϯύΠϥͷࢉज़࠷దԽΛର৅ͱͨ͠ςετεΠʔτ CF3 ΛఏҊ͢Δ. Orange3 Λ༻͍ͯ GCC ͷෳ਺ͷόʔδϣϯͰ‫ݕ‬ग़ͨ͠ΤϥʔϓϩάϥϜͷ෼ੳʹ‫͍ͯͮج‬, ςετεΠʔτͷઃ‫ܭ‬Λߦͬͨ. ‫ݕ‬ग़͞ΕͨΤϥʔϓϩάϥϜͷଟ͘͸, ࠷খԽ͢Δͱࣜ਺ 1, ԋࢉ਺ 3 ఔ౓ͷখ͞ͳ΋ͷʹͳΔ͜ͱʹண໨͠, ͜ͷ‫ن‬໛ͷϓϩάϥϜΛͰ͖Δ‫ݶ‬Γ໢ཏతʹूΊΔ͜ͱʹΑΓς

Csmith [7] ͸, GCC ͓Αͼ LLVM/Clang ʹ͓͍ͯ, 3 ೥ؒͰ ໿ 325 ‫ݸ‬ͷෆ۩߹Λ‫ݕ‬ग़ͨ͠. ‫ݕ‬ग़ͨ͠ෆ۩߹ͷଟ͕͘

tree-optimization (SSA ‫ࣜܗ‬Λར༻ͨ͠࠷దԽ) ʹؔ͢Δ΋ͷͰ͋Γ, ࢉज़࠷దԽ͸ॏཁͳςετର৅Ͱ͋Δ. Orange3 ͸ࢉज़࠷దԽΛର৅ͱ͢ΔςετΛߦ͓ͬͯΓ, ΤϥʔϓϩάϥϜͷ
࠷খԽΛ༰қʹߦ͏͜ͱ͕Ͱ͖, Τϥʔͷ‫ݪ‬ҼΛಛఆ͠΍͍͢.

ετεΠʔτ CF3 Λߏங͢Δ. CF3 ͸, 1 ͭͷࣜͷύλʔϯʹ

2. 3 Orange3ରͯ͠ม਺ͷ‫ܕ‬΍஋͕ҟͳΔ 100 ‫ݸ‬ͷςετέʔεΛ 1 ϑΝOrange3 ʢ஫ 1ʣ [8] ͸ࢉज़࠷దԽΛର৅ͱ͢Δ C ίϯύΠϥͷ

Πϧʹऩ༰ͨ͠΋ͷΛ, 3 ԋࢉͰߏ੒Մೳͳશͯͷࣜͷύλʔϯ 10,985 ௨Γʹରͯ͠ੜ੒ͨ͠΋ͷͰ͋Δ.

ϥϯμϜςετͰ͋Γ, GCC ͓Αͼ LLVM/Clang ͷ࠷৽൛Ͱෆ۩߹Λ‫ݕ‬ग़͍ͯ͠Δ. ෳ਺ͷࢉज़ࣜΛ‫ؚ‬ΉϓϩάϥϜΛϥ

CF3 Λ༻͍ͯ, GCC ΍ LLVM/Clang ౳ͷςετΛߦͬͨ݁Ռ, ಉ࣌ؒ͡Ͱ Orange3 ΑΓ΋ଟ͘ͷύλʔϯͷΤϥʔΛ‫ݕ‬ग़͢Δ͜ͱ͕Ͱ͖ͨ.

ϯμϜʹੜ੒͠, ࣮ߦ݁Ռͱ͋Β͔͡Ί‫ظͨ͠ࢉܭ‬଴஋Λൺֱͯ͠Τϥʔ൑ఆΛߦ͏. ‫ظ‬଴஋‫ࢉܭ‬ͷաఔͰະఆٛಈ࡞ΛҾ͖‫͢͜ى‬෦෼ࣜΛमਖ਼͢Δ͜ͱ͕Ͱ͖ΔͨΊ, ະఆٛಈ࡞Λ‫·ؚ‬ҎԼ, ຊߘͰ͸, 2 ষͰίϯύΠϥͷςετʹ͍ͭͯ, 3 ষͰͳ͍ϓϩάϥϜͷੜ੒͕ՄೳͰ͋Δ.

Orange3 ʹΑΔΤϥʔϓϩάϥϜͷ෼ੳʹ͍ͭͯड़΂Δ. 4 ষͰ͸ఏҊ͢Δ CF3 ςετεΠʔτʹ͍ͭͯड़΂, 5 ষͰ࣮‫݁ݧ‬ՌΛड़΂Δ. ࠷‫ ʹޙ‬6 ষͰ·ͱΊͱࠓ‫ޙ‬ͷ՝୊Λड़΂Δ.

Orange3 ͕ੜ੒͢ΔςετϓϩάϥϜͷྫΛ ਤ 2 ͷ (a) ʹ
ࣔ͢. 806–1139 ߦ໨ʹࢉज़͕ࣜ͋Γ, 1141–1473 ߦ໨ͷ෦෼Ͱ‫ظ‬଴஋ͱൺֱΛߦ͍ͬͯΔ. 5–579 ߦ໨ͱ 582–804 ߦ໨Ͱ͸ม਺ͷએ‫ݴ‬Λߦ͍, ॳ‫ظ‬஋Λઃఆ͍ͯ͠Δ.

2. ίϯύΠϥͷςετ

Orange3 ͕ੜ੒͢ΔϓϩάϥϜ͸, ද 1 ʹࣔͨ͠ཁૉΛ‫ؚ‬ΉίϯύΠϥͷςετ͸, ςετର৅ͷίϯύΠϥ͕ର৅ͱ͢
Δ‫هͰޠݴ‬ड़͞ΕͨϓϩάϥϜΛίϯύΠϧ͠, ࣮ߦͯ͠ಘΒ
ΕΔ݁Ռ͕‫ظ‬଴͢Δ΋ͷͰ͋Δ͔Λ֬ೝ͢Δ͜ͱʹΑΓߦ͏.
ίϯύΠϥͷ‫ػ‬ೳΛςετ͢ΔͨΊʹ͸, ඞવతʹ๲େͳ਺ͷςετϓϩάϥϜ͕ඞཁͱͳΔ.

ෳ਺ͷࢉज़ࣜͰߏ੒͞ΕΔ. ม਺ͷ‫ܕ‬͸, 8 bit ͔Β 64 bit ͷූ߸෇͖/ූ߸ͳ͠ͷ੔਺‫ͱܕ‬, 32 bit ͔Β 128 bit ͷුಈখ਺఺‫͋Ͱܕ‬Δ. ม਺ͷॳ‫ظ‬஋͸, ֤ม਺ͷ‫ܕ‬ͷ࠷খ஋͔Β࠷େ஋,म০ࢠ͸, ʮconstʯ, ʮvolatileʯ, ʮconst volatileʯ, ʮ෇Ճ͠ͳ͍ʯ ͷ 4 ͔ͭΒϥϯμϜʹબ୒͢Δ. ·ͨ, ࢖༻͢Δԋࢉ

2. 1 C ίϯύΠϥ༻ςετεΠʔτࢠ͸දʹࣔ͢ 18 ‫͋Ͱݸ‬Δ.

C ίϯύΠϥ༻ͷςετεΠʔτʹ͸໨తʹԠ༷ͯ͡ʑͳ΋
ද1ͷ͕͋Δ. testgen2 [1] ͷςετεΠʔτ͸։ൃॳ‫ظ‬ஈ֊Ͱͷ

Orange3 ͕ੜ੒͢ΔϓϩάϥϜͷཁૉม਺ͷ‫( ܕ‬signed/unsigned) char, short, int, long,࢖༻Λ૝ఆ͓ͯ͠Γ, ‫ج‬ຊతͳߏจͷίϯύΠϧΛςετ͢Δlong long, float, double, long double໿ 13,000 ͷϑΝΠϧͰߏ੒͞Ε͍ͯΔ. GCC ෇ଐͷςετε

஋ͷൣғ ֤ม਺ͷ‫ܕ‬ͷ࠷খ஋ʙ࠷େ஋

Πʔτ [2] ͸, GCC ͷ༷ʑͳ‫ػ‬ೳΛςετ͢Δ໿ 2,500 ͷϑΝम০ࢠΠϧ͔Βߏ੒͞Ε, ෆ۩߹ͱͯ͠ใࠂ͞ΕͨςετϓϩάϥϜ

ԋࢉࢠΛॱ࣍௥Ճ͍ͯ͠Δ. Plum Hall [3] ͱίϯύΠϥධՁαʔϏconst, volatile, const volatile+, -, *, /, %, <<, >>, ==, !=, <, >,<=, >=, &&, ||, |, &, ^εͷςετεΠʔτ [4] ͸঎༻ͷίϯύΠϥ༻ςετεΠʔτͰ͋Δ. Plum Hall [3] ͸ίϯύΠϥ͕ ANSI/ISO C ‫ʹ֨ن‬ର

2. 4 Orange3 ʹ͓͚ΔΤϥʔϓϩάϥϜͷ࠷খԽ

Ԡ͍ͯ͠Δ͔Λ‫͢ূݕ‬Δ໿ 750 ຊͷςετϓϩάϥϜͰߏ੒͞ϥϯμϜςετͰੜ੒͞ΕΔϓϩάϥϜ͸, ਺ઍߦʙ਺ສߦ

Ε͍ͯΔ. ίϯύΠϥධՁαʔϏεͷςετεΠʔτ [4] ͸࠷ऴతͳ඼࣭ධՁʹ༻͍ΒΕ, ໿ 305,000 ຊͷςετϓϩάϥϜ
Ͱߏ੒͞Ε͍ͯΔ.

ʢ஫ 1ʣɿOrange3 ͸, http://github.com/ishiura-compiler/orange3 Ͱެ։͞Ε͍ͯΔ.

- 118 -

—2—

ද2

testgen2 ͱ Orange3 ͷΤϥʔ‫ݕ‬ग़ίϯύΠϥ

testgen2 [1]#err

0001: #include<stdio.h>0002: #define OK() printf("@OK@")
0003: #define NG() printf("@NG@")
0004:
0005: volatile unsigned char x0 = 15U;
0006: static volatile signed int x2 = -7421;
0007: unsigned long long x3 = 428827LLU;
···
···
0580:
0581: int main(void) {0582:
static signed char x1 = 2;0583:
static const signed char x5 = 1;0584:
static volatile signed long x9 = -3533585L;
···
···
0805:
0806:
t0 = ((x1044<<((x942%(((x1140+k2232)
0807:>>x1885)+k2233))+k2234))*t352);
0808:
t1 = (((x494+k1627)>>x1626)%((x1113
0809:+k1629)>>((x478>>x800)+k1628)));0810:
t2 = (((x252%(x387-x1550))+k1729)0811:>>(((x995+k1727)>>x1027)+k1728));
···
···
1138:
t390 = (t277>>((x876+k1812)>>1139:((x613<<((x456/x142)+k1810))+k1811)));
1140:
1141:
if (t0 == 24U) { OK(); } else { NG(); }1142:
if (t1 == 0) { OK(); } else { NG(); }1143:
if (t2 == 0LU) { OK(); } else { NG(); }
···
···
1473:
if (t390 == 0) { OK(); } else { NG(); }
1474:
1475:
return 0;1476: }

Orange3 [8] (24h)#pat(#err)

GCC-4.3

0

8

(52)

GCC-4.4

0

6

(43)

GCC-4.5

0

5

(29)

GCC-4.6

0

16

(37)

GCC-4.7

0

5

(41)

GCC-4.8

02(4)

GCC-4.900(0)Target: x86 64-apple-darwin13

ʹ‫͕͋ͱ͜Ϳٴ‬ΔͨΊ, ෆ۩߹ͷ‫ݪ‬ҼͷಛఆΛ༰қʹ͢ΔͨΊʹ͸, ςετϓϩάϥϜͷ࠷খԽ͕ෆՄܽͰ͋Δ. ࠷খԽͱ͸,ΤϥʔϓϩάϥϜʹ͓͍ͯ, Τϥʔʹؔ܎͢ΔՕॴҎ֎Λ࡟আͯ͠ϓϩάϥϜΛͰ͖Δ‫ݶ‬Γখ͘͢͞Δ͜ͱͰ͋Δ.

Orange3 ͸, ΤϥʔϓϩάϥϜͷ࠷খԽΛࣗಈͰߦ͏. ͜Ε͸, ҎԼͷૢ࡞ΛͦΕҎ্ద༻Ͱ͖ͳ͘ͳΔ·Ͱ‫܁‬Γฦ͢͜ͱʹΑΓ࣮‫͍ͯ͠ݱ‬Δ.

•ࣜͷ਺Λ‫ݮ‬Β͢.

•ఆ਺৞ࠐΈΛߦͬͯԋࢉΛ‫ݮ‬Β͢.

•ఆ਺ͷઈର஋ΛͰ͖Δ‫ݶ‬Γখ͘͢͞Δ.

•

static, volatile ౳ͷम০ࢠΛͰ͖Δ‫ݶ‬Γ͢Δ࡟আ͢Δ.

•

άϩʔόϧม਺ΛͰ͖Δ‫ݶ‬ΓϩʔΧϧม਺ʹ͢Δ.

(a) Orange3 ͕ग़ྗ͢ΔϓϩάϥϜͷྫΤϥʔϓϩάϥϜͷ࠷খԽʹ͸, 1 ͭͷϓϩάϥϜʹ͖ͭ਺

01: #include<stdio.h>
02: #define OK() printf("@OK@")
03: #define NG(fmt,val) printf("@NG@")04:
05: int main(void) {06:
volatile int x1430 = 31;
07:
volatile int x495 = 1;08:
09:t136 = (x495%(((int)2>>x1430)+(int)2147483647))10:11:
if (t136 == 1) { OK(); } else { NG(); }12:return 0;13:}ेඵ͔Β਺े෼ͷ͕࣌ؒͨΊ, ΤϥʔϓϩάϥϜ͕ଟ͍৔߹ʹ(b) (a) Λ࠷খԽͯ͠ಘΒΕΔϓϩάϥϜ

ਤ 2 ͷ (b) ͸, (a) ͷϓϩάϥϜΛ࠷খԽͨ͠ྫͰ͋Δ. ࠷খԽʹΑͬͯ 1475 ߦ͋ͬͨϓϩάϥϜ͕ 13 ߦʹ࡟‫͞ݮ‬Ε͍ͯΔ. ࠷খԽલʹ͸ 390 ‫ࢉͨͬ͋ݸ‬ज़͕ࣜ, ࠷খԽ‫ޙ‬ͷ (b) Ͱ͸ 9 ߦ໨ͷ 1 ‫͓ͯͬͳʹ͚ͩݸ‬Γ, 1 ࣜதͷԋࢉ਺΋ 3 ͭʹ·Ͱ‫͍ͯͬݮ‬Δ. ·ͨ, ఆ਺ͷઈର஋΋খ͘͞ͳ͓ͬͯΓ, ෆཁͳstatic ΍ volatile ౳ͷम০ࢠ΋࡟আ͞Ε͍ͯΔ.

͸ඇৗʹ͕͔͔࣌ؒͬͯ͠·͏. ·ͨ, ଟ͘ͷΤϥʔϓϩάϥਤ2Orange3 ͷςετϓϩάϥϜ

ද3ࣄલ࣮‫ ͍ͨ༻ʹݧ‬C ίϯύΠϥ

ϜΛ࠷খԽͨ݁͠Ռ͕ಉ͡‫ܗ‬ͷϓϩάϥϜʹͳΔ, ଈͪ, ϥϯμϜςετͰಉ͡ෆ۩߹͕Կ౓΋‫ݕ‬ग़͞ΕΔ͜ͱ΋ଟ͍.
ද 2 ͸, testgen2 ͱ Orange3 Ͱ, GCC ͷόʔδϣϯ 4.3 ʙίϯύΠϥVersion

4.9 (λʔήοτ͸͍ͣΕ΋ x86 64-apple-darwin13) ͷςετLLVM-GCC

4.2

i686-apple-darwin10

Λߦͬͨ݁ՌͰ͋Δ. ʮtestgen2ʯͷʮ#errʯ͸, testgen2 ʹ

GCC

4.0

i386-apple-darwin10

GCC

4.2

i386-apple-darwin10

GCC

4.4

i686-linux-gnu

GCC

4.4

x86 64-apple-darwin13.4

ΑΓ‫ݕ‬ग़͞ΕͨΤϥʔ਺Λࣔ͢. testgen2 Ͱ͸ GCC ͷ͜ΕΒͷόʔδϣϯͰΤϥʔ͸‫ݕ‬ग़͞Εͳ͍. ʮOrange3ʯͷʮ#patʯTarget͸ Orange3 Ͱ 24 ࣌ؒςετΛߦͬͨࡍʹΤϥʔΛ‫ݕ‬ग़ͨ͠ϓϩάϥϜͷύλʔϯ਺, ʮ#errʯ͸ΤϥʔΛ‫ݕ‬ग़ͨ͠ϓϩάͣ, Orange3 ͕ෆ۩߹Λ‫ݕ‬ग़ͨ͠ΤϥʔϓϩάϥϜͷ෼ੳΛϥϜͷ૯਺Λ͍ࣔͯ͠Δ. GCC ͷ৽͍͠όʔδϣϯͷΑ͏ʹߦͬͨ.

‫׬‬੒౓͕ߴ͍ίϯύΠϥͰ͸, ‫ݕ‬ग़͞ΕΔΤϥʔ͕গͳ͍ͨΊ,෼ੳ͸, ද 3 ͷ 5 ͭͷίϯύΠϥʹରͯ͠ߦͬͨ. ͜ΕΒͷಘΒΕͨΤϥʔϓϩάϥϜΛ 1 ͭ 1 ͭ࠷খԽͯ͠ղੳ͢Ε͹ίϯύΠϥ͸, ຊߘͰఏҊ͢ΔςετεΠʔτ͕λʔήοτͱΑ͍. ͔͠͠, ͜ΕΑΓ௿͍όʔδϣϯͷΑ͏ʹ, ಉ͡ύλʔϯͯ͠૝ఆ͢ΔϨϕϧ‫׬‬੒౓ͷ΋ͷͰ͋Δ.

ͷΤϥʔϓϩάϥϜ͕ଟ਺ੜ੒͞ΕΔ৔߹ʹ͸, ςετͷޮ཰΋Τϥʔղੳͷޮ཰΋ѱ͘ͳͬͯ͠·͏.

Orange3 ͕ੜ੒͢Δ 1 ສຊͷϓϩάϥϜͰςετΛߦ͍, ‫ݕ‬ग़ͨ͠ΤϥʔϓϩάϥϜͷ࠷খԽΛߦͬͨ. ෼ੳ݁ՌΛද 4 ʹ
ࣔ͢. දதͷʮ#patʯ͸࠷খԽͨ͠ΤϥʔϓϩάϥϜͷύλʔ

3. Orange3 ʹΑΔΤϥʔϓϩάϥϜͷ෼ੳϯ਺Λ, ʮ(#err)ʯ͸ΤϥʔΛ‫ݕ‬ग़ͨ͠ϓϩάϥϜͷ૯਺ΛࣔຊߘͰ͸, Orange3 ͕ੜ੒͢ΔςετϓϩάϥϜΛ‫ʹݩ‬, ς

͢. ΤϥʔϓϩάϥϜͷύλʔϯ਺͸, ΤϥʔϓϩάϥϜதͷετεΠʔτΛ࡞੒͢Δ͜ͱΛ໨ࢦ͢. ͜ͷ໨తͷͨΊʹ, ·- 119 -

—3—

ද 4 ࣄલ࣮‫( ݧ‬Orange3 ͕‫ݕ‬ग़ͨ͠ෆ۩߹ͷ෼ੳ݁Ռ)ίϯύΠϥ(λʔήοτ)ࣜ਺#pat (#err)

op ਺

1

ଞ

2

3

4

ଞ

ม਺ͷॳ‫ظ‬஋

staticvolatile

global

(සग़ॱ)

ͷׂ߹

ͷׂ߹

ͷׂ߹

LLVL-GCC-4.2 (i686-apple-darwin10)

53

(150)

100 %

0%

12 %

40 %

25 %

23 %

1, 3, 0, 2, 8, ʜ

23%

10%

18%

GCC-4.0 (i386-apple-darwin10)

79

(162)

100 %

0%

8%

35 %

20 %

37 %

1, 2, 0, 3, 31, ʜ

2%

6%

11%

GCC-4.2 (i686-apple-darwin10)

21

(37)

100 %

0%

8%

42 %

32 %

18 %

1, MAX, 0, 3, 2, ʜ

0%

10%

15%

GCC-4.4 (i686-linux-gnu)

37

(94)

100 %

0%

15 %

46 %

22 %

17 %

1, 2, 31, 0, 8, ʜ

25%

50%

25%

GCC-4.4 (x86 64-apple-darwin13.4)

14

(37)

100 %

0%

10 %

45 %

33 %

12 %

1, 0, 2, 8, −1, ʜ

10%

30%

23%

ࢉज़ࣜͷ‫͕ܗ‬ಉ͡Ͱ͋Ε͹ 1 ͭͱ਺͑ͨ΋ͷͰ͋Δ. ʮࣜ਺ʯ෇Ճ͠, ֤ม਺͸ 20%ͷ֬཰Ͱάϩʔόϧม਺ͱͯ͠એ‫͢ݴ‬Δ.

͸, ࠷খԽͷ݁Ռࣜ਺͕ 1 ͋Δ͍͸ͦͷଞͱͳͬͨΤϥʔϓϩ

ද 5 CF 3 ςετεΠʔτͷॾ‫ݩ‬άϥϜͷׂ߹Λࣔ͢. ʮop ਺ʯ͸, ࠷খԽͨ͠ΤϥʔϓϩάϥϑΝΠϧ਺

10,985Ϝதͷࣜʹ‫·ؚ‬ΕΔԋࢉࢠͷ਺͕ 2, 3, 4, ͓ΑͼͦΕΑΓଟ͍

1 ϑΝΠϧதͷςετ਺100΋ͷͷׂ߹Λࣔ͢. ʮม਺ͷॳ‫ظ‬஋ʯ͸, ΤϥʔϓϩάϥϜத

1 ςετέʔεதͷࣜ1ʹग़‫ͨ͠ݱ‬ม਺ͷॳ‫ظ‬஋ͷ͏ͪ, ग़‫ݱ‬ස౓͕ߴ͍΋ͷΛॱʹฒ

1 ࣜதͷԋࢉࢠ਺3

ԋࢉࢠ+, -, *, /, %, <<, ==, !=, <, <=,΂ͨ΋ͷͰ͋Δ. static, volatile, globel ͷׂ߹͸, Τϥʔϓϩ&, |, ^

άϥϜதʹ‫ݱ‬Εͨશม਺ͷ͏ͪ, ͦΕͧΕ͕ग़‫߹ׂͨ͠ݱ‬Λࣔม਺ͷ‫ܕ‬

int8 t, int16 t, int32 t, int64 t,

͍ͯ͠Δ.

uint8 t, uint16 t, uint32 t, uint64 tද 4 ΑΓҎԼ͕‫؍‬ଌ͞ΕΔ.

ॳ‫ظ‬஋

1, 2, 31, ֤੔਺ͷ‫ܕ‬ͷ࠷େ஋, ࠷খ஋•static, volatile֤ม਺ʹ 20 % Ͱ෇Ճάϩʔόϧม਺

֤ม਺ʹ 20 % Ͱग़‫ݱ‬࠷খԽʹΑΓશͯͷϓϩάϥϜͷࣜ਺͸ 1 ʹ࡟‫͞ݮ‬Ε,໿൒਺ͷෆ۩߹͸ 3 ԋࢉࢠ·Ͱͷࢉज़ࣜͰ‫ݕ‬ग़͞Ε͍ͯΔ.

•

ม਺ͷॳ‫ظ‬஋͸࠷খԽ͢Δͱ, 1, 2 ౳ͷখ͍͞஋΍ͦΕͧΕͷม਺ͷ‫ܕ‬ͷ࠷େ஋ʹͳΔ͜ͱ͕ଟ͍.

•static ม਺, volatile म০, άϩʔόϧม਺͸, શม਺ͷ

20 %ఔ౓ʹग़‫͢ݱ‬Δ.

ςετʹ༻͍Δԋࢉࢠ͸ 13 ௨ΓͳͷͰ, 3 ԋࢉͷશ૊߹ͤ͸

133 ௨Γଘࡏ͢Δ. ਤ 4 ʹࣔ͢Α͏ʹ, ԋࢉࢠ 3 ͭͷ૊߹ͤ 1ͭʹ͖ͭ 5 ௨Γͷࣜͷύλʔϯ͕ߏ੒ՄೳͳͷͰ, 133 × 5 =10,985 ϑΝΠϧͷςετϓϩάϥϜΛߏ੒͢Δ.

4. C ίϯύΠϥ༻ςετεΠʔτ CF3
ຊߘͰ͸, Orange3 ͕ੜ੒͢ΔςετϓϩάϥϜʹ‫ͮ͘ج‬ςετεΠʔτ CF3 ΛఏҊ͢Δ. CF3 ͸, 3 ԋࢉͷࢉज़ࣜΛ‫ؚ‬ΉςετϓϩάϥϜʹΑͬͯ C ίϯύΠϥͷࢉज़࠷దԽΛςετ͢Δ΋ͷͰ͋Γ, GCC ͷόʔδϣϯ 4.2 ʙ 4.4 ͷϨϕϧͷ‫׬‬੒౓ͷίϯύΠϥͷςετͷޮ཰ԽΛ໨తͱ͢Δ.

CF3 ͷςετϓϩάϥϜͷྫΛਤ 3 (a) ʹࣔ͢. CF3 ςετεΠʔτͰ͸, 1 ςετϓϩάϥϜʹ͖ͭ 3 ԋࢉͷ૊߹ͤ 1ύλʔϯͷςετΛ 100 έʔεऩ༰͢Δ. ͜ͷϓϩάϥϜͰ͸, 118, 129, 139, ʜ, 1308 ߦ໨ͷΑ͏ʹ, ((x1+x2)%x3)<x4ͱ͍͏ࣜͷύλʔϯʹରͯ͠, ༷ʑͳม਺ͷ‫ܕ‬΍஋ͰςετΛ
ߦ͍ͬͯΔ. ؔ਺ 1 ͭʹ ςετέʔεΛ 1 ͭ ऩ༰͓ͯ͠Γ,

ਤ 4 3 ԋࢉࢠͰߏ੒͞ΕΔࣜͷύλʔϯ

1313–1415 ߦ໨ͷϝΠϯؔ਺͔ΒͦΕΛ‫ͼݺ‬ग़͍ͯ͠Δ. ςετϓϩάϥϜΛ͜ͷΑ͏ͳߏ੒ʹ͢Δ͜ͱʹΑΓ, ΤϥʔΛ‫ݕ‬

1 ͭͷࣜʹม਺͸ 4 ͭ‫ݱ‬ΕΔͷͰ, ม਺ͷ‫( ܕ‬8 ‫ͱ )ݸ‬஋ (5ग़ͨ͠ࡍʹ, ͦͷࢉज़ࣜͷύλʔϯΛ༰қʹಛఆ͢Δ͜ͱ͕Ͱ‫ )ݸ‬ͷ૊߹ͤ͸ 84 × 54 ͷ 256 ສ௨Γଘࡏ͢Δ. ͜ͷ 256 ສ௨͖, ಉ͡ύλʔϯͷࢉज़ࣜͰԿ౓΋ΤϥʔΛ‫ݕ‬ग़͢Δ͜ͱΛ๷ΓશͯΛ໢ཏ͢Δͷ͸‫࣮ݱ‬తͰ͸ͳ͍ͷͰ, 1 ͭͷࣜͷύλʔϯ

͛Δ. ϔομϑΝΠϧ test1.h ͸, ෆ۩߹Λ‫ݕ‬ग़ͨ͠ࡍͷϚΫʹ͖ͭ, 100 ௨ΓͷςετΛߦ͏͜ͱʹ͢Δ. ͜ͷͨΊ, 1 ϑΝ

ϩ NG Λఆٛ͢Δ΋ͷͰ͋Γ, ྫ͑͹ਤ 3 ͷ (b) ͷΑ͏ʹॻΠϧ͸໿ 1,400 ߦͱͳΔ. ม਺ͷ‫ظॳͱܕ‬஋ͷ૊߹ͤ͸, ਤ 5

͚Δ.

ͷΑ͏ͳදΛ༻͍ͯະબ୒ͷ૊߹ͤΛબ୒͠, Ͱ͖Δ‫ݶ‬Γଟ͘ςετεΠʔτதͷ͓ࣜΑͼม਺ͷৄࡉΛද 5 ʹࣔ͢. ࣜதͷ‫ظॳͱܕ‬஋ͷ૊߹ͤΛΧόʔ͢ΔΑ͏ʹ͢Δ.

ʹग़‫͢ݱ‬Δม਺ͷ‫ܕ‬͸, 8, 16, 32, 64 bit ͷූ߸෇͖ͱූ߸ͳ͠

ςετੜ੒த, ࢉज़ࣜͷதʹະఆٛಈ࡞͕ग़‫ͨ͠ݱ‬৔߹͸, ͦͷ੔਺‫ܕ‬Λ༻͍Δ. ﬂoat ౳ͷුಈখ਺఺‫ܕ‬͸༻͍ͳ͍. ม਺ͷͷςετέʔεΛഁ‫͠غ‬, ผͷม਺ͷ‫ͱܕ‬஋ͷ૊߹ͤΛબ୒͠ॳ‫ظ‬஋͸, 1, 2, 31, ͓Αͼ֤੔਺‫ܕ‬ͷ࠷େ஋ͱ࠷খ஋ͷ 5 ‫ݸ‬Λͯ৽ͨͳࢉज़ࣜΛੜ੒͢Δ.

༻͍Δ. ·ͨ, static ‫ ͼٴ‬volatile ͸, ֤ม਺ʹ 20 %ͷ֬཰Ͱ- 120 -

—4—

10001: #include<stdio.h>0002: #include<stdint.h>
0003: #include"test1.h"0004:
0005: static volatile int32 t t0 = 0;0006: uint64 t x6 = 31LLU;
0007: uint64 t x10 = 31LLU;
0008: int32 t t2 = 1;
0009: int8 t x17 = 127;
0010: volatile int8 t x23 = 2;
0011:
···
0111:
0112: void f0(void) {0113:
int32 t x1 = -1;
0114:
volatile int64 t x2 = 31LL;
0115:
uint8 t x3 = 255U;
0116:
uint8 t x4 = 1U;
0117:
0118:
t0 = (((x1+x2)%x3)<x4);
0119:
0120:
if (t0 != 0) { NG(); }0121: }
0122:
0123: void f1(void) {0124:
volatile int8 t x5 = 2;0125:
uint8 t x7 = 255U;
0126:
uint16 t x8 = 1U;
0127:
static int32 t t1 = 1514369;
0128:
0129:
t1 = (((x5+x6)%x7)<x8);
0130:
0131:
if (t1 != 0) { NG(); }0132: }
0133:
0134: void f2(void) {0135:
uint64 t x9 = 2LLU;
0136:
static int16 t x11 = 2;0137:
static int64 t x12 = -1LL;
0138:
0139:
t2 = (((x9+x10)%x11)<x12);
0140:
0141:
if (t2 != 1) { NG(); }0142: }
0143:···
1302: void f99(void) {1303:
signed long long x437 = 1LL;
1304:
signed char x438 = 31;
1305:
volatile signed char x439 = 31;1306:
signed short x440 = -1;
1307:
1308:
t99 = (((x437+x438)%x439)<x440);
1309:
1310:
if (t99 != 0) { NG(); }1311: }
1312:
1313: int main(void) {
1314:
f0();
1315:
f1();
1316:
f2();
1317:
···
1413:
f99();
1414:
return 0;1415: }

uint8 t

int16 t···
ਤ 5 ม਺ͷ‫ظॳͱܕ‬஋ͷ໢ཏද
ද6 ࣮‫݁ݧ‬Ռ
ίϯύΠϥ

CPU

(Target)

time

CF3

Orange3[s]#pat#pat (#err)

LLVM-GCC-4.2 (a)

A

10896

18

22

GCC-4.0 (a)

A

5396

11

13

(42)
(40)

GCC-4.2 (a)

A

5562

9

7

(10)

GCC-4.4 (b)

C

5893

8

7

(23)

GCC-4.4 (c)

B

6264

13

2

(6)

LLVM/Clang-3.2 (d)

C

1962

18

9

(30)

LLVM/Clang-3.3 (a)

C

2887

13

4

(5)

TCC-0.9.26 (d)

C

129

0

0

(0)

GCC-4.9 (c)

B

8988

0

0

(0)

Target a: i686-apple-darwin10, b: i686-pc-linux
c: x86 64-apple-darwin13, d: i386-linux
CPU

A: Core 2 Duo 2.12GHz, B: Core i7 3.90GHz
C: Core i5 2.60GHz

ϥ (Target)ʯ͸, ςετର৅ͷίϯύΠϥΛࣔ͠, ʮtimeʯ͸,ςετͷ࣮ߦʹཁͨ࣌ؒ͠ (ඵ) Λࣔ͢. ʮCF3 #patʯ͸,CF3 ʹΑΓ‫ݕ‬ग़͞ΕͨΤϥʔϓϩάϥϜͷύλʔϯ਺Λࣔ͢.
ʮOrange3 #pat (#err)ʯ͸, CF3 ͱಉ࣌ؒ͡ Orange3 Λ༻͍ͯςετΛߦͬͨࡍʹ‫ݕ‬ग़ͨ͠ΤϥʔϓϩάϥϜͷύλʔϯ਺ͱΤϥʔϓϩάϥϜͷ૯਺Λ͍ࣔͯ͠Δ.
༧උ࣮‫͍ͨ༻ʹݧ‬ίϯύΠϥͰ͸, 5 ‫ݸ‬த 3 ‫ݸ‬ͷίϯύΠϥ
Ͱ Orange3 ΑΓ΋ଟ͘ͷΤϥʔͷύλʔϯΛ‫ݕ‬ग़Ͱ͖ͨ. ·ͨ, ༧උ࣮‫͔ͨͬͳ͍༻ʹݧ‬ίϯύΠϥ LLVM/Clang-3.2 ͱ

LLVM/Clang-3.3 Ͱ΋ Orange3 ΑΓଟ͘ͷΤϥʔͷύλʔϯΛ‫ݕ‬ग़Ͱ͖ͨ. TCC Ͱ͸, CF3, Orange3 ͱ΋ΤϥʔΛ‫ݕ‬ग़Ͱ͖ͳ͔͕ͬͨ, ͜Ε͸ TCC ͕΄ͱΜͲ࠷దԽΛߦ͍ͬͯͳ͍
ͨΊͱߟ͑ΒΕΔ.

6. Ή ͢ ͼຊߘͰ͸, C ίϯύΠϥͷࢉज़࠷దԽΛର৅ͱͨ͠ςετεΠʔτ CF3 ΛఏҊͨ͠. ఏҊͨ͠ςετεΠʔτΛ༻͍ͯ

GCC-4.4 ΍ LLVM/Clang-3.3 ౳Ͱ࣮‫ݧ‬Λߦͬͨ݁Ռ, ಉ࣌͡func )

ؒͰ, Orange3 ΑΓଟ͘ͷύλʔϯͷΤϥʔΛ‫ݕ‬ग़͢Δ͜ͱ͕(b) ϔομϑΝΠϧ test1.hਤ3

31 MIN MAX

uint16 t(a) ςετϓϩάϥϜͷྫ#define NG() printf("@NG@ /%s",2

int8 tͰ͖ͨ.

CF3 ͷςετϓϩάϥϜ

ςετεΠʔτͷΤϥʔ‫ݕ‬ग़ೳྗ͸, 1 ϑΝΠϧதͷςετ਺΍ม਺ͷॳ‫ظ‬஋ͱͯ͠༻͍Δ஋ͷू߹ͳͲʹґଘ͢Δ. ͜Ε

5. ࣮ ‫ ݁ ݧ‬ՌΒͷ༷ʑͳཁૉΛௐ੔͠, ςετεΠʔτͷޮ཰ΛߴΊΔ͜ͱຊߘͰఏҊ͢ΔςετεΠʔτ CF3 Λ, Orange3 ͷϥΠϒϥϦΛ༻͍ͯ Perl εΫϦϓτʹΑΓੜ੒ͨ͠.

͕ࠓ‫ޙ‬ͷ՝୊Ͱ͋Δ.
ँࣙ

CF3 Λ༻͍, ༧උ࣮‫͍ͨ༻ʹݧ‬ίϯύΠϥͱ༻͍ͳ͔ͬͨ
ίϯύΠϥΛςετ͢Δ࣮‫ݧ‬Λߦͬͨ. ݁ՌΛද 6 ʹࣔ͢.

ຊ‫ڀݚ‬ΛਐΊΔʹ͋ͨΓ, ଟ͘ͷ͝ॿ‫ݴ‬΍͝‫ྗڠ‬Λ௖͍ͨؔ੢ֶӃେֶཧ޻ֶ෦ ੴӜ‫ࣨڀݚ‬ͷॾࢯʹ‫͢·͠ँײ‬. ຊ‫ݚ‬‫ڀ‬͸Ұ෦Պֶ‫ڀݚ‬අิॿۚ (25330073) ʹΑΔ.

ಈ࡞‫ڥ؀‬͸, Mac OS X, Ubuntu Linux Ͱ͋Δ. ʮίϯύΠ- 121 -

—5—

จ

‫ݙ‬

[1] ৿ຊ࿨ࢤ, ಺ࢁ༟‫و‬, ੴӜࡊ‫ࠤذ‬, Ҿ஍৴೭: “C ίϯύΠϥ༻ςετεΠʔτੜ੒γεςϜ testgen2,” ৘ใॲཧֶձؔ੢ࢧ෦େ
ձ, A-6 (Oct. 2010).
[2] http://gcc.gnu.org/install/test.html.
[3] http://www.plumhall.com/suites.html.
[4] http://www.jnovel.co.jp/service/compiler/.
[5] Christian Lindig: “Find a Compiler Bug in 5 Minutes,”in Proc. ACM International Symposium on AutomatedAnalysis-Driven Debugging, pp. 3–12 (Sept. 2005).
[6] E. Eide and J. Regehr: “Volatiles Are Miscompiled, andWhat to Do about It,” in Proc. ACM International Conference on Embedded Software, pp. 255–264 (Oct. 2008).
[7] X. Yang, Y. Chen, E. Eide, and J. Regehr: “Finding andUnderstanding Bugs in C Compilers,” in Proc. ACM PLDI,
pp. 283–294 (June 2011).
[8] E. Nagai, A. Hashimoto, and N. Ishiura: “Reinforcing Random Testing of Arithmetic Optimization of C Compilers by
Scaling up Size and Number of Expressions,” IPSJ Trans.
SLDM, vol. 7, pp. 91–100 (Aug. 2014).
[9] ೔ ຊ ‫ ڠ ֨ ن‬ձ: ϓ ϩ ά ϥ Ϝ ‫ ޠ ݴ‬C JIS X 3010:2003(ISO/IEC9899:1999) (2003).

- 122 -

—6—