Frama-C-discuss mailing list archives
This page gathers the archives of the old Frama-C-discuss archives, that was hosted by Inria's gforge before its demise at the end of 2020. To search for mails newer than September 2020, please visit the page of the new mailing list on Renater.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Frama-c-discuss] Transformation of if-statements
- Subject: [Frama-c-discuss] Transformation of if-statements
- From: virgile.prevosto at m4x.org (Virgile Prevosto)
- Date: Wed, 9 May 2012 17:59:05 +0200
- In-reply-to: <1336374957.3945.35.camel@iti27.informatik.htw-dresden.de>
- References: <1336374957.3945.35.camel@iti27.informatik.htw-dresden.de>
Hello Boris, 2012/5/7 Boris Hollas <hollas at informatik.htw-dresden.de>: > I noticed that the parser transforms if-else-statements such as > > int f6(int x, int y) { > ?if((x == 0 && y == 0) || (x == 1 && y == 1)) return 1; > ?else return 0; > } > > into more complex if-else/goto-statements. Why is this done? This calls for two separate answers. First, the transformation into nested ifs is here to take into account the potential side-effects of the expressions and ensure that they will be evaluated (or not) according to the rules of the C standard regarding logical operators. Second, in the general case, this transformation would include the duplication of the original then and else branch (which can be pretty big) into an exponential number of blocks. gotos ensure that the size of the normalized code doesn't grow too much. Best regards, -- E tutto per oggi, a la prossima volta Virgile
- Follow-Ups:
- [Frama-c-discuss] Transformation of if-statements
- From: hollas at informatik.htw-dresden.de (Boris Hollas)
- [Frama-c-discuss] Transformation of if-statements
- References:
- [Frama-c-discuss] Transformation of if-statements
- From: hollas at informatik.htw-dresden.de (Boris Hollas)
- [Frama-c-discuss] Transformation of if-statements
- Prev by Date: [Frama-c-discuss] C0: restricted C with annotations for teaching
- Next by Date: [Frama-c-discuss] Some unproved VCs occur while using wp
- Previous by thread: [Frama-c-discuss] Transformation of if-statements
- Next by thread: [Frama-c-discuss] Transformation of if-statements
- Index(es):