public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug rtl-optimization/21643] New: GCC fails to merge ranges in comparison.
@ 2005-05-18 12:32 dwmw2 at infradead dot org
  2005-05-18 12:33 ` [Bug rtl-optimization/21643] " dwmw2 at infradead dot org
                   ` (3 more replies)
  0 siblings, 4 replies; 8+ messages in thread
From: dwmw2 at infradead dot org @ 2005-05-18 12:32 UTC (permalink / raw)
  To: gcc-bugs

I'd expect the result of compiling these two functions to be identical, but it
isn't:

int fish1(unsigned char c)
{
        if (c =='"' || c == 0x20 || c < 0x20)
                return 1;
}
int fish2(unsigned char c)
{
        if (c == '"' || c <= 0x20)
                return 1;
}

If I remove the 'c == '"' ||' from each, I do get the expected results.
$ gcc -O2 -S asd.c -o /dev/stdout
        .file   "asd.c"
        .section        ".text"
        .align 2
        .p2align 4,,15
        .globl fish1
        .type   fish1, @function
fish1:
        mr 0,3
        li 3,1
        cmpwi 7,0,34
        cmpwi 6,0,32
        beqlr 7
        cmplwi 7,0,31
        beqlr 6
        blelr 7
        blr
        .size   fish1,.-fish1
        .align 2
        .p2align 4,,15
        .globl fish2
        .type   fish2, @function
fish2:
        mr 0,3
        li 3,1
        cmpwi 7,0,34
        cmplwi 6,0,32
        beqlr 7
        blelr 6
        blr
        .size   fish2,.-fish2
        .ident  "GCC: (GNU) 4.0.0 20050512 (Red Hat 4.0.0-5)"
        .section        .note.GNU-stack,"",@progbits

-- 
           Summary: GCC fails to merge ranges in comparison.
           Product: gcc
           Version: 4.0.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: rtl-optimization
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: dwmw2 at infradead dot org
                CC: gcc-bugs at gcc dot gnu dot org,jakub at redhat dot com


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


^ permalink raw reply	[flat|nested] 8+ messages in thread
[parent not found: <bug-21643-4@http.gcc.gnu.org/bugzilla/>]

end of thread, other threads:[~2012-10-31  8:52 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-05-18 12:32 [Bug rtl-optimization/21643] New: GCC fails to merge ranges in comparison dwmw2 at infradead dot org
2005-05-18 12:33 ` [Bug rtl-optimization/21643] " dwmw2 at infradead dot org
2005-05-18 12:39 ` [Bug tree-optimization/21643] " pinskia at gcc dot gnu dot org
2005-05-18 17:21 ` trt at acm dot org
2005-05-18 17:28 ` trt at acm dot org
     [not found] <bug-21643-4@http.gcc.gnu.org/bugzilla/>
2012-02-08 20:55 ` pinskia at gcc dot gnu.org
2012-10-31  8:46 ` jakub at gcc dot gnu.org
2012-10-31  8:52 ` 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).