public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/56051] New: Wrong expression evaluation
@ 2013-01-20 11:46 olivier.gay at gmail dot com
  2013-01-20 12:24 ` [Bug c/56051] " glisse at gcc dot gnu.org
                   ` (11 more replies)
  0 siblings, 12 replies; 13+ messages in thread
From: olivier.gay at gmail dot com @ 2013-01-20 11:46 UTC (permalink / raw)
  To: gcc-bugs


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56051

             Bug #: 56051
           Summary: Wrong expression evaluation
    Classification: Unclassified
           Product: gcc
           Version: 4.7.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: olivier.gay@gmail.com


#include <stdio.h>

int main(void)
{
    int a, s = 8;
    unsigned char data[1] = {0};

    a = data[0] < (unsigned char) (1 << s);
    printf("%d\n", a);

    return 0;
}

The expression assigned to object a evaluates to 1 but I think it should
evaluate to 0. Tested on gcc 4.7.2 / Linux x64.


^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2013-04-12 16:29 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-01-20 11:46 [Bug c/56051] New: Wrong expression evaluation olivier.gay at gmail dot com
2013-01-20 12:24 ` [Bug c/56051] " glisse at gcc dot gnu.org
2013-01-20 14:11 ` [Bug middle-end/56051] " mikpe at it dot uu.se
2013-01-20 16:43 ` [Bug tree-optimization/56051] " jakub at gcc dot gnu.org
2013-01-20 16:46 ` jakub at gcc dot gnu.org
2013-01-20 18:09 ` glisse at gcc dot gnu.org
2013-01-20 18:35 ` jakub at gcc dot gnu.org
2013-01-20 20:17 ` glisse at gcc dot gnu.org
2013-01-21 17:56 ` jakub at gcc dot gnu.org
2013-01-21 18:02 ` jakub at gcc dot gnu.org
2013-02-01 14:12 ` jakub at gcc dot gnu.org
2013-02-01 14:33 ` jakub at gcc dot gnu.org
2013-04-12 16:29 ` jakub at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).