public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/67814] New: pentium4 cmp instruction register allocation error (tree-pre?)
@ 2015-10-02  6:32 vtjnash at gmail dot com
  2015-10-05 17:54 ` [Bug rtl-optimization/67814] " vtjnash at gmail dot com
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: vtjnash at gmail dot com @ 2015-10-02  6:32 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67814

            Bug ID: 67814
           Summary: pentium4 cmp instruction register allocation error
                    (tree-pre?)
           Product: gcc
           Version: 5.2.0
            Status: UNCONFIRMED
          Severity: major
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: vtjnash at gmail dot com
  Target Milestone: ---

Created attachment 36437
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=36437&action=edit
alloc.c compile unit containing jl_compute_field_offsets

when building code with

`gcc -m32 -march=pentium4 -fPIC -O1 -ftree-pre`, I observed the following
register allocation (?) error when the compiler was creating what should have
been a `cmp %eax,%edx` instruction (dropping any one of those flags seems to be
sufficient to avoid the error):

            size_t alsz = LLT_ALIGN(sz, al);
     cc8:       8b 55 e4                mov    -0x1c(%ebp),%edx
     ccb:       89 d0                   mov    %edx,%eax
     ccd:       83 e8 01                sub    $0x1,%eax
     cd0:       01 d8                   add    %ebx,%eax
     cd2:       21 c8                   and    %ecx,%eax
     cd4:       89 45 e4                mov    %eax,-0x1c(%ebp)
            if (alsz > sz)
**   cd7:       39 d2                   cmp    %edx,%edx  **
     cd9:       76 04                   jbe    cdf
<jl_compute_field_offsets+0x108>
                st->haspadding = 1;
     cdb:       80 4f 27 20             orb    $0x20,0x27(%edi)

The original source code can be found at
https://github.com/JuliaLang/julia/blob/26b58c6138b3e8e704ba35762e79b982b4e69b33/src/alloc.c#L583-L585,
the .i file is attached.


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

* [Bug rtl-optimization/67814] pentium4 cmp instruction register allocation error (tree-pre?)
  2015-10-02  6:32 [Bug tree-optimization/67814] New: pentium4 cmp instruction register allocation error (tree-pre?) vtjnash at gmail dot com
@ 2015-10-05 17:54 ` vtjnash at gmail dot com
  2015-10-10 16:13 ` [Bug rtl-optimization/67814] cmp instruction register allocation error (x86) vtjnash at gmail dot com
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: vtjnash at gmail dot com @ 2015-10-05 17:54 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67814

Jameson <vtjnash at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
          Component|tree-optimization           |rtl-optimization
            Version|5.2.0                       |5.1.1

--- Comment #1 from Jameson <vtjnash at gmail dot com> ---
I have discovered that the following is also sufficient to generate the same
`cmpl %ebx, %ebx` assembly:
`gcc -m32 -fPIC -O2 -ggdb3  -c alloc.i -S -o - | less`
I tested this using gcc 5.1.1 from Ubuntu 15.04 x86_64.

(search for ".loc 1 583 0" in the resulting assembly to quickly find the failed
instruction sequence).


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

* [Bug rtl-optimization/67814] cmp instruction register allocation error (x86)
  2015-10-02  6:32 [Bug tree-optimization/67814] New: pentium4 cmp instruction register allocation error (tree-pre?) vtjnash at gmail dot com
  2015-10-05 17:54 ` [Bug rtl-optimization/67814] " vtjnash at gmail dot com
@ 2015-10-10 16:13 ` vtjnash at gmail dot com
  2015-10-11 16:04 ` ubizjak at gmail dot com
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: vtjnash at gmail dot com @ 2015-10-10 16:13 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67814

--- Comment #2 from Jameson <vtjnash at gmail dot com> ---
I did some further analysis with -dump-rtl-all -dump-tree-all. The SSA form
looked fine, as did the initial conversion to RTL. It seemed like something
confused the rtl-reload pass such that decided to reordered the statements:

    size_t alsz = f(sz);
    if (alsz > sz) { };
    sz = alsz;

into:

    size_t alsz = f(sz, al);
    sz = alsz;
    if (sz > sz) { };

