Project

General

Profile

Actions

Bug #1323

open

CIL doesn't appear to know GNU extension 'asm goto'

Added by Evgeny Novikov almost 13 years ago. Updated over 9 years ago.

Status:
Open
Priority:
Normal
Assignee:
Category:
CIL
Start date:
06/07/2011
Due date:
% Done:

0%

Estimated time:
Detected in build:
svn
Platform:
Published in build:

Description

Unfortunately, in compiling kernels with a new compiler like gcc 4.6.0 on which aspectator is based, we obtain constructions that cannot be parsed by CIL. For instance, in arch/x86/include/asm/cpufeature.h we have:
#if __GNUC__ > 4 || __GNUC_MINOR__ >= 5
        asm goto(... : : "i" (bit) : : t_no);
        return true;
    t_no:
        return false;
#else
        u8 flag;
        asm volatile(... : "=qm" (flag) : "i" (bit));
        return flag;
#endif

that leads to:
ZZZ: Exception: Frontc.ParseError("Parse error") 
.../inst/current/envs/linux-2.6.37/linux-2.6.37/arch/x86/include/asm/cpufeature.h[321:0-0] : syntax error Parsing error
Ack! The gremlins again!: Frontc.ParseError("Parse error") 
Fatal error: exception Frontc.ParseError("Parse error")

Possible ways of solution:
  1. Use options like for llvm aspectator that will prevent such constructions (the simplest way)
  2. Add some simplifications to C backend, e.g. to skip all 'asm goto's (it's harder)
  3. Add support of 'asm goto' to CIL (the hardest way)

Files


Related issues 1 (0 open1 closed)

Related to C Instrumentation Framework - Bug #1165: GCC-aspectator fails with fatal error: incorrect reference codeClosedEvgeny Novikov05/03/2011

Actions
Actions #1

Updated by Pavel Shved almost 13 years ago

By the way, CIL is older than gcc 4.5. :)

I'd suggest to mimic the old compiler's behavior.

Actions #2

Updated by Evgeny Novikov almost 13 years ago

  • Priority changed from Urgent to High

At the moment the first way was chosen, so the issue has gone away for some time...

Actions #3

Updated by Pavel Shved over 12 years ago

This problem is still there with the upstream CIL.

Also, attaching the file to check if it works (from tests for 43_1a). You should remove -DGNUC_VERSION from model-db.xml to see the errors.

Actions #4

Updated by Evgeny Novikov over 12 years ago

Shouldn't we report about this issue to CIL developers?

Actions #5

Updated by Evgeny Novikov almost 10 years ago

  • Assignee changed from Pavel Shved to Vadim Mutilin

Vadim, what is the status?

Actions #6

Updated by Hitesh Padekar almost 10 years ago

Is there any update on this issue, I am facing similar issue on CIL version 1.7.3

Actions #7

Updated by Vadim Mutilin over 9 years ago

  • Category changed from BLAST to CIL
Actions

Also available in: Atom PDF