From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23819 invoked by alias); 3 Sep 2013 17:59:28 -0000 Mailing-List: contact gcc-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-owner@gcc.gnu.org Received: (qmail 23809 invoked by uid 89); 3 Sep 2013 17:59:28 -0000 Received: from alakarga.bcc.bilkent.edu.tr (HELO alakarga.bcc.bilkent.edu.tr) (139.179.10.226) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 03 Sep 2013 17:59:28 +0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.5 required=5.0 tests=AWL,BAYES_00,KHOP_THREADED,RDNS_NONE autolearn=no version=3.3.2 X-HELO: alakarga.bcc.bilkent.edu.tr Received: by alakarga.bcc.bilkent.edu.tr (Postfix, from userid 12346) id 8A6151BF37; Tue, 3 Sep 2013 20:59:24 +0300 (EEST) Received: from newmail.bilkent.edu.tr (unknown [192.168.25.218]) by alakarga.bcc.bilkent.edu.tr (Postfix) with ESMTP id 618571BF33; Tue, 3 Sep 2013 20:59:24 +0300 (EEST) Received: from 139.179.102.69 (SquirrelMail authenticated user tturhan@cs.bilkent.edu.tr) by newmail.bilkent.edu.tr with HTTP; Tue, 3 Sep 2013 20:59:24 +0300 Message-ID: In-Reply-To: References: Date: Tue, 03 Sep 2013 17:59:00 -0000 Subject: Modifying the values of Gimple Instruction Operands From: tturhan@cs.bilkent.edu.tr To: tturhan@cs.bilkent.edu.tr Cc: gcc@gcc.gnu.org User-Agent: SquirrelMail/1.4.22 MIME-Version: 1.0 Content-Type: text/plain;charset=utf-8 Content-Transfer-Encoding: 8bit X-SW-Source: 2013-09/txt/msg00024.txt.bz2 Sorry forgot to mention, my name is Tuncer. Again any help would be much appreciated. I know these maybe simple for some of you if you could lend me a hand, you will be doing a great deal of help. Changed the subject for better understanding, Thanks again guys :) > Hi, > > I am a student at Bilkent Uni. in Turkey and using GCC as a tool for my > M.S. Thesis which is about Software Fault Tolerance. > I am stuck, in terms of implementing bit flips in the operands of a gimple > statement. > > I need to inject bit flips to all kinds of operands, constant integers, > floats, variables, pointers etc... > > It is simpler for constants, but I am having a hard time to get the value > of pointers and other variables. > > My objective is to simply change the value of a tree operand, by injecting > a new instruction that changes the value or directly change the operand to > a bit flipped value. > > For constant integers I did something like this: > > int valueBefore = TREE_INT_CST_LOW(operands[i]); > int valueAfter = (valueBefore ^ (1u << 2)); tree number = > build_int_cst (integer_type_node, valueAfter); > > I would love it if you can help me and > may even implement a tool for GCC for error injection purposes. > > Any help would be much appreciated! > > Thank you very much! >