public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "thorstenkurth at me dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c/60101] New: Long compile times when mixed complex floating point datatypes are used in lengthy expressions
Date: Thu, 06 Feb 2014 19:51:00 -0000	[thread overview]
Message-ID: <bug-60101-4@http.gcc.gnu.org/bugzilla/> (raw)

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

            Bug ID: 60101
           Summary: Long compile times when mixed complex floating point
                    datatypes are used in lengthy expressions
           Product: gcc
           Version: 4.8.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: thorstenkurth at me dot com

Created attachment 32071
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=32071&action=edit
Archive which includes test case.

In the example I copied below, the double.c file compiles instantly whereas the
float.c file takes very long. This is a truncated version of an even longer
file (more lines of code in the loop) and the compile time for the float.c file
grows like N^3, where N is the number of lines. Here is the output of the long
version for 4.8.2:

0x40ae17 do_spec_1
    ../../gcc-4.8.2-src/gcc-4.8.2/gcc/gcc.c:5269
0x40ae17 do_spec_1
    ../../gcc-4.8.2-src/gcc-4.8.2/gcc/gcc.c:5269
0x40c875 process_brace_body
    ../../gcc-4.8.2-src/gcc-4.8.2/gcc/gcc.c:5872
0x40c875 process_brace_body
    ../../gcc-4.8.2-src/gcc-4.8.2/gcc/gcc.c:5872
0x40c875 handle_braces
    ../../gcc-4.8.2-src/gcc-4.8.2/gcc/gcc.c:5786
0x40c875 handle_braces
    ../../gcc-4.8.2-src/gcc-4.8.2/gcc/gcc.c:5786
0x40ae17 do_spec_1
    ../../gcc-4.8.2-src/gcc-4.8.2/gcc/gcc.c:5269
0x40c875 process_brace_body
    ../../gcc-4.8.2-src/gcc-4.8.2/gcc/gcc.c:5872
and more messages like that

The attached files both compile, but they the float.c takes significantly
longer.
The only difference between those files is that the temporary variable sum is
double complex in the working version and float complex in the non-working
version. So I guess, the compiler tries to reorganize the complex
multiplications and additions so that intermediate floating point results can
be used (this is what I guess). Both files compile using the icc (>=11.0) and
clang/LLVM almost instantly. It also works for gcc<=4.4.


             reply	other threads:[~2014-02-06 19:51 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-06 19:51 thorstenkurth at me dot com [this message]
2014-02-07 12:38 ` [Bug c/60101] [4.7/4.8/4.9 Regression] " rguenth at gcc dot gnu.org
2014-02-10 13:59 ` mpolacek at gcc dot gnu.org
2014-02-10 17:29 ` mpolacek at gcc dot gnu.org
2014-02-10 17:43 ` mpolacek at gcc dot gnu.org
2014-02-10 18:12 ` jakub at gcc dot gnu.org
2014-02-10 20:07 ` mpolacek at gcc dot gnu.org
2014-02-11 13:10 ` manu at gcc dot gnu.org
2014-02-11 13:15 ` jakub at gcc dot gnu.org
2014-02-11 13:17 ` manu at gcc dot gnu.org
2014-02-12  7:36 ` jakub at gcc dot gnu.org
2014-02-12  7:40 ` [Bug c/60101] [4.7/4.8 " jakub at gcc dot gnu.org
2014-03-06  8:02 ` jakub at gcc dot gnu.org
2014-06-12 13:35 ` [Bug c/60101] [4.7 " rguenth 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=bug-60101-4@http.gcc.gnu.org/bugzilla/ \
    --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).