public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/63605] [4.8/4.9/5 Regression] wrong code at -O3 on x86_64-linux-gnu
       [not found] <bug-63605-4@http.gcc.gnu.org/bugzilla/>
@ 2014-10-21  8:31 ` jakub at gcc dot gnu.org
  2014-10-21  8:40 ` rguenth at gcc dot gnu.org
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 8+ messages in thread
From: jakub at gcc dot gnu.org @ 2014-10-21  8:31 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2014-10-21
                 CC|                            |jakub at gcc dot gnu.org
   Target Milestone|---                         |4.8.4
            Summary|wrong code at -O3 on        |[4.8/4.9/5 Regression]
                   |x86_64-linux-gnu            |wrong code at -O3 on
                   |                            |x86_64-linux-gnu
     Ever confirmed|0                           |1

--- Comment #1 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
r186488 turned this into ICE, r192238 fixed the ICE but it has been already
miscompiled at that point.


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

* [Bug tree-optimization/63605] [4.8/4.9/5 Regression] wrong code at -O3 on x86_64-linux-gnu
       [not found] <bug-63605-4@http.gcc.gnu.org/bugzilla/>
  2014-10-21  8:31 ` [Bug tree-optimization/63605] [4.8/4.9/5 Regression] wrong code at -O3 on x86_64-linux-gnu jakub at gcc dot gnu.org
@ 2014-10-21  8:40 ` rguenth at gcc dot gnu.org
  2014-11-07 12:31 ` rguenth at gcc dot gnu.org
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 8+ messages in thread
From: rguenth at gcc dot gnu.org @ 2014-10-21  8:40 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |wrong-code
             Target|                            |x86_64-*-*
             Status|NEW                         |ASSIGNED
           Assignee|unassigned at gcc dot gnu.org      |rguenth at gcc dot gnu.org

--- Comment #2 from Richard Biener <rguenth at gcc dot gnu.org> ---
Mine.


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

* [Bug tree-optimization/63605] [4.8/4.9/5 Regression] wrong code at -O3 on x86_64-linux-gnu
       [not found] <bug-63605-4@http.gcc.gnu.org/bugzilla/>
  2014-10-21  8:31 ` [Bug tree-optimization/63605] [4.8/4.9/5 Regression] wrong code at -O3 on x86_64-linux-gnu jakub at gcc dot gnu.org
  2014-10-21  8:40 ` rguenth at gcc dot gnu.org
@ 2014-11-07 12:31 ` rguenth at gcc dot gnu.org
  2014-11-07 20:57 ` rguenth at gcc dot gnu.org
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 8+ messages in thread
From: rguenth at gcc dot gnu.org @ 2014-11-07 12:31 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Richard Biener <rguenth at gcc dot gnu.org> ---
  vect__4.18_102 = MEM[(int *)vectp_b.17_73];
  vect_d_5.19_103 = vect__4.18_102 >> 1;
  vect_patt_13.20_104 = VEC_COND_EXPR <vect__4.18_102 < { 0, 0, 0, 0 }, { 1, 1,
1, 1 }, { 0, 0, 0, 0 }>;

late forwprop does this in forward_propagate_into_cond by dispatching to fold

  Replaced 'vect_d_5.19_103 != { 0, 0, 0, 0 }' with 'vect__4.18_102 < { 0, 0,
0, 0 }'
  Replaced 'vect_d_5.19_80 != { 0, 0, 0, 0 }' with 'vect__4.18_79 < { 0, 0, 0,
0 }'

I suppose via

      /* Fold (X >> C) != 0 into X < 0 if C is one less than the width
         of X.  Similarly fold (X >> C) == 0 into X >= 0.  */
      if (TREE_CODE (arg0) == RSHIFT_EXPR
          && integer_zerop (arg1)
          && TREE_CODE (TREE_OPERAND (arg0, 1)) == INTEGER_CST)
        {
          tree arg00 = TREE_OPERAND (arg0, 0);
          tree arg01 = TREE_OPERAND (arg0, 1);
          tree itype = TREE_TYPE (arg00);
          if (wi::eq_p (arg01, TYPE_PRECISION (itype) - 1))

which checks TYPE_VECTOR_SUBPARTS here ^^^^^^

            {
              if (TYPE_UNSIGNED (itype))
                {
                  itype = signed_type_for (itype);
                  arg00 = fold_convert_loc (loc, itype, arg00);
                }
              return fold_build2_loc (loc, code == EQ_EXPR ? GE_EXPR : LT_EXPR,
                                  type, arg00, build_zero_cst (itype));
            }
        }

a simple guard with INTEGRAL_TYPE_P (TREE_TYPE (arg0)) fixes this.

Or using element_precision.


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

* [Bug tree-optimization/63605] [4.8/4.9/5 Regression] wrong code at -O3 on x86_64-linux-gnu
       [not found] <bug-63605-4@http.gcc.gnu.org/bugzilla/>
                   ` (2 preceding siblings ...)
  2014-11-07 12:31 ` rguenth at gcc dot gnu.org
@ 2014-11-07 20:57 ` rguenth at gcc dot gnu.org
  2014-11-07 21:03 ` [Bug tree-optimization/63605] [4.8/4.9 " rguenth at gcc dot gnu.org
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 8+ messages in thread
From: rguenth at gcc dot gnu.org @ 2014-11-07 20:57 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from Richard Biener <rguenth at gcc dot gnu.org> ---
Author: rguenth
Date: Fri Nov  7 20:57:01 2014
New Revision: 217238

URL: https://gcc.gnu.org/viewcvs?rev=217238&root=gcc&view=rev
Log:
2014-11-07  Richard Biener  <rguenther@suse.de>

    PR tree-optimization/63605
    * fold-const.c (fold_binary_loc): Properly use element_precision
    for types that may not be scalar.

    * gcc.dg/vect/pr63605.c: New testcase.

Added:
    trunk/gcc/testsuite/gcc.dg/vect/pr63605.c
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/fold-const.c
    trunk/gcc/testsuite/ChangeLog


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

* [Bug tree-optimization/63605] [4.8/4.9 Regression] wrong code at -O3 on x86_64-linux-gnu
       [not found] <bug-63605-4@http.gcc.gnu.org/bugzilla/>
                   ` (3 preceding siblings ...)
  2014-11-07 20:57 ` rguenth at gcc dot gnu.org
@ 2014-11-07 21:03 ` rguenth at gcc dot gnu.org
  2014-11-26 11:43 ` rguenth at gcc dot gnu.org
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 8+ messages in thread
From: rguenth at gcc dot gnu.org @ 2014-11-07 21:03 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
      Known to work|                            |5.0
            Summary|[4.8/4.9/5 Regression]      |[4.8/4.9 Regression] wrong
                   |wrong code at -O3 on        |code at -O3 on
                   |x86_64-linux-gnu            |x86_64-linux-gnu

--- Comment #5 from Richard Biener <rguenth at gcc dot gnu.org> ---
Fixed on trunk sofar.


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

* [Bug tree-optimization/63605] [4.8/4.9 Regression] wrong code at -O3 on x86_64-linux-gnu
       [not found] <bug-63605-4@http.gcc.gnu.org/bugzilla/>
                   ` (4 preceding siblings ...)
  2014-11-07 21:03 ` [Bug tree-optimization/63605] [4.8/4.9 " rguenth at gcc dot gnu.org
@ 2014-11-26 11:43 ` rguenth at gcc dot gnu.org
  2014-11-26 13:16 ` [Bug tree-optimization/63605] [4.8 " rguenth at gcc dot gnu.org
  2014-11-26 13:16 ` rguenth at gcc dot gnu.org
  7 siblings, 0 replies; 8+ messages in thread