I tried disabling that pass (--disable-rtl-reload), but it ran into a gcc
internal compiler error: in regstat_init_n_sets_and_refs, at regstat.c:67, so I
guess this pass is required by some later pass.


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

* [Bug rtl-optimization/67814] cmp instruction register allocation error (x86)
  2015-10-02  6:32 [Bug tree-optimization/67814] New: pentium4 cmp instruction register allocation error (tree-pre?) vtjnash at gmail dot com
  2015-10-05 17:54 ` [Bug rtl-optimization/67814] " vtjnash at gmail dot com
  2015-10-10 16:13 ` [Bug rtl-optimization/67814] cmp instruction register allocation error (x86) vtjnash at gmail dot com
@ 2015-10-11 16:04 ` ubizjak at gmail dot com
  2015-10-13  1:55 ` vtjnash at gmail dot com
  2015-10-13 10:09 ` ubizjak at gmail dot com
  4 siblings, 0 replies; 6+ messages in thread
From: ubizjak at gmail dot com @ 2015-10-11 16:04 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67814

Uroš Bizjak <ubizjak at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |WAITING
   Last reconfirmed|                            |2015-10-11
     Ever confirmed|0                           |1

--- Comment #3 from Uroš Bizjak <ubizjak at gmail dot com> ---
I can't confirm this PR with current gcc-5 and gcc-6 development tree.

Can you please try with latest gcc-5 release (gcc-5.2) ?
>From gcc-bugs-return-499263-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Sun Oct 11 16:18:59 2015
Return-Path: <gcc-bugs-return-499263-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 34064 invoked by alias); 11 Oct 2015 16:18:58 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 34016 invoked by uid 48); 11 Oct 2015 16:18:54 -0000
From: "ville.voutilainen at gmail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/58566] [c++11] ICE with invalid expression in lambda body
Date: Sun, 11 Oct 2015 16:18:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: c++
X-Bugzilla-Version: 4.9.0
X-Bugzilla-Keywords: error-recovery, ice-on-invalid-code
X-Bugzilla-Severity: normal
X-Bugzilla-Who: ville.voutilainen at gmail dot com
X-Bugzilla-Status: ASSIGNED
X-Bugzilla-Resolution:
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: ville.voutilainen at gmail dot com
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields: bug_status cf_reconfirmed_on cc assigned_to everconfirmed
Message-ID: <bug-58566-4-Ah2Bv2hP7p@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-58566-4@http.gcc.gnu.org/bugzilla/>
References: <bug-58566-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 7bit
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2015-10/txt/msg00818.txt.bz2
Content-length: 865

https://gcc.gnu.org/bugzilla/show_bug.cgi?idX566

Ville Voutilainen <ville.voutilainen at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |ASSIGNED
   Last reconfirmed|                            |2015-10-11
                 CC|                            |ville.voutilainen at gmail dot com
           Assignee|unassigned at gcc dot gnu.org      |ville.voutilainen at gmail dot com
     Ever confirmed|0                           |1

--- Comment #3 from Ville Voutilainen <ville.voutilainen at gmail dot com> ---
Looks like this should be fixed by changing from void_type_node to
error_mark_node in lambda_return_type() when it diagnoses an incomplete
type. I'll see whether that causes any regressions.


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

* [Bug rtl-optimization/67814] cmp instruction register allocation error (x86)
  2015-10-02  6:32 [Bug tree-optimization/67814] New: pentium4 cmp instruction register allocation error (tree-pre?) vtjnash at gmail dot com
                   ` (2 preceding siblings ...)
  2015-10-11 16:04 ` ubizjak at gmail dot com
@ 2015-10-13  1:55 ` vtjnash at gmail dot com
  2015-10-13 10:09 ` ubizjak at gmail dot com
  4 siblings, 0 replies; 6+ messages in thread
From: vtjnash at gmail dot com @ 2015-10-13  1:55 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67814

--- Comment #4 from Jameson <vtjnash at gmail dot com> ---
I couldn't find any generic linux binaries for 5.2 (or 6) to test. The downlink
link from the download page to https://gcc.gnu.org/wiki/GFortranBinaries seems
to go to a non-existant site gfortran.com

I tested with the mingw64-gcc v5.2.0 compiler and, like you, was not able to
reproduce the issue (I had originally noticed the issue on mingw64-gcc). So it
seems like either the issue got resolved, or some other optimization is hiding
it (it was pretty sensitive to the set of flags passed to gcc in 4.9.1 and
5.1.1). Is there any chance the fix will be backported to the major binary
distribution channels such as Ubuntu?


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

* [Bug rtl-optimization/67814] cmp instruction register allocation error (x86)
  2015-10-02  6:32 [Bug tree-optimization/67814] New: pentium4 cmp instruction register allocation error (tree-pre?) vtjnash at gmail dot com
                   ` (3 preceding siblings ...)
  2015-10-13  1:55 ` vtjnash at gmail dot com
@ 2015-10-13 10:09 ` ubizjak at gmail dot com
  4 siblings, 0 replies; 6+ messages in thread
