From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26900 invoked by alias); 9 Oct 2013 10:16:32 -0000 Mailing-List: contact gcc-help-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-help-owner@gcc.gnu.org Received: (qmail 26887 invoked by uid 89); 9 Oct 2013 10:16:31 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-2.8 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-lb0-f177.google.com Received: from mail-lb0-f177.google.com (HELO mail-lb0-f177.google.com) (209.85.217.177) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Wed, 09 Oct 2013 10:16:30 +0000 Received: by mail-lb0-f177.google.com with SMTP id w7so562539lbi.8 for ; Wed, 09 Oct 2013 03:16:27 -0700 (PDT) MIME-Version: 1.0 X-Received: by 10.152.120.73 with SMTP id la9mr5657872lab.3.1381313786964; Wed, 09 Oct 2013 03:16:26 -0700 (PDT) Received: by 10.112.101.7 with HTTP; Wed, 9 Oct 2013 03:16:26 -0700 (PDT) In-Reply-To: References: Date: Wed, 09 Oct 2013 10:16:00 -0000 Message-ID: Subject: Re: Crazy compiler optimization From: Jonathan Wakely To: vijay nag Cc: "gcc-help@gcc.gnu.org" Content-Type: text/plain; charset=ISO-8859-1 X-IsSubscribed: yes X-SW-Source: 2013-10/txt/msg00012.txt.bz2 On 9 October 2013 11:02, vijay nag wrote: > Alright that is perfectly valid behaviour. Why does compiler consider > it to be a unsigned type at optimization level zero ? It doesn't. > i.e. I see a > wrap around after > -128 to 128 ? Because undefined behaviour.