From: rguenth at gcc dot gnu.org @ 2014-11-26 11:43 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #6 from Richard Biener <rguenth at gcc dot gnu.org> ---
Author: rguenth
Date: Wed Nov 26 11:42:44 2014
New Revision: 218078

URL: https://gcc.gnu.org/viewcvs?rev=218078&root=gcc&view=rev
Log:
2014-11-26  Richard Biener  <rguenther@suse.de>

    Backport from mainline
    2014-11-26  Richard Biener  <rguenther@suse.de>

    PR tree-optimization/62238
    * tree-predcom.c (ref_at_iteration): Unshare the expression
    before gimplifying it.

    * gcc.dg/torture/pr62238.c: New testcase.

    2014-11-25  Richard Biener  <rguenther@suse.de>

    PR tree-optimization/61927
    * tree-vect-loop.c (vect_analyze_loop_2): Revert ordering
    of group and pattern analysis to the one in GCC 4.8.

    2014-11-07  Richard Biener  <rguenther@suse.de>

    PR tree-optimization/63605
    * fold-const.c (fold_binary_loc): Properly use element_precision
    for types that may not be scalar.

    * gcc.dg/vect/pr63605.c: New testcase.

    2014-10-28  Richard Biener  <rguenther@suse.de>

    PR middle-end/63665
    * fold-const.c (fold_comparison): Properly guard simplifying
    against INT_MAX/INT_MIN with !TYPE_OVERFLOW_WRAPS.

    * gcc.dg/pr63665.c: New testcase.

Added:
    branches/gcc-4_9-branch/gcc/testsuite/gcc.dg/pr63665.c
    branches/gcc-4_9-branch/gcc/testsuite/gcc.dg/torture/pr62238.c
    branches/gcc-4_9-branch/gcc/testsuite/gcc.dg/vect/pr63605.c
Modified:
    branches/gcc-4_9-branch/gcc/ChangeLog
    branches/gcc-4_9-branch/gcc/fold-const.c
    branches/gcc-4_9-branch/gcc/testsuite/ChangeLog
    branches/gcc-4_9-branch/gcc/tree-predcom.c
    branches/gcc-4_9-branch/gcc/tree-vect-loop.c


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

