public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "jakub at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug target/63966] [5 regression] inconsistent operand constraints compiling build libcpp
Date: Thu, 20 Nov 2014 10:09:00 -0000	[thread overview]
Message-ID: <bug-63966-4-j4Sc7ks1ZI@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-63966-4@http.gcc.gnu.org/bugzilla/>

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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jakub at gcc dot gnu.org

--- Comment #7 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
(In reply to Uroš Bizjak from comment #5)
> Can you please test this patch:
> 
> --cut here--
> Index: lex.c
> ===================================================================
> --- lex.c       (revision 217789)
> +++ lex.c       (working copy)
> @@ -471,7 +471,11 @@
>  
>  /* Check the CPU capabilities.  */
>  
> +#if (GCC_VERSION >= 5000)
>  #include "../gcc/config/i386/cpuid.h"
> +#else
> +#include <cpuid.h>
> +#endif
>  
>  typedef const uchar * (*search_line_fast_type) (const uchar *, const uchar
> *);
>  static search_line_fast_type search_line_fast;
> --cut here--

That assumes there is <cpuid.h> provided by the system compiler.
The code is guarded with
#if (GCC_VERSION >= 4005) && (defined(__i386__) || defined(__x86_64__)) &&
!(defined(__sun__) && defined(__svr4__))
but doesn't clang and icc pretend to be some versions of GCC?
I think better would be to include #include "../gcc/config/i386/cpuid.h"
only if GCC_VERSION >= 5000 (or perhaps that or __PIC__ not defined or
__x86_64__ defined), and otherwise not use __get_cpuid at all, just statically
decide based on minimum value.
>From gcc-bugs-return-467693-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Thu Nov 20 10:21:27 2014
Return-Path: <gcc-bugs-return-467693-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 11603 invoked by alias); 20 Nov 2014 10:21:26 -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 11568 invoked by uid 48); 20 Nov 2014 10:21:23 -0000
From: "rguenth at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug tree-optimization/63986] [5 Regression][SH] gcc.target/sh/pr51244-15.c failures
Date: Thu, 20 Nov 2014 10:21: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: 5.0
X-Bugzilla-Keywords: missed-optimization
X-Bugzilla-Severity: normal
X-Bugzilla-Who: rguenth at gcc dot gnu.org
X-Bugzilla-Status: NEW
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: 5.0
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields: bug_status cc assigned_to
Message-ID: <bug-63986-4-UYKg3vfyzE@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-63986-4@http.gcc.gnu.org/bugzilla/>
References: <bug-63986-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: 2014-11/txt/msg02165.txt.bz2
Content-length: 2042

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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |NEW
                 CC|                            |ppalka at gcc dot gnu.org,
                   |                            |rguenth at gcc dot gnu.org
           Assignee|rguenth at gcc dot gnu.org         |unassigned at gcc dot gnu.org

--- Comment #3 from Richard Biener <rguenth at gcc dot gnu.org> ---
Ok, now already existing forwprop code gets fed with

  <bb 2>:
  _3 = a_2(D) == 0;
  x_4 = (char) _3;
  _7 = ~_3;
  _8 = (int) _7;
  MEM[(int *)d_5(D) + 8B] = _8;
  if (x_4 != 0)

where we now in the first forwprop pass identified the opportunity
to use ~_3 instead of x_4 == 0 thus x_4 is now no longer multi-use.
This makes us optimize if (x_4 != 0) to if (_3 != 0) which we
re-optimize in fold_gimple_cond now to '_3' and then of course
if (_3 != 0) (err, and we return "changed"....) which means we
now propagate _again_ via forward_propagate_into_gimple_cond
which now specifically allows aggressive forwarding of compares,
bypassing single-use restrictions.  See

2014-11-16  Patrick Palka  <ppalka@gcc.gnu.org>

        PR middle-end/63790
        * tree-ssa-forwprop.c (forward_propagate_into_comparison_1):
        Always combine comparisons or conversions from booleans.

thus me fixing my "mistake" does not help anymore.

I suppose RTL CSE cannot CSE flag register sets...?

Btw, my previous comment was incorrect - the code is what is now produced
on trunk while on the 4.9 branch we create

test_0:
.LFB0:
        .cfi_startproc
        testl   %edi, %edi
        movl    %edx, %eax
        sete    %r8b
        movl    %r8d, %edi
        xorl    $1, %edi
        testb   %r8b, %r8b
        movzbl  %dil, %edi
        cmovne  %esi, %eax
        movl    %edi, 8(%rcx)
        ret

which means code generation improved for x86...


  parent reply	other threads:[~2014-11-20 10:09 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-19 14:41 [Bug bootstrap/63966] New: " ro at gcc dot gnu.org
2014-11-19 14:41 ` [Bug bootstrap/63966] " ro at gcc dot gnu.org
2014-11-19 14:48 ` [Bug target/63966] " rguenth at gcc dot gnu.org
2014-11-19 14:58 ` ubizjak at gmail dot com
2014-11-19 19:28 ` ubizjak at gmail dot com
2014-11-19 21:03 ` ro at CeBiTec dot Uni-Bielefeld.DE
2014-11-20 10:09 ` jakub at gcc dot gnu.org [this message]
2014-11-20 10:44 ` uros at gcc dot gnu.org
2014-11-20 10:50 ` ubizjak at gmail dot com
2014-11-20 11:02 ` ubizjak at gmail dot com
2014-11-20 11:08 ` jakub at gcc dot gnu.org
2014-11-20 11:10 ` ubizjak at gmail dot com
2014-11-20 12:10 ` uros at gcc dot gnu.org
2014-11-20 12:15 ` ubizjak at gmail dot com

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-63966-4-j4Sc7ks1ZI@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).