From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3734 invoked by alias); 29 Dec 2010 16:06:10 -0000 Received: (qmail 3724 invoked by uid 22791); 29 Dec 2010 16:06:08 -0000 X-SWARE-Spam-Status: No, hits=-1.0 required=5.0 tests=AWL,BAYES_20,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,RFC_ABUSE_POST,T_FRT_BELOW2,T_RP_MATCHES_RCVD,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: sourceware.org Received: from web62401.mail.re1.yahoo.com (HELO web62401.mail.re1.yahoo.com) (69.147.75.30) by sourceware.org (qpsmtpd/0.43rc1) with SMTP; Wed, 29 Dec 2010 16:06:04 +0000 Received: (qmail 84197 invoked by uid 60001); 29 Dec 2010 16:06:02 -0000 Message-ID: <879160.82545.qm@web62401.mail.re1.yahoo.com> Received: from [90.80.39.41] by web62401.mail.re1.yahoo.com via HTTP; Wed, 29 Dec 2010 08:06:02 PST Date: Wed, 29 Dec 2010 16:06:00 -0000 From: Alex Turjan Subject: frontend bug? To: gcc-bugs@gcc.gnu.org Cc: tjvries@xs4all.nl, tom@codesourcery.com MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2010-12/txt/msg02887.txt.bz2 Hi all, Im compiling the code bellow for x86 with gcc 4.4.3 and 4.5. Is it correct that at the end of main the value of variable b should have been 4? When executing I get value 3. #include "stdio.h" int *ptr; int inc(void){ (*ptr)++; return 1; } int main (void){ int a, b = 2; ptr = &b; b++ + inc() ; if(b==4) printf("correct\n"); else printf("incorrect %d\n",b); return 1; }