* [Bug tree-optimization/63605] [4.8 Regression] wrong code at -O3 on x86_64-linux-gnu
       [not found] <bug-63605-4@http.gcc.gnu.org/bugzilla/>
                   ` (5 preceding siblings ...)
  2014-11-26 11:43 ` rguenth at gcc dot gnu.org
@ 2014-11-26 13:16 ` rguenth at gcc dot gnu.org
  2014-11-26 13:16 ` rguenth at gcc dot gnu.org
  7 siblings, 0 replies; 8+ messages in thread
From: rguenth at gcc dot gnu.org @ 2014-11-26 13:16 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #7 from Richard Biener <rguenth at gcc dot gnu.org> ---
Author: rguenth
Date: Wed Nov 26 13:15:16 2014
New Revision: 218079

URL: https://gcc.gnu.org/viewcvs?rev=218079&root=gcc&view=rev
Log:
2014-11-26  Richard Biener  <rguenther@suse.de>

    Backport from mainline
    2014-10-08  Richard Biener  <rguenther@suse.de>

    PR tree-optimization/61969
    * tree-nrv.c (pass_nrv::execute): Properly test for automatic
    variables.

    2014-08-15  Richard Biener  <rguenther@suse.de>

    PR tree-optimization/62031
    * tree-data-ref.c (dr_analyze_indices): Do not set
    DR_UNCONSTRAINED_BASE.
    (dr_may_alias_p): All indirect accesses have to go the
    formerly DR_UNCONSTRAINED_BASE path.
    * tree-data-ref.h (struct indices): Remove
    unconstrained_base member.
    (DR_UNCONSTRAINED_BASE): Remove.

    * gcc.dg/torture/pr62031.c: New testcase.

    2014-10-10  Richard Biener  <rguenther@suse.de>

    PR tree-optimization/63379
    * tree-vect-slp.c (vect_get_constant_vectors): Do not compute
    a neutral operand for min/max when it is not a reduction chain.

    * gcc.dg/vect/pr63379.c: New testcase.

    2014-11-07  Richard Biener  <rguenther@suse.de>

    PR tree-optimization/63605
    * fold-const.c (fold_binary_loc): Properly use element_precision
    for types that may not be scalar.

    * gcc.dg/vect/pr63605.c: New testcase.

    2014-10-28  Richard Biener  <rguenther@suse.de>

    PR middle-end/63665
    * fold-const.c (fold_comparison): Properly guard simplifying
    against INT_MAX/INT_MIN with !TYPE_OVERFLOW_WRAPS.

    * gcc.dg/pr63665.c: New testcase.

Added:
    branches/gcc-4_8-branch/gcc/testsuite/gcc.dg/pr63665.c
    branches/gcc-4_8-branch/gcc/testsuite/gcc.dg/torture/pr62031.c
    branches/gcc-4_8-branch/gcc/testsuite/gcc.dg/vect/pr63379.c
    branches/gcc-4_8-branch/gcc/testsuite/gcc.dg/vect/pr63605.c
Modified:
    branches/gcc-4_8-branch/gcc/ChangeLog
    branches/gcc-4_8-branch/gcc/fold-const.c
    branches/gcc-4_8-branch/gcc/testsuite/ChangeLog
    branches/gcc-4_8-branch/gcc/tree-data-ref.c
    branches/gcc-4_8-branch/gcc/tree-data-ref.h
    branches/gcc-4_8-branch/gcc/tree-nrv.c
    branches/gcc-4_8-branch/gcc/tree-vect-slp.c


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

* [Bug tree-optimization/63605] [4.8 Regression] wrong code at -O3 on x86_64-linux-gnu
       [not found] <bug-63605-4@http.gcc.gnu.org/bugzilla/>
                   ` (6 preceding siblings ...)
  2014-11-26 13:16 ` [Bug tree-optimization/63605] [4.8 " rguenth at gcc dot gnu.org
@ 2014-11-26 13:16 ` rguenth at gcc dot gnu.org
  7 siblings, 0 replies; 8+ messages in thread
From: rguenth at gcc dot gnu.org @ 2014-11-26 13:16 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|---                         |FIXED
      Known to fail|                            |4.8.3

--- Comment #8 from Richard Biener <rguenth at gcc dot gnu.org> ---
Fixed.


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

end of thread, other threads:[~2014-11-26 13:16 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-63605-4@http.gcc.gnu.org/bugzilla/>
2014-10-21  8:31 ` [Bug tree-optimization/63605] [4.8/4.9/5 Regression] wrong code at -O3 on x86_64-linux-gnu jakub at gcc dot gnu.org
2014-10-21  8:40 ` rguenth at gcc dot gnu.org
2014-11-07 12:31 ` rguenth at gcc dot gnu.org
2014-11-07 20:57 ` rguenth at gcc dot gnu.org
2014-11-07 21:03 ` [Bug tree-optimization/63605] [4.8/4.9 " rguenth at gcc dot gnu.org
2014-11-26 11:43 ` rguenth at gcc dot gnu.org
2014-11-26 13:16 ` [Bug tree-optimization/63605] [4.8 " rguenth at gcc dot gnu.org
2014-11-26 13:16 ` rguenth 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).