From: ubizjak at gmail dot com @ 2015-10-13 10:09 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67814

Uroš Bizjak <ubizjak at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|WAITING                     |RESOLVED
         Resolution|---                         |WORKSFORME

--- Comment #5 from Uroš Bizjak <ubizjak at gmail dot com> ---
(In reply to Jameson from comment #4)
> I couldn't find any generic linux binaries for 5.2 (or 6) to test. The
> downlink link from the download page to
> https://gcc.gnu.org/wiki/GFortranBinaries seems to go to a non-existant site
> gfortran.com
> 
> I tested with the mingw64-gcc v5.2.0 compiler and, like you, was not able to
> reproduce the issue (I had originally noticed the issue on mingw64-gcc). So
> it seems like either the issue got resolved, or some other optimization is
> hiding it (it was pretty sensitive to the set of flags passed to gcc in
> 4.9.1 and 5.1.1). Is there any chance the fix will be backported to the
> major binary distribution channels such as Ubuntu?

It is up to the distribution to update releases or backport specific patches
from the master repository.

I have checked all active branches (gcc-4.9, gcc-5 and gcc-6) and all latest
revisions fail to generate problematic instruction with the provided compile
flags.

So, WORKSFORME.
>From gcc-bugs-return-499416-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Tue Oct 13 10:09:18 2015
Return-Path: <gcc-bugs-return-499416-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 89853 invoked by alias); 13 Oct 2015 10:09:18 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 89498 invoked by uid 55); 13 Oct 2015 10:09:14 -0000
From: "vries at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug tree-optimization/67476] Add --param parloops-schedule=<static|dynamic|guided|auto|runtime>
Date: Tue, 13 Oct 2015 10:09:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: tree-optimization
X-Bugzilla-Version: 6.0
X-Bugzilla-Keywords: patch
X-Bugzilla-Severity: enhancement
X-Bugzilla-Who: vries at gcc dot gnu.org
X-Bugzilla-Status: UNCONFIRMED
X-Bugzilla-Resolution:
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields:
Message-ID: <bug-67476-4-bxRzyFxONH@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-67476-4@http.gcc.gnu.org/bugzilla/>
References: <bug-67476-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 7bit
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2015-10/txt/msg00971.txt.bz2
Content-length: 507

https://gcc.gnu.org/bugzilla/show_bug.cgi?idg476

--- Comment #11 from vries at gcc dot gnu.org ---
Author: vries
Date: Tue Oct 13 10:08:40 2015
New Revision: 228754

URL: https://gcc.gnu.org/viewcvs?rev"8754&root=gcc&view=rev
Log:
Handle original loop tree in expand_omp_for_generic

2015-10-13  Tom de Vries  <tom@codesourcery.com>

        PR tree-optimization/67476
        * omp-low.c (expand_omp_for_generic): Handle original loop tree.

Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/omp-low.c


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

end of thread, other threads:[~2015-10-13 10:09 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-10-02  6:32 [Bug tree-optimization/67814] New: pentium4 cmp instruction register allocation error (tree-pre?) vtjnash at gmail dot com
2015-10-05 17:54 ` [Bug rtl-optimization/67814] " vtjnash at gmail dot com
2015-10-10 16:13 ` [Bug rtl-optimization/67814] cmp instruction register allocation error (x86) vtjnash at gmail dot com
2015-10-11 16:04 ` ubizjak at gmail dot com
2015-10-13  1:55 ` vtjnash at gmail dot com
2015-10-13 10:09 ` ubizjak at gmail dot com

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).