public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "changpeng dot fang at amd dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug tree-optimization/43529] G++ doesn't optimize away empty loop when index is a double
Date: Fri, 04 Jun 2010 23:29:00 -0000	[thread overview]
Message-ID: <20100604232939.27228.qmail@sourceware.org> (raw)
In-Reply-To: <bug-43529-18958@http.gcc.gnu.org/bugzilla/>



------- Comment #3 from changpeng dot fang at amd dot com  2010-06-04 23:29 -------
(In reply to comment #2)
> Interesting! What's the difference between 17 and 18?
> ------------
> int main()
> {
>   double i;
>   for(i=0; i<18; i+=1); /* gcc -O3, empty loop not removed */
> }


The funny thing occurs in gcc 4, not gcc 6:

        .file   "empty.c"
        .text
        .p2align 4,,15
.globl main
        .type   main, @function
main:
.LFB0:
        .cfi_startproc
        xorl    %eax, %eax
        .p2align 4,,10
        .p2align 3
.L2:
        addl    $1, %eax
        cmpl    $18, %eax
        jne     .L2
        rep
        ret
        .cfi_endproc
.LFE0:
        .size   main, .-main
        .ident  "GCC: (Ubuntu 4.4.1-4ubuntu9) 4.4.1"
        .section        .note.GNU-stack,"",@progbits


-- 


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


  parent reply	other threads:[~2010-06-04 23:29 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-25 23:42 [Bug c++/43529] New: " evouga at gmail dot com
2010-03-26 11:46 ` [Bug tree-optimization/43529] " rguenth at gcc dot gnu dot org
2010-06-04 23:15 ` changpeng dot fang at amd dot com
2010-06-04 23:29 ` changpeng dot fang at amd dot com [this message]
2010-06-05  0:05 ` pinskia at gcc dot gnu dot org
2010-06-05 10:40 ` rguenth at gcc dot gnu dot org
     [not found] <bug-43529-4@http.gcc.gnu.org/bugzilla/>
2023-08-08  1:38 ` pinskia at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20100604232939.27228.qmail@sourceware.org \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).